montagdude wrote in Sun Feb 09, 2020 5:02 am:I hope you don't mind me asking, but I'm trying to figure out how to convert OSM landuse data to FlightGear format with TerraGear and am coming up empty. First, I downloaded shape files for the region of interest using one of the services listed in the openstreetmap wiki (specifically, the BBBike extract service):.
Just saw this post and figured I'd post the way I have been doing it and that is
by extracting a single land class for a given area from the OSM data and then
converting it to a shape file. The tools I used were osmium and ogr2ogr:
# Extract land-class
osmium tags-filter UK-Ireland.pbf w/amenity=grave_yard -o amenity.grave_yard.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON amenity.grave_yard.shp amenity.grave_yard.pbf
osmium tags-filter UK-Ireland.pbf w/landcover=grass -o landcover.grass.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landcover.grass.shp landcover.grass.pbf
osmium tags-filter UK-Ireland.pbf w/landuse=grass -o landuse.grass.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.grass.shp landuse.grass.pbf
osmium tags-filter UK-Ireland.pbf w/natural=grassland -o natural.grassland.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.grassland.shp natural.grassland.pbf
osmium tags-filter UK-Ireland.pbf w/landcover=trees -o landcover.trees.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landcover.trees.shp landcover.trees.pbf
osmium tags-filter UK-Ireland.pbf w/landuse=forest -o landuse.forest.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.forest.shp landuse.forest.pbf
osmium tags-filter UK-Ireland.pbf w/landuse=wood -o landuse.wood.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.wood.shp landuse.wood.pbf
osmium tags-filter UK-Ireland.pbf w/natural=heath -o natural.heath.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.heath.shp natural.heath.pbf
osmium tags-filter UK-Ireland.pbf w/natural=wood -o natural.wood.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.wood.shp natural.wood.pbf
osmium tags-filter UK-Ireland.pbf w/wetland=bog -o wetland.bog.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON wetland.bog.shp wetland.bog.pbf
osmium tags-filter UK-Ireland.pbf w/woodland=* -o woodland.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON woodland.shp woodland.pbf
osmium tags-filter UK-Ireland.pbf w/landuse=landfill -o landuse.landfill.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.landfill.shp landuse.landfill.pbf
osmium tags-filter UK-Ireland.pbf w/leisure=golf_course -o leisure.golf_course.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON leisure.golf_course.shp leisure.golf_course.pbf
osmium tags-filter UK-Ireland.pbf w/crop=* -o crop.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON crop.shp crop.pbf
osmium tags-filter UK-Ireland.pbf w/landuse=orchard -o landuse.orchard.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.orchard.shp landuse.orchard.pbf
osmium tags-filter UK-Ireland.pbf w/landuse=reservoir -o landuse.reservoir.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.reservoir.shp landuse.reservoir.pbf
osmium tags-filter UK-Ireland.pbf w/natural=water -o natural.water.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.water.shp natural.water.pbf
osmium tags-filter UK-Ireland.pbf w/waterway=* -o waterway.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON waterway.shp waterway.pbf
osmium tags-filter UK-Ireland.pbf w/island=* -o island.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON island.shp island.pbf
osmium tags-filter UK-Ireland.pbf w/natural=coastline -o natural.coastline.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.coastline.shp natural.coastline.pbf
osmium tags-filter UK-Ireland.pbf w/natural=marsh -o natural.marsh.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.marsh.shp natural.marsh.pbf
osmium tags-filter UK-Ireland.pbf w/natural=wetland -o natural.wetland.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.wetland.shp natural.wetland.pbf
osmium tags-filter UK-Ireland.pbf w/wetland=fen -o wetland.fen.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON wetland.fen.shp wetland.fen.pbf
osmium tags-filter UK-Ireland.pbf w/wetland=marsh -o wetland.marsh.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON wetland.marsh.shp wetland.marsh.pbf
osmium tags-filter UK-Ireland.pbf w/landuse=meadow -o landuse.meadow.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.meadow.shp landuse.meadow.pbf
osmium tags-filter UK-Ireland.pbf w/landuse=pasture -o landuse.pasture.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.pasture.shp landuse.pasture.pbf
osmium tags-filter UK-Ireland.pbf w/meadow=pasture -o meadow.pasture.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON meadow.pasture.shp meadow.pasture.pbf
osmium tags-filter UK-Ireland.pbf w/landuse=quarry -o landuse.quarry.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landuse.quarry.shp landuse.quarry.pbf
osmium tags-filter UK-Ireland.pbf w/landcover=gravel -o landcover.gravel.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON landcover.gravel.shp landcover.gravel.pbf
osmium tags-filter UK-Ireland.pbf w/natural=bare_rock -o natural.bare_rock.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.bare_rock.shp natural.bare_rock.pbf
osmium tags-filter UK-Ireland.pbf w/natural=cliff -o natural.cliff.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.cliff.shp natural.cliff.pbf
osmium tags-filter UK-Ireland.pbf w/natural=rock -o natural.rock.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.rock.shp natural.rock.pbf
osmium tags-filter UK-Ireland.pbf w/natural=stone -o natural.stone.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.stone.shp natural.stone.pbf
osmium tags-filter UK-Ireland.pbf w/natural=beach -o natural.beach.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.beach.shp natural.beach.pbf
osmium tags-filter UK-Ireland.pbf w/natural=dune -o natural.dune.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.dune.shp natural.dune.pbf
osmium tags-filter UK-Ireland.pbf w/natural=sand -o natural.sand.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.sand.shp natural.sand.pbf
osmium tags-filter UK-Ireland.pbf w/natural=scrub -o natural.scrub.pbf
ogr2ogr -skipfailures -f "ESRI Shapefile" -lco SHPT=POLYGON natural.scrub.shp natural.scrub.pbf