Exif仅返回整数lat和lon

| 通过我的应用程序,我将图像上传到数据库。对于图像,我想使用exif数据捕获图像的拍摄位置。当我在手机上进行测试时,经纬度确实上传了,但只能上传到四舍五入的正数。 当我期望Lat = 52.4和lon = -1.9的位置时,实际上得到lat = 52和lon 1 这是我的代码; lat和lon都是String:
ExifInterface exif = new ExifInterface(mainMenu.filename);    
lat = exif.getAttribute(ExifInterface.TAG_GPS_LATITUDE);
lon = exif.getAttribute(ExifInterface.TAG_GPS_LONGITUDE);
我用于保存lat和lon的数据库值是double,我也尝试过float。     
已邀请:
查看ExifInterface的文档,您是否应该使用getLatLong(float []输出)方法呢?
float[] latLong = new float[2];
if (exif.getLatLong(latLong)) {
    // latLong[0] holds the Latitude value now.
    // latLong[1] holds the Longitude value now.
}
else {
    // Latitude and Longitude were not included in the Exif data.
}
    

要回复问题请先登录注册