[gdal-dev] Make stdin in OGR/GDAL tools cross-platform?

Stefan Keller sfkeller at gmail.com
Thu Mar 13 03:03:05 PDT 2014


In OSM driver [1] there's an example about using stdin in OGR which is
Unix based:

> Reading .osm.bz2 files and/or online files
> .osm.bz2 are not natively recognized, however you can process them (on Unix),
> with the following command :
>
> bzcat my.osm.bz2 | ogr2ogr -f SQLite my.sqlite /vsistdin/
>
> You can convert a .osm or .pbf file without downloading it :
> wget -O - http://www.example.com/some.pbf | ogr2ogr -f SQLite my.sqlite /vsistdin/

Is it possible to do that also under Windows? Like this (untested but
inspired by [2]!)

%wget -O - http://www.example.com/some.pbf | ogr2ogr -f SQLite my.sqlite <1
or
% type singapore.geojson | ogrinfo -al -so  <1

--Stefan

[1] http://www.gdal.org/ogr/drv_osm.html
[2] http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx?mfr=true


More information about the gdal-dev mailing list