[gdal-dev] ogr2ogr VSI support for JSON input?

Ryan Clark ryan.clark at azgs.az.gov
Tue Jul 23 09:31:08 PDT 2013


I'm curious if the GeoJSON driver does not support the VSI API completely?

This works (stream WFS > GeoJSON):

    curl "http://server.com/wfs?request=GetFeature..." | ogr2ogr -f "GeoJSON" /vsistdout/ /vsistdin/

but this doesn't (stream GeoJSON > KML):

    cat ~/my-geojson.json | ogr2ogr -f "KML" /vsistdout/ /vsistdin/

... that is, I can't seem to stream GeoJSON as an input to ogr2ogr. Is that a known issue or am I doing something wrong? The documentation<http://www.gdal.org/ogr/drv_geojson.html> states that I should be able to do this, but I'm receiving an error:

$ cat my-geojson.json | ogr2ogr -f "KML" /vsistdout/ /vsistdin/
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.
...


I'm working with GDAL 1.10.0.

Thank you!
Ryan



____________________

Ryan Clark
Arizona Geological Survey
ryan.clark at azgs.az.gov<mailto:ryan.clark at azgs.az.gov>
(520) 302-4871
facebook.com/ModernGeologist<https://www.facebook.com/ModernGeologist>
@worbly<https://twitter.com/worbly>









-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130723/ffa0cfb8/attachment.html>


More information about the gdal-dev mailing list