Wikibase
MediaWiki Wikibase extension
|
Extracts and stashes coordinates from Statement main snaks and adds to ParserOutput for use by the GeoData extension. More...
Public Member Functions | |
__construct (PropertyDataTypeMatcher $propertyDataTypeMatcher, array $preferredPropertiesIds, array $globeUris) | |
processStatement (Statement $statement) | |
Extract globe-coordinate DataValues for storing in ParserOutput for GeoData. More... | |
updateParserOutput (ParserOutput $parserOutput) | |
Update extension data, properties or other data in ParserOutput. More... | |
Private Member Functions | |
findPrimaryCoordinateKey () | |
getCoordinatesGroupCount ( $key) | |
addPrimaryCoordinate (CoordinatesOutput $coordinatesOutput, $primaryCoordKey) | |
addSecondaryCoordinates (CoordinatesOutput $coordinatesOutput, $primaryCoordKey) | |
makeCoordinateKey ( $propertyIdString, $rank) | |
extractMainSnakCoord (Statement $statement) | |
Private Attributes | |
$propertyDataTypeMatcher | |
$preferredPropertiesIds | |
$globeUris | |
$coordinates = [] | |
Extracts and stashes coordinates from Statement main snaks and adds to ParserOutput for use by the GeoData extension.
GeoData populates the geo_tags table, and if using the 'elastic' backend, also adds coordinates to CirrusSearch. GeoData then provides API modules to get coordinates for pages, and to find nearby pages to a requested location.
This class uses the Coord and CoordinatesOutput classes from the GeoData extension.
Wikibase\Repo\ParserOutput\GeoDataDataUpdater::__construct | ( | PropertyDataTypeMatcher | $propertyDataTypeMatcher, |
array | $preferredPropertiesIds, | ||
array | $globeUris | ||
) |
PropertyDataTypeMatcher | $propertyDataTypeMatcher | |
string[] | $preferredPropertiesIds | |
string[] | $globeUris |
RuntimeException |
|
private |
CoordinatesOutput | $coordinatesOutput | |
string | $primaryCoordKey |
|
private |
CoordinatesOutput | $coordinatesOutput | |
string | null | $primaryCoordKey |
|
private |
Statement | $statement |
|
private |
|
private |
string | $key |
|
private |
string | $propertyIdString | |
int | $rank |
Wikibase\Repo\ParserOutput\GeoDataDataUpdater::processStatement | ( | Statement | $statement | ) |
Extract globe-coordinate DataValues for storing in ParserOutput for GeoData.
Statement | $statement |
Implements Wikibase\Repo\ParserOutput\StatementDataUpdater.
Wikibase\Repo\ParserOutput\GeoDataDataUpdater::updateParserOutput | ( | ParserOutput | $parserOutput | ) |
Update extension data, properties or other data in ParserOutput.
These updates are invoked when EntityContent::getParserOutput is called.
ParserOutput | $parserOutput |
Implements Wikibase\Repo\ParserOutput\StatementDataUpdater.
|
private |
|
private |
|
private |
|
private |