Page MenuHomePhabricator

Misleading markup placements when querying items located around the 180th meridian
Open, Needs TriagePublic

Description

When running:

#defaultView:Map
SELECT ?item ?itemLabel ?district ?districtLabel ?coords ?FindaGrave WHERE {
  ?item wdt:P31 wd:Q39614.
  ?item wdt:P17 wd:Q664 .
  ?item wdt:P131 ?district.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" .
                         ?item rdfs:label ?itemLabel . 
                         ?district rdfs:label ?districtLabel .}
  optional {?item wdt:P625 ?coords.}
  optional {?item wdt:P2025 ?FindaGrave.}
  filter(!strstarts(?itemLabel,"Burial"))
  filter(!strstarts(?itemLabel,"Midden"))
  filter (?item NOT IN (wd:Q79309412, wd:Q79309112, wd:Q79309436, wd:Q79311062, wd:Q23073922))
} order by ?districtLabel ?itemLabel

Instead of collocating the points close to each others they are displayed on the "same" map:

wdqs_map_issue.png (802×1 px, 304 KB)

Ideal placement should be spread around the 180th meridian.
Might be related: https://stackoverflow.com/questions/38820724/how-to-display-leaflet-markers-near-the-180-meridian

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Any possibility of giving this issue some love? New Zealand gets a very raw deal from WDQS. https://w.wiki/5meV

Screenshot 2022-10-03 at 12.27.16.png (1×2 px, 1 MB)

You can work around it in queries by manually adjusting the coordinates to use 0 to 360°. I created an example query years ago (it was actually the very first example query I added!) but it's since been deemed too advanced and moved to https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/advanced#Locations_in_Fiji where people are less likely to find it. Here's the same strategy applied to that New Zealand query: https://w.wiki/C6bB

One fairly simple option would be to add a separate view (e.g. "PacificMap") that is centred on 180° instead of 0°, and uses 0 to 360° when passing the coordinates to Leaflet (ideally still showing -180 to +180° in the tooltip, unlike my example query). Then people could choose which one works best for their query. I tried that years ago by copying the existing Map view and making a few modifications to it and it seemed to work fine. The harder part is doing it without duplicating most of the code.