This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Extract two countries in one pass of osmosis

1

I have planet.osm.pbf, a poly file for the USA, and a poly file for Canada.

Is it possible to get both countries into one output file with one pass of osmosis?

Or can the poly files be merged? If so, what d I have to look out for?

Regards, Jim

asked 09 Jul '12, 23:16

obrienj's gravatar image

obrienj
16333
accept rate: 0%


One Answer:

1

The easiest way of merging the poly files is to convert them to .osm format using poly2osm.pl from http://svn.openstreetmap.org/applications/utils/osm-extract/polygons, then combine them in JOSM, and convert them back with osm2poly.pl. However, if you are not too picky about the US-Mexico boundary, you could also use JOSM to quickly draw a polygon around the US and Canada by hand, save that, and convert to .poly.

Regarding your Osmosis question, yes it is possible, and examples for that are on the Wiki.

answered 10 Jul '12, 07:42

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Source code available on GitHub .