From double to geopoint remove me the ,

525 views Asked by At

i have 2 doubles, lat and long with the form (X.XXXXXX). I'm trying to make new GeoPoint from this values, but when I convert to GeoPoint, remove the , obtain this result geopoint(XXXX,XXXX);

Double latitudEditando = Double.parseDouble(datosLugar.get(4).toString());  
Double longitudEditando = Double.parseDouble(datosLugar.get(5).toString());   
puntoEditando = new GeoPoint((int)(latitudEditando*1e6), (int)(longitudEditando*1e6));

What am I doing wrong?

datosLugar.get(4) return me: 40.3138987 (Double) 
datosLugar.get(5) return me: -3.8811184 (double)
 puntoEditando return me (403138987,-38811184)

Sorry, thats OK, i think geopoint there is (40,00000 , 44,000)

1

There are 1 answers

0
aromero On

The GeoPoint class from the google addons is constructed with latitude and longitude as microdegrees in the form of a int. This is fine as long as latitudEditando and longitudEditando are doubles that express coordinates in degrees:

new GeoPoint((int)(latitudEditando*1e6), (int)(longitudEditando*1e6));