2013-07-10 3 views
1

안드로이드 폰으로 촬영 한 사진의 EXIF ​​데이터를 사용하고 있으며 일반적으로 GPS 데이터를 얻는 것은 매우 간단하며 간단한 [double latitude, double longtitude] 형식으로 반환되며 매우 효과적입니다. 그러나 때로는 [247322, 124390]과 같이 이해할 수없는 숫자를 줄 것이며, 다른 형식으로 나에게 반환하기 때문에 이것이라고 추측합니다.하지만 확실하지 않습니다.Android에서 EXIF ​​GPS 데이터를 반환하는 형식은 무엇입니까?

EXIF ​​GPS 데이터가 어떤 형식으로 반환되는지 알고 있습니까? 어떤 도움

  var gps = GetImageGps(filePath, currentTimeInMillisenconds); 
      double latitude = 0; 
      double longitude = 0; 

      if (gps != null && gps[0] != 0 && gps[1] != 0) 
      { 
       _gpsLocation = gps; 
       latitude = gps[0]; 
       longitude = gps[1]; 

       if ((latitude < -90 || latitude > 90) && (longitude < -180 || latitude > 180)) 
       { 
        //here I will handle another format 
       } 
      } 

감사 :

여기 내 코드입니다!

답변

0

GetImageGps에서 ExifInterface을 사용하고 있습니까?

는이 같은 시도


ExifInterface exifInterface = new ExifInterface(fileName); 
float[] latLng = new float[2]; 
if (exifInterface .getLatLong(latLng)) { //file has exif latlong info 
    //etc, latLng[0] is your latitute value and latLng[1] your longitude value 
} 

+0

예는 기본적으로 같은 일이지만 (C 번호와 안드로이드) Monodroid에 대한합니다 (getLatLong 방법을 사용해야합니다)하지만 언제나 [도]를 반환 않습니다? 또는 때로는 [도, 분, 초]를 반환합니까? – clifgray

+0

확인 http://docs.xamarin.com/recipes/ios/media/images/access_image_metadata 및 http://docs.go-mono.com/index.aspx?link=M%3AAndroid.Media.ExifInterface.GetLatLong (System.Single % 5B % 5D) –

관련 문제