[gdal-dev] Esri JSON Curves

Jim Klassen klassen.js at gmail.com
Mon Jun 25 13:45:55 PDT 2018



On 06/22/2018 02:51 PM, Even Rouault wrote:
> On vendredi 22 juin 2018 14:38:15 CEST James Klassen wrote:
>> I finally got around to doing a rough implementation of parsing ESRIJSON
>> with curved geometries.  The code is very rough yet, but works enough to
>> import a polygon layer from an ESRI FeatureService into PostGIS with the
>> curves intact.  Code is available at [1].
>>
>> Main issues:
>>
>> I don't know how to detect if there will be curves in the source file
>> without first parsing the whole file, so currently I just assume a curved
>> geometry type.  This might be a candidate for an open option.
> The ESRI Json reader ingests everything in memory and builds the JSon tree 
> structure, so doing an initial pass by default shouldn't be a big deal.

This would still be an issue with paging.  Most of the actual datasets
of interest (to me) involve multiple HTTP requests to fetch many pages
of JSON data (usually 1000 - 10000 features at a time depending on
server setup).  The curves may easily not be on the first page and
re-running the whole request is expensive.

>> My focus has been on polygon layers (because that's the dataset I need to
>> read).  I doubt it works outside of polygon layers at the moment.
>>
>> I had to enable the "Curve Geometries" capability in the top level GeoJSON
>> driver (which may break some things for the GeoJSON/TopoJSON drivers).
> If my memories are right, you only need to set it for write support. So 
> shouldn't be needed there.
>

All I know is that without it set, the curved geometries were linearized
somewhere in OGR before they were passed to the PostGIS driver.



More information about the gdal-dev mailing list