I'm attempting to pull a json response of Point records that fall within an arbitrarily defined polygon from an ArcGIS REST endpoint (MapServer). The endpoint supports JSON response and querying. Everything is in EPSG 4326, nothing weird.
I'm trying to query it by esriGeometryPolygon.
It is a simple 4-sided polygon built clockwise. Coords are in Y,X format.
My ring looks like this:
{"rings":[[[10,20],[10,40],[30,40],[30,20],[10,20]]]}
I figure the "spatialReference" element defaults to 4326 for json though couldn't find that explicitly stated in documentation. However, adding the spatialReference property makes no difference.
I am wrapping this all in a GET call that looks like this (the server is not internet accessible so I'm making it generic):
https://server/arcgis/rest/services/PARENT/SERVICENAME/MapServer/0/query?geometry={"rings":[[[10,20],[10,40],[30,40],[30,20],[10,20]]]}&geometryType=esriGeometryPolygon&spatialRel=esriSpatialRelIntersects&outFields=FIELDNAME&returnGeometry=false&returnTrueCurves=false&returnIdsOnly=false&returnCountOnly=false&returnZ=false&returnDistinctValues=false&returnExtentsOnly=false&f=pjson
When I go to this area on the service, there are definitely features within the polygon. However, they will not return via this query. So I figure I'm doing something wrong in structuring my request. Even on the REST querying documentation there are no examples showing how to clearly return record properties from a MapServer service based on a Polygon object.