I am trying to export the data in GeoJSON or JSON format from this REST service. I keep getting an error from the request.


I need the geometry and attributes returned.

I am using this page to try and query for all of the data.


I choose the format as JSON and in the Return Fields (Comma Separated): I enter "*"

What else do I need to enter into the QUERY to return this layer?

I entered objectid is not null into the where clause and it returned the cryptic Esri rings format


2 Answers 2


You need to make a request to the ?query endpoint of the layer, and supply a where clause. Specify &f=json to receive the response in JSON.

Note that ArcGIS Server by default only returns the first 1000 records, so you may need to batch your requests using OBJECTID ranges as the where clause until you've retrieved all records, using this syntax:


That is, use where objectid < 999 in the first request, then where objectid >= 1000 and objectid < 1999, etc, until there are no more responses.

See Converting ArcGIS Server JSON to GeoJSON to convert this JSON response to GeoJSON


You can see 'maxRecordCount' in rest service. Then you make a request with 'returnIdsOnly' with your filter where/spatial. On this request there is no limit to the number of object IDs returned in the ID array response so you have full list of oids and then you make n-request (chunk) -> ceil((len(oids) / maxRecordCount )) with group of oids using in request query only 'objectIds'

You can see it in my toolbox for arcgis pro where I use this logic Download service

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.