<div dir="ltr">Dear all,<div><br></div><div>This feature is a boost for GeoJSON users who are extending the format and users of those extensions. JSON is a naturally extensible format but the GeoJSON OGR driver stifles development of extensions by passing only the fully standardized GeoJSON items.</div><div><br></div><div>Let's say I want to use ogr2ogr to spatially filter some GeoJSON coming from the OSM Overpass API [1] or the Mapbox Geocoding API [2]. Here's what the response of the latter looks like, abbreviated:</div><div><br></div><div><div>$ curl <a href="https://api.mapbox.com/v4/geocode/mapbox.places/1600+pennsylvania+ave+nw.json?access_token=$MAPBOX_ACCESS_TOKEN">https://api.mapbox.com/v4/geocode/mapbox.places/1600+pennsylvania+ave+nw.json?access_token=$MAPBOX_ACCESS_TOKEN</a> | python -mjson.tool</div><div>{</div><div> "attribution": "NOTICE: \u00a9 2015 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service (<a href="https://www.mapbox.com/about/maps/">https://www.mapbox.com/about/maps/</a>). This response and the information it contains may not be retained.",</div><div> "features": [</div><div> {</div><div> "address": "1600",</div><div> "bbox": [</div><div> -77.05781199999998,</div><div> 38.89252299999999,</div><div> -77.01844799999999,</div><div> 38.905058999999994</div><div> ],</div><div> "center": [</div><div> -77.034389,</div><div> 38.897693</div><div> ],</div><div> "context": [</div><div> {</div><div> "id": "place.57972",</div><div> "text": "Washington"</div><div> },</div><div> {</div><div> "id": "postcode.858369517",</div><div> "text": "20004"</div><div> },</div><div> {</div><div> "id": "region.1190806886",</div><div> "text": "District of Columbia"</div><div> },</div><div> {</div><div> "id": "country.4150104525",</div><div> "text": "United States"</div><div> }</div><div> ],</div><div> "geometry": {</div><div> "coordinates": [</div><div> -77.034389,</div><div> 38.897693</div><div> ],</div><div> "type": "Point"</div><div> },</div><div> "id": "address.39053333360279",</div><div> "place_name": "1600 Pennsylvania Ave NW, Washington, 20004, District of Columbia, United States",</div><div> "properties": {},</div><div> "relevance": 0.99,</div><div> "text": "Pennsylvania Ave NW",</div><div> "type": "Feature"</div><div> },</div><div> ...</div><div> ],<br></div><div> "query": [</div><div> "1600",</div><div> "pennsylvania",</div><div> "ave",</div><div> "nw"</div><div> ],</div><div> "type": "FeatureCollection"</div><div>}</div></div><div><br></div><div>The Features and FeatureCollection have extension items expressing rights, the original query, and more.</div><div><br></div><div>When I pipe this through ogr2ogr to spatially filter, here are the results:</div><div><br></div><div><div>$ curl <a href="https://api.mapbox.com/v4/geocode/mapbox.places/1600+pennsylvania+ave+nw.json?access_token=$MAPBOX_ACCESS_TOKEN">https://api.mapbox.com/v4/geocode/mapbox.places/1600+pennsylvania+ave+nw.json?access_token=$MAPBOX_ACCESS_TOKEN</a> | ogr2ogr -clipsrc -100 30 -70 60 -f GeoJSON /vsistdout/ /vsistdin/</div><div>{</div><div>"type": "FeatureCollection",</div><div>"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },</div><div>"features": [</div><div>{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ -77.034389, 38.897693 ] } },</div><div>{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ -76.634388, 39.30307 ] } },</div><div>{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ -80.272062, 40.687045 ] } },</div><div>{ "type": "Feature", "properties": { }, "geometry": { "type": "Point", "coordinates": [ -95.54508, 34.841595 ] } }</div><div>]</div><div>}</div></div><div><br></div><div>The extensions are lost. This means that ogr2ogr can't be used in pipelines that process extended GeoJSON. </div><div><br></div><div>If you want your GeoJSON to pass through OGR in high fidelity, you have to put everything in the Feature.properties object no matter whether that's the best place for it or not. In practice, the Feature.properties object becomes a grey goo of feature attributes, styling properties, and you name it. </div><div><br></div><div>The implementation of RFC 60 would pass through GeoJSON extensions in full hi-fi. OGR will no longer be an impediment to extension developers.</div><div><br></div><div>[1] <a href="http://wiki.openstreetmap.org/wiki/Overpass_turbo/GeoJSON">http://wiki.openstreetmap.org/wiki/Overpass_turbo/GeoJSON</a><br></div><div>[2] <a href="https://github.com/mapbox/carmen/blob/master/carmen-geojson.md">https://github.com/mapbox/carmen/blob/master/carmen-geojson.md</a></div><div><br></div><div>Yours,</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 23, 2015 at 9:29 AM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
This is a call for discussion on "RFC 60: Improved round-tripping in OGR".<br>
<br>
<a href="https://trac.osgeo.org/gdal/wiki/rfc60_improved_roundtripping_in_ogr" rel="noreferrer" target="_blank">https://trac.osgeo.org/gdal/wiki/rfc60_improved_roundtripping_in_ogr</a><br>
<br>
This RFC defines how to improve better round-tripping in conversion of vector<br>
formats, in particular for GeoJSON extensions.<br>
<br>
Best regards,<br>
<br>
Even<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Sean Gillies</div></div>
</div>