1

I'm using the ArcGIS API for JavaScript to query features in a web map. After sending an identify request to my ArcGIS Server 10.2.2 Map Service (added as ArcGISDynamicMapServiceLayer, the response is missing a spatialReference object, which in my application causes the parsed feature to default to WGS 1984 (EPSG: 4326).

This is my request:

http://my.server.ip:6080/arcgis/rest/services/MyMapService/MapServer/identify?f=json&geometry=%7B%22x%22:1452552.552270479,%22y%22:7513080.65512973,%22spatialReference%22:%7B%22wkid%22:102100%7D%7D&tolerance=5&returnGeometry=true&mapExtent=%7B%22xmin%22:1400269.6249234888,%22ymin%22:7501309.352773828,%22xmax%22:1547028.7192308295,%22ymax%22:7531884.164087858,%22spatialReference%22:%7B%22wkid%22:102100%7D%7D&imageDisplay=400,400,96&geometryType=esriGeometryPoint&sr=102100&layers=all:1

Notably, is specifyes using the Spherical Mercator projection (Google/OSM etc) in these three parameters:

sr: 102100,
geometry:{"x":1452552.552270479,"y":7513080.65512973,"spatialReference":{"wkid":102100}}
mapExtent:{"xmin":1400269.6249234888,"ymin":7501309.352773828,"xmax":1547028.7192308295,"ymax":7531884.164087858,"spatialReference":{"wkid":102100}}

The response comes back like this (indented for legibility):

{
  "results": [{
    "layerId":1,
    "layerName":"MyLayer",
    "displayFieldName":"objectTitle",
    "value":"TestTitle",
    "attributes": {
      "geom":"Polygon",
      "objectTitle":"TestTitle",
      "ESRI_OID":"5"
    },
    "geometryType":"esriGeometryPolygon",
    "geometry": {
      "rings": [
        [
          [1454668.8173357714,7517201.4526984785],
          [1455184.6049274686,7515021.5271282298],
          [1454315.3831670529,7513419.0967461951],
          [1453618.9498499723,7512120.8890253156],
          [1452935.2001523944,7510514.1489123777],
          [1452177.4970599019,7510191.5673684804],
          [1450715.0293152332,7515680.0804733364],
          [1453744.8112331014,7517255.1012338968],
          [1454668.8173357714,7517201.4526984785]
        ]
      ]
    }
  }]
}

The same request sent to my ArcGIS Server 10.2.1 server returns the same response but with a spatialReference at the end of the feature:

{
  "results": [{
    "layerId":1,
    "layerName":"MyLayer",
    "displayFieldName":"objectTitle",
    "value":"TestTitle",
    "attributes": {
      "geom":"Polygon",
      "objectTitle":"TestTitle",
      "ESRI_OID":"5"
    },
    "geometryType":"esriGeometryPolygon",
    "geometry": {
      "rings": [
        [
          [1454668.8173357714,7517201.4526984785],
          [1455184.6049274686,7515021.5271282298],
          [1454315.3831670529,7513419.0967461951],
          [1453618.9498499723,7512120.8890253156],
          [1452935.2001523944,7510514.1489123777],
          [1452177.4970599019,7510191.5673684804],
          [1450715.0293152332,7515680.0804733364],
          [1453744.8112331014,7517255.1012338968],
          [1454668.8173357714,7517201.4526984785]
        ]
      ],
      "spatialReference":{"wkid":102100,"latestWkid":3857}
    }
  }]
}

Could there be something wrong with my request or is there a server/service option I've missed?

2

As per the response syntax and example in the documentation here, ArcGIS Server should definitely be returning the spatialReference to you explicitly.

see this thread for more info about the confirmed bug.

  • Thanks! I'll just add that your link also contains a user suggested workaround, which is the same that solved my issue too. – MattiasSp Nov 19 '14 at 8:07

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.