maptastik
2/11/2019 - 4:59 PM

Manipulate piped inputs with ogr2ogr

# An example of a data pipeline that gets GeoJSON from Raleigh Open Data, pipes it to ogr2ogr where it is queried, reprojected, and exported to a Shapefile
curl https://opendata.arcgis.com/datasets/777cf0ce6d0846688ab1f77534e72510_1.geojson | ogr2ogr -f geojson -nln INPUT /vsistdout/ /vsistdin/ | ogr2ogr -f "ESRI Shapefile" ral_etj.shp /vsistdin/ -dialect sqlite -sql "SELECT * FROM INPUT WHERE JURISDICTION='RALEIGH'" -s_srs EPSG:4326 -t_srs EPSG:2264