Page MenuHomePhabricator

Force externalData to always be top level element
Closed, InvalidPublic

Description

In order to be able to split geojson into multiple leaflet layers, so that we can give links to data sources, we need to do a minor restructuring of the geojson parsing. The simplest way would be to force geojson to always be an array:

[
  { "type": "feature", ... },
  { "type": "externalData", ... },
]

should not be converted to

{
  { "type": "featureCollection", "features": [
    { "type": "feature", ... },
    { "type": "externalData", ... },
  ]
}

Instead, we should force all geojson to be an array of elements, and only allow the top level element to be an "externalData". This way, each element can be made into its own leaflet layer, and we could provide layer-by-layer contribution links, or links to wikidata query, etc.

Details

Related Gerrit Patches:
mediawiki/extensions/Kartographer : masterAdd test that verifies ExternalData can be only top-level

Event Timeline

Yurik created this task.Sep 16 2016, 7:13 AM
Restricted Application added a project: Discovery. · View Herald TranscriptSep 16 2016, 7:13 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 312335 had a related patch set uploaded (by MaxSem):
Add test that verifies ExternalData can be only top-level

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

MaxSem closed this task as Invalid.Sep 22 2016, 9:00 PM

It's already the case, as the test above verifies.

Change 312335 merged by jenkins-bot:
Add test that verifies ExternalData can be only top-level

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