Page MenuHomePhabricator

Remove altitude from JSON output about globecoordinate values
Open, Needs TriagePublic

Description

There is an altitude field in the array representation for globe coordinate values that is always null. According to @JeroenDeDauw (quoted in T177269#3685706), it was never used; [GlobeCoordinateValue::getArrayValue()](https://github.com/DataValues/Geo/blob/3.0.1/src/Values/GlobeCoordinateValue.php#L193-L195) now always sets it to null, and the JSON datamodel documentation has described it as “deprecated and no longer used” since its first revision on MediaWiki.org. Let’s just get rid of it and save a few bytes in the database, in the dumps and in Special:EntityData responses.

(Of course, this is technically a breaking change that should be properly announced.)

Event Timeline

And yes, we really write this thing to the database:

> var_dump( WikiPage::factory( Title::newFromText( 'Q183' ) )->getContent()->getNativeData()['claims']['P625'][0]['mainsnak']['datavalue']['value'] );                      
array(5) {
  ["latitude"]=>
  float(51)
  ["longitude"]=>
  float(10)
  ["altitude"]=>
  NULL
  ["precision"]=>
  int(1)
  ["globe"]=>
  string(33) "http://www.wikidata.org/entity/Q2"
}