I'm wanting to know about the best practices and the most practical approaches to relation hierarchies. And importantly if the ideal approach is different from the practical approach.

Specifically, I've recently added a relation for the Haida Gwaii island group (edit). It is a major island group and had not been labelled correctly. As many of the islands were already mapped as multipolygons, I added these mulitpolygons to the relation. Now when I look at the relation it only shows the islands mapped as a single way.

I'm not sure if this is a problem. Perhaps it's suboptimal, but at present the best solution.

My main goal in mapping this group of islands was to have it mapped in a meaningful way in the database, but it'd be nice if it would display in a meaningful way when searched for, and if a label was rendered.

asked 26 Jul '16, 20:44

keithonearth's gravatar image

keithonearth
2.5k436187
accept rate: 17%


Relations of type=multipolygon don't accept other relations as members, but only ways (closed or not), with roles outer and inner. Multipolygon relations don't accept nodes either. So including multipolygon relations as members of the Haida Gwaii archipelago is the reason for your problem.

There is actually an alternave to the type=multipolygon, that is the type=cluster, that would accept as members a) single ways (for simple islands), 2) multipolygon relations for complex islands, like Graham island, and even c) islands mapped as nodes. No roles for any of them. But type=cluster is only a draft!.

To map the whole Haida Gwaii archipelago as type=multipolygon relation, you have to download all the natural=coastline ways of the archipelago (3,843 ways), download the relation and open it, delete all members, then select all those 3,843 ways, add them to the relation as outer and upload.

Procedure with JOSM:

To download all the coastline ways, you better use overpass with JOSM (Shift + Alt + UpArrow):

downloading coastlines with overpass

Next, you download the relation. For that, you first get its id:

relation id

We see that it is 6439518. Now we download the relation with Download object... (Ctrl + Shift + O) (we only download the relation members and not in a separate layer):

download relation

Now, we open the relation, select all its current members and we delete them:

delete all current relation members

Now, we set two filters, natural="coastline" and type:node as follows:

filters

And select all coastline ways:

select all coastline ways

You add them to the Haida Gwaii archipelago multipolygon relation, with role outer:

add all coastlines to relation as outer

And now you are ready to upload the modified relation to OSM.

permanent link

answered 04 Aug '16, 00:51

edvac's gravatar image

edvac
5952517
accept rate: 13%

1

Thank you edvac, for your amazingly thorough answer. I've followed your suggestion, and updated the relation for Haida Gwaii. More than just teaching me an efficient way to do this one task your post has taught me lots of good JOSM tricks. (I'd never used the filter before, for example. Thanks!

(05 Aug '16, 03:24) keithonearth

You are welcome :)

(27 Dec '17, 19:48) edvac
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×187
×30
×21
×11
×6

question asked: 26 Jul '16, 20:44

question was seen: 1,854 times

last updated: 27 Dec '17, 19:48

powered by OSQA