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

how to combine .poly files?

1

Hello -

I am trying to combine 2 geofabrik .poly files into one file and do not know the "technique". I have tried pasting the data from the 2nd file to the bottom of the first (above the "end, end" lines) and then added the number "2" between the 2 sets of data. Neither approach worked because I do not understand the file structure, besides that it uses sci notation. I am using phyghtmap to create contours from srtm data.

Thanks, pitney

asked 03 Dec '14, 18:18

pitney's gravatar image

pitney
44557
accept rate: 0%


2 Answers:

3

JOSM might come in handy for this task: as a prerequisite you need to install poly and utilsplugin2 plugins.

  1. Open two intersecting poly files (I tried with France and Germany)
  2. Combine the two of them into a single layer in the layers pane (combine one area with another area)
  3. Select both poly lines
  4. combine overlapping areas (shift-j)
  5. save the result as poly file again.

That's how my result looks like:

alt text

answered 03 Dec '14, 20:38

mmd's gravatar image

mmd
5.7k15388
accept rate: 37%

edited 03 Dec '14, 20:41

mmd -

Thank you, this technique worked.

As a follow up Q, can JOSM also be used to split a .poly file?

Thanks, pitney

(06 Dec '14, 20:00) pitney
1

You can split a polygon in JOSM by selecting 2 nodes (click while pressing ctrl-key) and then pressing alt-x. The result can be saved again as poly file.

(06 Dec '14, 20:08) mmd

0

as a final? update, if you need to add only an isolated area to an existing .poly file (ex. an island, say the Falklands to Argentina!) you can just add the data to the end of the file, before end,end.

answered 08 Dec '14, 16:34

pitney's gravatar image

pitney
44557
accept rate: 0%

Source code available on GitHub .