VuFindGeo
in package
XSLT importer support methods for geographic indexing.
Tags
Table of Contents
- $logMethod : callable
- Method for logging errors (overridable for testing purposes)
- getAllCoordinatesFromCoverage() : string
- Format valid coordinates for indexing into Solr; return empty string if coordinates are invalid.
- getDisplayCoordinatesFromCoverage() : string
- Format valid coordinates for user display; return empty string if coordinates are invalid.
- getLabelFromCoverage() : string
- Extract a label from a dc:coverage string.
- logError() : void
- Log an error message
- parseCoverage() : array<string|int, mixed>
- Parse a dc:coverage string into a key/value array.
- validateCoordinateDistance() : bool
- Check decimal degree coordinates to make sure they are not too close.
- validateCoverageCoordinates() : bool
- Return true if the coordinate set is valid for inclusion in VuFind's index.
- validateEastWest() : bool
- Check decimal degree coordinates to make sure that east is not less than west.
- validateExtent() : bool
- Check decimal degree coordinates to make sure they are within map extent.
- validateLines() : bool
- Check decimal degree coordinates to make sure they do not form a line at the poles.
- validateNorthSouth() : bool
- Check decimal degree coordinates to make sure that north is not less than south.
- validateNumericCoordinates() : bool
- Return true if the coordinate set is complete and numeric.
Properties
$logMethod
Method for logging errors (overridable for testing purposes)
public
static callable
$logMethod
= 'error_log'
Methods
getAllCoordinatesFromCoverage()
Format valid coordinates for indexing into Solr; return empty string if coordinates are invalid.
public
static getAllCoordinatesFromCoverage(string $coverage) : string
Parameters
- $coverage : string
-
Raw dc:coverage string.
Return values
string —getDisplayCoordinatesFromCoverage()
Format valid coordinates for user display; return empty string if coordinates are invalid.
public
static getDisplayCoordinatesFromCoverage(string $coverage) : string
Parameters
- $coverage : string
-
Raw dc:coverage string.
Return values
string —getLabelFromCoverage()
Extract a label from a dc:coverage string.
public
static getLabelFromCoverage(string $coverage) : string
Parameters
- $coverage : string
-
Raw dc:coverage string.
Return values
string —logError()
Log an error message
protected
static logError(string $msg) : void
Parameters
- $msg : string
-
Message
Return values
void —parseCoverage()
Parse a dc:coverage string into a key/value array.
protected
static parseCoverage(string $coverage) : array<string|int, mixed>
Parameters
- $coverage : string
-
Raw dc:coverage string.
Return values
array<string|int, mixed> —validateCoordinateDistance()
Check decimal degree coordinates to make sure they are not too close.
protected
static validateCoordinateDistance(array<string|int, mixed> $coords) : bool
Coordinates too close will cause Solr to run out of memory during indexing.
Parameters
- $coords : array<string|int, mixed>
-
Output of parseCoverage() in need of validation
Return values
bool —validateCoverageCoordinates()
Return true if the coordinate set is valid for inclusion in VuFind's index.
protected
static validateCoverageCoordinates(array<string|int, mixed> $coords) : bool
Parameters
- $coords : array<string|int, mixed>
-
Output of parseCoverage() in need of validation
Return values
bool —validateEastWest()
Check decimal degree coordinates to make sure that east is not less than west.
protected
static validateEastWest(array<string|int, mixed> $coords) : bool
Parameters
- $coords : array<string|int, mixed>
-
Output of parseCoverage() in need of validation
Return values
bool —validateExtent()
Check decimal degree coordinates to make sure they are within map extent.
protected
static validateExtent(array<string|int, mixed> $coords) : bool
Parameters
- $coords : array<string|int, mixed>
-
Output of parseCoverage() in need of validation
Return values
bool —validateLines()
Check decimal degree coordinates to make sure they do not form a line at the poles.
protected
static validateLines(array<string|int, mixed> $coords) : bool
Parameters
- $coords : array<string|int, mixed>
-
Output of parseCoverage() in need of validation
Return values
bool —validateNorthSouth()
Check decimal degree coordinates to make sure that north is not less than south.
protected
static validateNorthSouth(array<string|int, mixed> $coords) : bool
Parameters
- $coords : array<string|int, mixed>
-
Output of parseCoverage() in need of validation
Return values
bool —validateNumericCoordinates()
Return true if the coordinate set is complete and numeric.
protected
static validateNumericCoordinates(array<string|int, mixed> $coords) : bool
Parameters
- $coords : array<string|int, mixed>
-
Output of parseCoverage() in need of validation