Thursday, 10 September 2015

geojson - VSI File API support in ogr2ogr


It seems that support for streaming input is wishy-washy in ogr2ogr. For example, why can I do this:


curl "http://data.usgin.org/arizona/wfs?service=WFS&version=1.1.0&

request=GetFeature&typeName=azgs:activefaults&maxFeatures=10" |
ogr2ogr -f "KML" /vsistdout/ /vsistdin/

... but I can't do this:


curl "http://data.usgin.org/arizona/wfs?service=WFS&version=1.1.0&
request=GetFeature&typeName=azgs:activefaults&maxFeatures=10&
outputformat=application/json" | ogr2ogr -f "KML" /vsistdout/ /vsistdin/

The first request uses the "WFS" driver for the source layer, and the second request uses the "GeoJSON" driver for the source layer. The first one works fine, but the second gives me:


ERROR 1: GeoJSON parsing error: unexpected end of data (at offset 6000)

ERROR 4: Failed to read GeoJSON data
FAILURE:
Unable to open datasource `/vsistdin/' with the following drivers.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...