Point coordinates

356
1
05-19-2021 11:50 PM
Amitkhillan
New Contributor

Hello All,

 

 I am using Point function in Android code to pass values of latitude and longitude, If I sent values in 7 digits after decimal (30.7400728___76.7450737), below function converts it into 6 digits (30.740072___76.745073 ) which brings down quality of accuracy. Any suggestions or solutions will be helpful. I am pasting steps below:

 

com.esri.arcgisruntime.geometry.Point?
startPoint = Point(mapCenterLongitude!!.toDouble(), mapCenterLatitude!!.toDouble(), srWgs84)
val startLocation = Graphic(startPoint, locationMarker)
val toLatitudeLongitude = CoordinateFormatter.toLatitudeLongitude( mapPoint, CoordinateFormatter.LatitudeLongitudeFormat.DECIMAL_DEGREES, 7 )
 
Thanks,
Amit
0 Kudos
1 Reply
RamaChintapalli
Esri Contributor

Hi,

Can you be more specific which function is converting it to 6 digits?

I ran a quick test of your coordinates and here is what I was getting.

public void testPointToDD() {

     double expectedLatitude = 30.7400728;
     double expectedLongitude = 76.7450737;

     Point expectedPointWGS84 = new Point(expectedLongitude, expectedLatitude, wgs84);

     String dd = CoordinateFormatter.toLatitudeLongitude(expectedPointWGS84,
        CoordinateFormatter.LatitudeLongitudeFormat.DECIMAL_DEGREES, 7);

    assertEquals("30.7400728N 076.7450737E", dd);
  }


Thanks
Rama