0

I am getting the LAT and LNG position from Android. Both values are of type double, in Degrees.

For example: NY, USA Latitude: 40.7142700
Longitude: -74.0059700

Then I have a service ArcGIS REST. It uses esriMeters.

How do I convert Lat Lng to esriMeters and back?


More information:

Spatial Reference: 32721 (32721)

  • If it's esriMeters, then there's likely a spatial reference as well (aka coordinate system). What is it? Could be EPSG:3857 (Web Mercator). – mkennedy Apr 28 '15 at 22:10
  • It says: Spatial Reference: 32721 (32721). – Daniel Benedykt Apr 29 '15 at 1:22
  • Ah. Well, 32721 is WGS84 UTM 21 South. That's...odd. I think someone confused the latitude band designation, which is "S" for latitudes between 32 North and 40 North. Technically, your sample point is in band "T". However, the longitude value should be in zone 18 North, not 21 (North or South). – mkennedy Apr 29 '15 at 16:38
  • You are correct, the example I gave is wrong since it's outside the area. Anyway, I want to convert LatLng to 32721(WGS84 UTM 21 South) and back. Do you know how to convert it or where to get that information? thanks. – Daniel Benedykt Apr 29 '15 at 21:46
  • developers.arcgis.com/android/api-reference/reference/com/esri/… ? (I don't know the various web APIs that well) – mkennedy Apr 29 '15 at 21:49
1

This is simple technique you should use com.esri.core.geometry.Point class for converting your GPS lat and lng into ArcGIS map point. For Example:

private Point ConvertMyLocationPoint(final double x, final double y) {
        Point wgspoint = new Point(x, y);
        Point mapPoint = (Point) GeometryEngine.project(wgspoint, SpatialReference.create(4326),
                mMapView.getSpatialReference());

        return mapPoint;    
    }

Reference from this link

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.