On 2013-09-03 3:23, nicholas.g.lawrence wrote:
Hello all,

I'm trying to convert the Queensland, Australia OSM roads into a GIS
format (esri shape or mapinfo) using GDAL 1.10

I downloaded a .osm.pbf file for australia from
http://download.geofabrik.de/australia-oceania/australia.html

I'm only really after the geometry that represents roads. So I don't
need the points or polygons.

Does anyone have any suggestions about any arguments I can put into my
GDAL command to restrict translation to only what I consider relevant?

For example, the argument -spat 136 -31 156 should restrict import to a
bounding box that approximately represents Qld.

I would appreciate advice on;
- what geometry layer suits my purposes
- how to specify that in a GDAL argument


Hi,

Below is what I would do. I assume you know
http://gdal.org/ogr/drv_osm.html, for further reading.

$ ogr2ogr roads.shp australia-oceania-latest.osm.pbf \
    -spat 136 -31 156 10 \
    -sql "select * from lines where highway is not null"
    --config OSM_CONFIG_FILE ./osmconf.ini

The above conversion took ~30 seconds and extracted 208109 highway lines.

./osmconf.ini is a local copy of my Macbook's
/opt/local/share/gdal/osmconf.ini where I changed 1 line in section [lines]:

attributes=name,highway,waterway,aerialway,barrier,man_made # default
attributes=name,highway,ref,oneway,maxspeed # customised for highways

BTW: the northern latitude is missing in your spatial bounds, so I added
10 there.

Hope this helps, Hermann



_______________________________________________
talk mailing list
talk@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk

Reply via email to