Page MenuHomePhabricator

Geoline/geoshape does not work with relations other than multipolygon/route/boundary
Open, LowestPublic

Assigned To
None
Authored By
Pnorman
Jan 26 2017, 11:26 PM
Referenced Files
None
Tokens
"Pterodactyl" token, awarded by Bouzinac."Love" token, awarded by Trockennasenaffe."Like" token, awarded by Hannes_Rost_MW."Heartbreak" token, awarded by Rehman."Like" token, awarded by kerberizer."Like" token, awarded by AntiCompositeNumber."Like" token, awarded by Kozuch."Heartbreak" token, awarded by Tagishsimon."Like" token, awarded by Liuxinyu970226."Like" token, awarded by WikedKentaur."Like" token, awarded by Samwilson.

Description

2021 update: Wikimedia has switched from osm2pgsql to imposm3, support for more relation types can be configured, now type=waterway is supported in addition to previous three types. It should be further reviewed which other relation types can be and should be supported.


T155924: Kartographer's maplink/mapframe ExternalData should render super-relations, T154599: Geoline service not retrieving OSM waterway despite the Wikidata ID, and T155923: Kartographer maplink/mapframe ExternalData should render all geolines and/or geoshapes in an OSM relation regardless of continuity or whatever it is (it's not working properly, basically) are all aspects of how to handle relations other than type=multipolygon, type=route, and type=boundary with way members. Rather than trying to figure out exactly which issue to comment on, I'm merging them all in here.

I don't know if the wikidata tagging in OSM in those issues is correct, but the basic issue is creating a geometry from an arbitrary relation. In the issues referenced, they were waterway relations, boundary relations containing relations, and public transport route masters.

multipolgon, route, and boundary relations have well-established ways of creating geometries from them and are handled by osm2pgsql. Some of the relation types above like waterway relations could be handled by osm2pgsql but are not with the default data transformation. Others, like public_transport and relations of relations cannot be handled by osm2pgsql, and may not even have a sensible representation as a single geometry with tags.

This means if we decide we want to handle arbitrary relations, we would need to deploy another database specific for geoline/geoshape and abandon the possibility of returning OSM tags for some objects. We could then build a GeometryCollection for all relations, which could be used to draw something on a map, but not always a good interpretation. For example an area with a hole drawn as a MP when interpreted this way is a closed line inside a closed line.

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
debt triaged this task as Medium priority.Sep 12 2017, 7:13 PM

WIWOSM seems to show waterways like this (r3582427). In what way is the mechanism behind it different? Could that be of some use here?

This will be addressed in the cleartables-based style work. All relations will be handled, subject to inherent osm2pgsql limitations. boundary and multipolygon relations are turned into polygons, and all others are turned into linestrings

This would require a database schema change, which we wouldn't deploy, so this is declined due to resource constraints.

This would require a database schema change, which we wouldn't deploy, so this is declined due to resource constraints.

To be clear, you mean that cleartables mentioned above wouldn't be deployed? If so, then couldn't we still look for some other solution? (I still wonder what solution WIWOSM uses.) Waterway relations with wikidata tag are considerably more common (currently 8692 uses) than other special type relations, so it would be nice to see at least that supported, at least in long-term.

To be clear, you mean that cleartables mentioned above wouldn't be deployed?

Yes, management has decided not to deploy that work.

If so, then couldn't we still look for some other solution?

The default database osm2pgsql database schema does not do anything with relations other than boundary or multipolygon. Because we can't deploy a switch from that for the reason above, we can't add the feature requested here.

Evad37 lowered the priority of this task from Medium to Lowest.

This still seems like a valid low/lowest priority bug to me, even if it isn't going to be fixed in the near future due to the current management's decision (i.e. it's more of a "not now", rather than "never ever ever", isn't it?)

The default database osm2pgsql database schema does not do anything with relations other than boundary or multipolygon.

How are the type=route relations handled then? Is there any chance of doing something similar for just for the geoline service for relations that are only made up of lines (e.g. streets which aren't part of a numbered route)?

I find a mail conversation about similar issue in WIWOSM and code (introduced soon after this conversation) that does something with relations that osm2pgsql misses. I've little understanding of this, but can you do something similar here?

+1 for recognising relation:type=waterway

I have a ton of these ready to deploy. It's a clear, consistent and common use case, and its something that doesn't show well on maps without this kind of highlighting.

This should probably be done for highways, too.

Perhaps this might be one of the task that will be focused on during this year's WM Hackathon, @Vojtech.dostal ?
This feature was also requested on cs.wiki in the past, as I can remember.

Perhaps this might be one of the task that will be focused on during this year's WM Hackathon, @Vojtech.dostal ?
This feature was also requested on cs.wiki in the past, as I can remember.

That would be excellent! :)

@Pigsonthewing: That's because you replied "alas no". (I'd simply like to avoid adding tasks that nobody plans / has committed to work on.) Feel free to correct me please, if I misunderstood!

Would be also nice to have support for type=tunnel .

Would be nice to have support for type=street. Some people have been modifying traditional type=route relations to this, e.g. change set 138282510, which are breaking all relevant page maps on Wikipedia.