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
https://services8.arcgis.com/HPJsu0I9OjNDnQ7I/ArcGIS/rest/services/tl_2020_42_tabblock20/FeatureServer/0/query?where=STATEFP20=42&geometry=-76,40&spatialRel=esriSpatialRelIntersects&outFields=*&f=json
getting
{"error":{"code":400,"message":"Cannot perform query. Invalid query parameters.","details":["'geometry' parameter is invalid"]}}
any help would be greatly appreciated?
Thanks
Chitra
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
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,41geometryType=esriGeometryPoint&geometry=-104,35.6
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:
Examples:
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.