I would like to know the simplest way to extract coastlines and borders in OSM, so I can include it into a PDF or SVG. Extra points for being able to access the names of those polygons in some way. Since the coastline data was at 350MB in december 2011, I'm guessing the osm data pretty hard to use.
This question is marked "community wiki".
asked 19 Jan '11, 02:14 emj |
I'd suggest using Natural Earth's datasets for these kinds of things. It's already filtered for smaller-resolution usage and it is in public domain. I'm using Natural Earth in my new project called Geosomnia, which will include the world map soon. answered 19 Jan '11, 05:37 Breki 1
If your goal is getting a world political map into a SVG or PDF, then I suggest using Natural Earth, since it's much simpler to get a hold of. Using OSM data is fine, but be prepared to download and process 12 GB of compressed XML data + fixing any missing polylines in order to get proper polygons. So my answer is still Natural Earth. OSM data is much more interesting for other features which other sources don't have, like world-wide road network & similar. This is where it pays off to process such a big dataset.
(19 Jan '11, 12:17)
Breki
2
I'm asking this question because I think it needs to be asked, if OSM is about the data then we should use it.
(19 Jan '11, 12:44)
emj
1
I agree, but if I have a task to do, I usually pick the easiest solution to get it done. I'll use OSM data when it is best suited for the job, and drawing political boundaries on a 1 : 100M scale isn't one of these situations. My experience on how inconsistently boundaries are tagged in various parts of the OSM world tells me you'd have a pretty big task just to clean out things before you could even start preparing such a map. Here's an example of what we're up against: [http://www.mail-archive.com/talk@openstreetmap.org/msg22525.html]
(19 Jan '11, 13:04)
Breki
|
I once had a comparable use case. You might try using osmfilter. The command was like this:
This way you should end up with a file that contains only osm ways and osm relations that make up national boundaries. For coastlines you'd have to run it a second time with a different --keep filter and then merge the outcomesw with osmconvert. Alternatively you could just download the polygon file for national boundaries at Cloudmade... It took me 20 minutes to do something similar with Great Britain on a couple-of-years-old laptop - I'd have thought that if you need to do this more than once or don't want to wait some hours, that another approach would be a better option.
(24 Oct '11, 15:08)
SomeoneElse ♦
|
Instead of downloading everything and then filtering you could also download the data selectively from one of the people that provide a service for this. You could for instance use one of the XAPI-servers or the overpass api. Then you can render this extract with one of the renderers, e.g. Osmarender or Maperitive. Be prepared that the resulting PDF (if vector) and SVG will become very big. For most usecases you might want to simplify the data before converting it (that's why the natural earth datasets might suit better your needs). answered 24 Oct '11, 19:05 dieterdreist |