Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Taking picture and geotag it

I should make an app to take a picture and geotag it. I see 2 ways to do it:

  1. Using an intent for the android camera default, take the picture (meanwhile looking for GPS location), and then edit EXIF header;
  2. Build a camera application through the camera API, then geotag it with setGpsLatitude() etc.

I'd like to know which is the best choice, or generally when is better using first or the second way.

like image 698
KitKat Avatar asked Mar 27 '12 21:03

KitKat


2 Answers

I would use an intent to the camera and then geo tag it. Check out this documentation for the gps side of things. http://developer.android.com/guide/topics/location/obtaining-user-location.html

Just as an FYI if you want the gps to be super accurate it is not a pleasure to work with. Especially if the user is in a basement somewhere.

From my knowledge there are two main routes for gps. Fine gps and network. Network uses triangulation of service towers to tie down a gps corrd. Not super accurate but it works. Fine works but can take up to 15 seconds if the user is in a bad spot.

You also could use the google maps api and allow the user to enter in an address of where the photo was taken and convert that address to a lat and lng. https://developers.google.com/maps/documentation/geocoding/

Cheers,

Jake

like image 166
JakeWilson801 Avatar answered Oct 01 '22 00:10

JakeWilson801


check android camera app source,

get geo location: https://android.googlesource.com/platform/packages/apps/Camera.git/+/android-4.4.2_r2/src/com/android/camera/LocationManager.java

geo tag: https://android.googlesource.com/platform/packages/apps/Camera.git/+/android-4.4.2_r2/src/com/android/camera/Storage.java

like image 44
Helin Wang Avatar answered Sep 30 '22 23:09

Helin Wang