Page MenuHomePhabricator

Geoline referencing individual way(s) with a QID renders empty map
Open, Needs TriagePublicBUG REPORT

Description

Problem
The following queries should return OSM object(s), but an empty object is returned instead:

The problem does not affect geolines referencing OSM relations with a QID, e.g. https://maps.wikimedia.org/geoline?getgeojson=1&ids=Q2087925 (wiki example; OSM relation/14293630), nor does it affect individual OSM ways if they are closed rings and are queried via geoshape, e.g. https://maps.wikimedia.org/geoshape?getgeojson=1&ids=Q12365026 (wiki example; the same objects that are not returned via geoline above).

Reasons
Previously geolines were queried from a database table that included linestrings built from both relations and individual ways. Since 2021, after migrating from osm2pgsql to imposm, geolines are queried from new database table that includes only linestrings built from relations. More specifically, this issue is an outcome and a trade-off of actions taken in T288400 to restore support for relation-based linestrings (database table name and imposm mapping changed).

Potential solutions
There may be a way to amend our imposm mapping so that linstrings built from relations and individual ways were again included in the same database table (see imposm docs).

It appears that polygons (via geoshape) are currently queried from a database table (wikidata_relation_polygon per this config) that includes individual ways (e.g. way>geoshape), in addition to relations (e.g. relation>geoshape).

Is there any chance that imposm supports the same solution also for linestrings? E.g. if table type linestring would be used together with relation_types: [...] then would the resulting table include both individual ways and ways from listed types of relations?

If the above idea wouldn't work then could the approach in example https://github.com/omniscale/imposm3/blob/master/test/single_table_mapping.json be used to combine the mappings of current planet_osm_line and wikidata_relation_members into a mapping of a single table, so that this single table could be used for geoline queries?

An idea to simply query from multiple tables was also considered earlier but this may not be suitable per T288400#8614899.

Additional information
Related de.wikipedia.org discussion and example

As a workaround, some users have started to create single-member relations in OSM so that the data would show up in Wikipedia, but this shouldn't be necessary, and in some circumstances it may be considered as a discouraged practice in OSM (i.e. tagging for the renderer – see OSM wiki).

(As of September 2023 maps.wikimedia.org API links in this report return HTTP 403 due to T333318.)

Event Timeline

There are currently 27 individual ways tagged as wikidata=Q1796552 (overpass query). Individually tagged ways, as opposed to relation members, got lost via geoline last year, see T288400.

Thanks, @Pikne! Do you happen to know: If a relation was created and tagged with Q1796552, would that QID need to be removed from all the individual ways?

If a relation was created and tagged with Q1796552, would that QID need to be removed from all the individual ways?

I suppose it'd be cleaner not to duplicate these links for a relation and its members. Though, I don't know if any OSM community guideline explicitly requires this.

Anyway, it should work without creating a relation, too. It'd be nice if WMDE can weigh in and help fix this.

JStrodt_WMDE renamed this task from Geoline via QID renders empty map to Geoline referencing different ways with the same QID renders empty map.Jul 13 2022, 2:53 PM
From task description:

Let Kartographer show multiple objects that have the same QID.

As far as I can see it doesn't matter if there are multiple ways or a single way. The issue is just that individual ways with wikidata tag can no longer be retrieved via geoline service.

For example, currently way/807529110 and way/839486646 have the same QID Q12365026, and neither is returned via geoline service:
https://maps.wikimedia.org/geoline?getgeojson=1&ids=Q12365026
However, as these are closed ways (polygons) then both can be still retrieved via geoshape service:
https://maps.wikimedia.org/geoshape?getgeojson=1&ids=Q12365026

Pikne renamed this task from Geoline referencing different ways with the same QID renders empty map to Geoline referencing individual way(s) with a QID renders empty map.Jul 31 2022, 8:13 AM
Pikne updated the task description. (Show Details)