Select to view content in your preferred language

GeoJSON response size limit?

3493
2
Jump to solution
03-07-2017 01:02 PM
DaveOrlando
Frequent Contributor

Hello,

I'm curious if I'm running into a size limit in the response of a GeoJSON request

I have two published layers, points and polygons.

I can successfully query all the points or specific points in pjson, json and geojson

I can successfully query specific polygons in pjson, json and geojson

I can successfully query all the polygons in pjson and json,

but it fails on geojson for all the polygons (code 400).

funny thing is, I added it to our OpenData portal and was successful getting all the polygons in geojson that way, which is ultimately querying the same data.

I can't figure out what the problem is for geojson on my REST endpoint when querying all the polygons (only 190)

any ideas?...

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
DaveOrlando
Frequent Contributor

found the problem,

it was the curves within the geometry, once simplified into true vertices the geojson response returns fine.

regarding it working via the Open Data site, I can only assume it is running the geometry through its own simplify routine before converting to geojson, just a guess.

View solution in original post

2 Replies
FilipKrál
Frequent Contributor

I am just guessing here but it does not sound like you're hitting limit on the volume of a response, if there even is any.

You could try to adjust the maximum number of records the service should return from a query to something like 10 or less and try your queries again.

Have you tried running Check Geometry and Repair Geometry tools on your polygon feature class in ArcGIS for Desktop?

Also, exporting the data to GeoJSON in ArcMap may reveal where the problem is.

If your polygons are not massive (i.e. if they don't have many vertices), I would try looking at them in GeoJSON also in the Python window like this:

import arcpy
fc = r'c:\path\to\polygons.shp'
with arcpy.da.SearchCursor(fc, "SHAPE@JSON") as sc:
    for row in sc:
        print(row[0].__geo_interface__)‍‍‍‍‍‍‍

See also Converting geometries between GeoJSON, esri JSON, and esri Python , especially the last contribution.

Filip.

DaveOrlando
Frequent Contributor

found the problem,

it was the curves within the geometry, once simplified into true vertices the geojson response returns fine.

regarding it working via the Open Data site, I can only assume it is running the geometry through its own simplify routine before converting to geojson, just a guess.