Hi,
I am trying to get feature details from the hosted feature layer for the lat long values using below query
latitude: 40.121100
longitude: -76.032700
getting
{"error":{"code":400,"message":"Cannot perform query. Invalid query parameters.","details":["'geometry' parameter is invalid"]}}
any help would be greatly appreciated?
Thanks
Chitra
Solved! Go to Solution.
PS - Since you're using a point in lat/lon, don't forget the inSRID parameter as well. Tack this onto your query URL:
&geometryType=esriGeometryPoint&inSR=4326
That will get you an actual result.
You didn't include the geometryType in the query. From the documentation:
The geometry to apply as the spatial filter. The structure of the geometry is the same as the structure of the JSON geometry objects returned by the ArcGIS REST API. In addition to the JSON structures, you can specify the geometry of envelopes and points with a simple comma-separated syntax.
Syntax:
- JSON structures: geometryType=<geometryType>&geometry={ geometry}
- Envelope simple syntax: geometryType=esriGeometryEnvelope&geometry=<xmin>,<ymin>,<xmax>,<ymax>
- Point simple syntax: geometryType=esriGeometryPoint&geometry=<x>,<y>
Examples:
- geometryType=esriGeometryEnvelope&geometry={xmin: -104, ymin: 35.6, xmax: -94.32, ymax: 41}
- geometryType=esriGeometryEnvelope&geometry=-104,35.6,-94.32,41
- geometryType=esriGeometryPoint&geometry=-104,35.6
PS - Since you're using a point in lat/lon, don't forget the inSRID parameter as well. Tack this onto your query URL:
&geometryType=esriGeometryPoint&inSR=4326
That will get you an actual result.
that works awesomely after adding inSRID. Thank you very much!!!!
Thank you both.
-Chitra