Is there a way to select what to import from planet-latest.osm.bz2 to database?
I want to do something like :
osm2pgsql ... --place='city' --admin_level='2'
My goal is to use only cities and countries im my project ( maybe towns ). I can download many databases with cities and countries shapes from the world, but I think OSM is more complete and if I decide to use other things is just import again.
I just try import all full planet data and then SELECT and INSERT in other database using SQL filters, but its too time-consuming ( and non-professional ).
Thanks.
Answer
You should use osmosis to filter OSM file to another OSM file and then osm2pgsql to import it. You can do it with single command using pipe as following
osmosis --read-pbf planet-latest.osm.bz2 --node-key-value keyValueList="place.city,admin_level.2" --write-xml - |osm2pgsql --append [my customized arguments] -
No comments:
Post a Comment