I am creating an Android application that includes the ability to display images on a map.
How can I extract location data from a .jpg file (if there is location data)?
Thanks a lot, Todd.
There is a good tutorial on how to access exif data (which includes the GPS information you need) from jpg, which can help you:http://android-coding.blogspot.com/2011/10/read-exif-of-jpg-file-using.html
The corresponding class is described in official documents:http://developer.android.com/reference/android/media/ExifInterface.html
You can also find useful mail (convert GPS information):http://android-coding.blogspot.com/2011/10/convert-gps-tag-of-exifinterface-to.html
Here is how I did it:
try { final ExifInterface exifInterface = new ExifInterface(imagePath); float[] latLong = new float[2]; if (exifInterface.getLatLong(latLong)) { // Do stuff with lat / long... } } catch (IOException e) { logger.info("Couldn't read exif info: " + e.getLocalizedMessage()); }
Source: https://habr.com/ru/post/1416552/More articles:How to determine values โโthat do not fit in Excel cells using VBA? - vbamany focused photos with one focus on Android? - javaWhat is this floating point format? - floating-pointA way to combine and group elements for an activity feed using javascript - javascriptHow to check if mail file is protected in iOS? - iosGet GPS Address Photos - javaFailed to install TFS installation - tfsThe best way to manage multiple client endpoint configurations (IP address, etc.) In app.config is .netWFS GetFeature with several levels and different property names - mapsWhat is a runnable object passed in a Java thread pool RejectedExecutionHandler - javaAll Articles