[gdal-dev] Piping ogr2ogr (SHP format) /vsistdout/ to unix command

umbertofilippo umbertofilippo at tiscali.it
Mon Dec 17 15:00:30 PST 2018


I hope my poor knowledge of informatics terminology won't prevent me to
explain properly, but I try to make my best.
I am trying to use ogr2ogr to convert the GML response from a WFS GetFeature
request to a zipped Shapefile.
I am able to convert the GML to Shapefile, but what I'd like to do now is to
use a command that could also zip that Shapefile (my final aim woud be to
mak this downloadable from a web app).
So I came across the  GDAL Virtual File Systems docs
<https://www.gdal.org/gdal_virtual_file_systems.html>   and saw /vsistdin/
and /vsistdout/. I thought to use these to pipe the shapefile output from
ogr2ogr to the zip command (I am on Linux).
This is what probably my best try:

ogr2ogr -f "ESRI Shapefile" /vsistdout/
WFS:"https://www.wondermap.it/cgi-bin/qgis_mapserv.fcgi?&map=/home/ubuntu/qgis/projects/Demo_sci_WMS/demo_sci.qgs&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&typename=domini_sciabili&bbox=544138,5098446,564138,5108446"
| zip > test.zip

And the error I get:
adding: -ERROR 1: Failed to create directory /vsistdout/ for shapefile
datastore.
ERROR 1: ESRI Shapefile driver failed to create /vsistdout/
 (stored 0%)

Is it possible to do that?




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list