1

I got access to some data from an ESRI-based interactive map and I am trying to make sense of the data. In particular, I'd like to extract the geometry of some shapes. Below is a snippet of the JSON file. The data I'm interested in are the coordinates in the rings array.

"spatialReference": {
  "wkid": 102100,
  "latestWkid": 3857
},

...

{
  "attributes": {
    "OBJECTID": 9,
    "SEC_AREA": "Place",
    "SHAPE_Length": 0.47231263503454957,
    "SHAPE_Area": 0.0018331050756540896
  },
  "geometry": {
    "rings": [
      [
        [
          -13710176.908767894,
          6294974.636926275
        ],
        [
          -13710176.877294399,
          6294974.687023439
        ],
        [
          -13710176.612313965,
          6294974.836912473
        ],
        [
          -13710176.908767894,
          6294974.636926275
        ]
      ]
    ]
  }
}

The closest I've found is the this document which describes the rings, but does not describe the format of the coordinates themselves. They are certainly not latitudes/longitudes.

From experimentation, I've found that if I divide these coordinates by constants, one for the X and another for the Y, I do get close to the lats/lons I'm expecting, but I'd like to find out how these values are meant to be encoded. Can anyone shed some light?

  • Have you searched the file for an EPSG-code? – Erik Aug 15 '19 at 14:31
  • hi @Erik, I don't see any mention of EPSG. The only reference I see is a wkid. I'm afraid I'm not familiar with this field and don't know what wkid is. I've updated the JSON. – Roxy Aug 15 '19 at 14:36
  • 3
    From the first lines I would assume it is PseudoMercator (EPSG:3857) – MrXsquared Aug 15 '19 at 14:46
  • Hi @MrXsquared, I have looked at en.wikipedia.org/wiki/Web_Mercator_projection (based on 102100 being WGS_1984_Web_Mercator_Auxiliary_Sphere) already but I cannot work the formulas to get the coordinates above. For example, for the first coordinate above, -13710176.908767894, 6294974.636926275, the lon/lat should be -123.160664, 49.118444. – Roxy Aug 15 '19 at 14:51
  • And it is: epsg.io/… - almost – Erik Aug 15 '19 at 14:55
1

You are looking at the WGS84/Pseudo-Mercator (EPSG: 3857) projection, which is used in several mapping applications and resembles the WGS84 Coordinate System. The main difference here is that the unit of the coordinates in the former is metre and degree in the latter. That is the reason you have different coordinates.

It would be useful if you could shed some light about the way you are exporting that data. Some Esri applications can provide a way of specifyng the coordinate system of the output geometries, which would simplify your job from the beginning. Also, there are several tools and programs (such as ArcGIS and QGIS) that let you reproject data, meaning that you can convert your polygons to EPSG 4326. Furthermore, if you have coding skills, you could automate this task using libraries such as GDAL (available in multiple languages).

On other hand, you are getting that JSON from a request to the service (layer) URL in some ArcGIS Server. There is an ArcGIS REST API which lets you specify the output coordinate system of the geometries, and would be an option too.

| improve this answer | |

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.