OpenStreetMap logo OpenStreetMap

2010-02-05

Posted by jsmart09 on 6 February 2010 in English.

Today I learned a bit about multipolygon-type relations in the OSM data model. My understanding is that a multipolyon is a relation object, and it contains one or more other objects. E.g. it could contain a lake and a couple of islands. I have skimmed through the [[Relation:multipolygon]] page.

I have looked at Sam Vekeman's rules files for HD_1480009_2_Waterbody. There are actually 3 versions of the file but they all seem pretty well the same. Essentially the rules files filter on geometry, attribute and value of the shapefile and map to an attribute and value in the OSM file.

The shp-to-osm.jar is clever because it seems to split edges (ways) up to be a 2000 node maximum which presumably is some limit for OSM datatypes for ways. It also manages to deal with SHP file outer and inner types, and it creates relation:multipolygon objects for areas that have islands.

I found myself reading an ESRI tech description of SHP files: http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf, briefly, just to get a better feel for how the outer and inner rings are done.

I ran the shp-to-osm jar on the HD_1480009_2_Waterbody SHP file. I get an .osm file out. I loaded that into Global Mapper 10 and it loads but it does not seem to know about the relations. Consequently picking on an edge just tells me attributes of that edge (and actually there are no attributes since shp-to-osm has put all the attributes on the relation).

JOSM loads the .osm and picking on an area object edge shows me that there is a relation:multipolygon object, and lets me see the members.

JOSM renders e.g. lake names using the name:en tag (if I have my preferences set to use English or default, which for me is English). Some of the waterbodies in 021G15 have names, while some waterbodies have multiple lakes and rivers massed into a single object, with no name. A cleanup phase could see me(?) go an close off lakes, give them names and remove the point toponymy names (see 2010-02-04 diary entry).

Looked at McGibbons Island (for example) in the St John River, where we have an inner ring, i.e. an island but there is another smallish water area that overlaps the island. These are sandbars (I can see from Toporama) but ... why is the area tagged as water? It's a 1480272 = waterbody in the SHP file. There must be some kind of product spec rules that dictate this in Canvec??

Enough for today. Friday night, time for a beer ... tomorrow's another day.

Email icon Bluesky Icon Facebook Icon LinkedIn Icon Mastodon Icon Telegram Icon X Icon

Discussion

Log in to leave a comment