[gdal-dev] create only line shapefile

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Thu Apr 25 10:13:38 PDT 2013


maning sambale <emmanuel.sambale <at> gmail.com> writes:

> 
> I have this syntax:
> 
> ogr2ogr -f "ESRI Shapefile" test_osm.shp philippines.osm.pbf -lco SHPT=ARC \
> -skipfailures -progress --config OSM_CONFIG_FILE osmconf.ini \
> -select name,highway,oneway,maxspeed,access,lanes \
> -where "highway is not null" -clipsrc ph_province.shp \
> -clipsrcsql "SELECT * FROM ph_province WHERE provname='metro_manila'"
> 
> I basically want to extract just the highways in the metro_manila polygon.
> But I still get 4 shapefiles (point, line, multilinestrings,
> multipolygons, other_relations).
> Except for the line.shp, all the other shapefiles are empty.
> 
> I defined -lco SHPT=ARC.
> 
> How do I just get the lines.shp?

Try with -sql instead of -select and -where

-sql "select name, highway, oneway, maxspeed, access, lanes from lines where
highway is not null"

-Jukka Rahkonen-



More information about the gdal-dev mailing list