[gdal-dev] Esri JSON Curves
James Klassen
klassen.js at gmail.com
Fri Jun 22 12:38:15 PDT 2018
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.
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).
Memory management and error handling need to be improved.
I only implemented circular curves ("c"). There are other curve types
supported by the spec, (e.g. Bézier), but I don't have any examples of
these other types in the datasets I have on hand.
[1] https://github.com/klassenjs/gdal/tree/esrijson-curves
On Thu, Oct 19, 2017 at 4:55 PM, James Klassen <klassen.js at gmail.com> wrote:
> On Thu, Oct 19, 2017 at 2:04 PM, Even Rouault <even.rouault at spatialys.com>
> wrote:
>
>> On jeudi 19 octobre 2017 13:38:38 CEST James Klassen wrote:
>> > Has anyone looked at reading curved geometries from an Esri rest service
>> > queried with "returnTrueCurves=true"?
>> >
>> > My end goal is to import the data into PostGIS. We were successful using
>> > ogr2ogr to translate the curved features from a geodatabase download in
>> the
>> > past, but that download is being replaced with a rest service. OGR
>> reads
>> > the rest service correctly without "returnTrueCurves=true", but we would
>> > like to preserve the integrity of the curves in the source data if
>> possible.
>> >
>> > It doesn't look like there is any code in GDAL 2.2 to deal with this
>> > situation. `ogresrijsonreader.cpp:OGRESRIJSONReadPolygon()` looks
>> like it
>> > is only looking for a "rings" member, not "curveRings", etc.
>>
>> This is indeed not supported at the moment.
>> It appears to be documented in
>> http://resources.arcgis.com/en/help/arcgis-rest-api/index.ht
>> ml#//02r3000000n1000000#CURVE
>>
>> The data model is, non suprisingly, super close to what exists in
>> Personnal Geodatabase
>> or FileGeodatabase. Arc/CircularArc could be translated to
>> CIRCULARSTRING/COMPOUNDCURVE/
>> CURVEPOLYGON. Bezier curves would have to be linearized since there's no
>> equivalent in
>> OGC SF / ISO SQL-MM Part 3 standards.
>> So this is "just" a matter of coding it.
>>
>>
> Interesting. So, some new JSON parsing code feeding into similar code to
> what already exists in other drivers to create the right OGR objects. It
> just comes down to time and/or money to actually implement it.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180622/8c49a890/attachment.html>
More information about the gdal-dev
mailing list