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.

Event Timeline

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

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