[GIS] Cleaning up OpenStreetMap data, building polygons and trying to improve appearance

openstreetmappolygon-creation

I'm currently going through my first project with OpenStreetMap data and I'm struggling to see how certain features can be made to look anywhere near as good as in OpenStreetMap.org.

I downloaded a pre-built Shp from Cloudmade for Ontario and many of the big lakes in the south are terrible – a polygon might cover a fraction of a lake's actual area and makes for poor visualisation. I think this is a result of OSM data only containing points and lines, and someone having to build polygons from these lines. Furthermore, I looked at the administrative boundaries lines layer and there were 100,000s of line features for all kinds of administrative entities but apparently no attributes that could help me build a single polygon for the province's full border.

Now, I know that the Cloudmade Shps have been through some post-processing to whittle the many feature types in the .osm XML down to 7 or 8 layers, so perhaps the way they collate administrative boundaries is not perfect for my area. Also, as the Ontario Shps don't cover the US states that also border the big lakes perhaps this explains why the lake polygons were not well formed, but if I have to download the .osm XML for such a large area and process it all myself this causes other issues – it will take a lot of time and many iterations and I don't know if the end result will be worth the effort (e.g. what if the lines that make up a lake's border don't properly meet up, and snapping introduces unwanted artifacts – or maybe none of the lakes are actually 'closed' because they all have rivers connected to them, so building a polygon is just impossible?)

I'm guessing that to make the map in OpenStreetMap.org someone must have processed all the data to build polygons where necessary. Presumably all country / state / province borders were created as polygons and shaded, and either the same was done for all lakes / oceans or the map simply has a blue background and everything else is layered on top? If this polygon data was created for the OpenStreetMap.org map, why can't I access it anywhere? It seems like there should be an additional resource between the raw XML and the state / province-specific Shps that have been processed according a particular rule-set

If anyone has come across similar issues and has any kind of advice I'd really appreciate it!

Best Answer

I've come across this issue as well while working on a lakefront city (Cleveland) in the Great Lakes.

There is polygon data that contains of all large bodies of water in the world (includes the Great Lakes) called 'coastline' at http://wiki.openstreetmap.org/wiki/Coastline#Rendering

They are already available as shapefiles:

http://tile.openstreetmap.org/processed_p.tar.bz2 and http://tile.openstreetmap.org/shoreline_300.tar.bz2

or a mirror:

http://tilemill-data.s3.amazonaws.com/osm/shoreline_300.zip http://tilemill-data.s3.amazonaws.com/osm/processed_p.zip

(one of them, processed_p, if I remember correctly, is for low zoom levels - 1-9, the other has better resolution and should be used for zoom 10+).

In my experience, state/province extracts (though ones I've used were in .OSM) include rivers and any other waterways that reach the any of the great lakes or oceans (as long as they have added to osm, in the first place).