Page MenuHomePhabricator

Geojson object on -180/180 longitude draws incorrect view
Open, MediumPublic

Description

This geojson was part of the incorrectly generated GeoJSON produced from geoshapes service for Q30 (USA). I don't know if this should be generated differently, or the PostGIS 2.1.4 has this issue, or if geojson->topojson->geojson introduces this bug. The data was originally received from https://maps.wikimedia.org/geoshape?ids=Q30&arg1=0.0001

<mapframe width=500 height=500>
{"type":"FeatureCollection","features":[{"type":"Feature","id":"Q30","properties":{},"geometry":{"type":"MultiPolygon","coordinates":[[[
[179.17191719171916,51.95410615498813],
[179.17191719171916,52.04911690100564],
[179.24392439243928,52.12685296592907],
[179.53195319531955,52.230501052493615],
[179.7839783978398,52.230501052493615],
[-180,52.13549030647611],
[-179.92799279927993,52.06639158209973],
[-179.8919891989199,51.98001817662928],
[-179.92799279927993,51.867732749517664],
[-180,51.78999668459425],
[179.74797479747974,51.70362327912378],
[179.5679567956796,51.68634859802969],
[179.35193519351935,51.74680998185902],
[179.20792079207922,51.84182072787653],
[179.17191719171916,51.95410615498813]
]]]}}]}</mapframe>

Details

Related Gerrit Patches:
mediawiki/extensions/Kartographer : masterFix antimeridian wraparound in leaflet for ext data
mediawiki/extensions/Kartographer : wmf/1.28.0-wmf.18Switch to geojson for geoshapes srv
mediawiki/extensions/Kartographer : masterSwitch to geojson for geoshapes srv

Event Timeline

Yurik created this task.Sep 5 2016, 10:34 PM
Restricted Application added a project: Discovery. · View Herald TranscriptSep 5 2016, 10:34 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Yurik added a comment.EditedSep 5 2016, 10:42 PM

Apparently this is a well known GIS issue, called "crossing the date line", or "antimeridian" . See also https://github.com/Leaflet/Leaflet/pull/1293 - very long Leaflet discussion.

Yurik added a comment.Sep 6 2016, 1:28 AM

I also posted related question on gis.stackexchange.

Change 309408 had a related patch set uploaded (by Yurik):
Fix antimeridian wraparound in leaflet for ext data

https://gerrit.wikimedia.org/r/309408

Change 309478 had a related patch set uploaded (by Yurik):
Switch to geojson for geoshapes srv

https://gerrit.wikimedia.org/r/309478

Pnorman removed a subscriber: Pnorman.Sep 8 2016, 11:04 PM

Change 309481 had a related patch set uploaded (by Yurik):
Switch to geojson for geoshapes srv

https://gerrit.wikimedia.org/r/309481

Change 309478 merged by jenkins-bot:
Switch to geojson for geoshapes srv

https://gerrit.wikimedia.org/r/309478

Change 309481 merged by jenkins-bot:
Switch to geojson for geoshapes srv

https://gerrit.wikimedia.org/r/309481

Mentioned in SAL [2016-09-08T23:41:38Z] <dereckson@tin> Synchronized php-1.28.0-wmf.18/extensions/Kartographer/modules/box/Map.js: Switch to geojson for geoshapes srv (T144777) (duration: 00m 48s)

Even though we fixed the immediate problem, this issue highlights the underlying problem with the GeoJSON->TopoJSON->GeoJSON conversion and the lack of the proper leaflet's support

Yurik moved this task from Unsorted to General on the Maps (Kartographer) board.Sep 9 2016, 2:56 AM

Change 309408 abandoned by Sbisson:
Fix antimeridian wraparound in leaflet for ext data

Reason:
This change doesn't seem to be under active development. Please restore if I'm mistaken.

https://gerrit.wikimedia.org/r/309408

This will need rechecking.

Mholloway triaged this task as Medium priority.Jul 19 2018, 5:07 PM