web / lib/services/import/coordinate-validator / CoordinateValidator
Class: CoordinateValidator
Constructors
Constructor
new CoordinateValidator():
CoordinateValidator
Returns
CoordinateValidator
Methods
validateCoordinates()
validateCoordinates(
lat
,lon
,autoFix
):ValidatedCoordinates
Validate and potentially fix coordinates
Parameters
lat
null
| number
lon
null
| number
autoFix
boolean
= true
Returns
extractFromCombined()
extractFromCombined(
value
,format
):CoordinateExtraction
Extract coordinates from a combined column
Parameters
value
unknown
format
string
Returns
isValidLatitude()
isValidLatitude(
value
):boolean
Validate latitude range
Parameters
value
number
Returns
boolean
isValidLongitude()
isValidLongitude(
value
):boolean
Validate longitude range
Parameters
value
number
Returns
boolean
detectSwappedCoordinates()
detectSwappedCoordinates(
samples
):boolean
Check for common coordinate mistakes in a batch
Parameters
samples
object
[]
Returns
boolean
parseCoordinate()
parseCoordinate(
value
):null
|number
Parse various coordinate formats to decimal degrees
Parameters
value
unknown
Returns
null
| number
calculateConfidence()
calculateConfidence(
lat
,lon
):number
Calculate confidence score based on coordinate characteristics
Parameters
lat
number
lon
number
Returns
number