Android如何访问jpg文件中的位置数据

8

我正在开发一个包含在地图上显示图片功能的Android应用。

如果.jpg文件中有位置数据,我该如何提取它们?

Todd,非常感谢。


看这个,我认为这正是你想要的:https://dev59.com/gmHVa4cB1Zd3GeqPr_QI - Bigflow
2个回答

19

http://stackoverflow.com/questions/33798250/how-to-get-location-and-other-information-from-image-in-android - Devendra Singh

2
这是我完成的方法:
    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());
    }

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接