[OSM-talk] Generating extracts for countries

Frederik Ramm frederik at remote.org
Fri Jan 9 18:53:06 GMT 2009


> Would anyone here be able to point me in the right direction for
> extracting data per country? I have all the data in a local database,
> and I am trying to figure out what the best approach is.

I'm using Osmosis to extract data from a planet file (using the --bp 
task). It can also extract several files at once, like this:

osmosis --rx planet.osm --tee 2 --bp file=country1.poly --wx 
country1.osm --bp file=country2.poly --wx contry2.osm

If the local database you're talking about is Osmosis-generated then 
simply replace the --rx by the appropriate task to read from the data 
base. If your local database is osm2pgsql-generated then you can have 
PostGIS create extracts but only as partial databases or shapefiles, 
never as true OSM files because osm2pgsql is "lossy".


More information about the talk mailing list