Official OpenRefine extension that adds geographic functions to OpenRefine for coordinate conversion and distance calculations.
Compatibility: OpenRefine 3.8+ Implements: OpenRefine Issue #6570
Converts decimal degrees to degrees, minutes, seconds format.
Parameters:
decimal
(number): Decimal degrees coordinatecoordType
(string, optional): 'lat', 'lng', or 'lon' for proper directional indicators
Returns: String in DMS format (e.g., "40° 42' 46.08" N")
Examples:
decToGMS(40.7128) // "40° 42' 46.08\""
decToGMS(40.7128, "lat") // "40° 42' 46.08\" N"
decToGMS(-74.0060, "lng") // "74° 0' 21.60\" W"
decToGMS(-33.8688, "lat") // "33° 52' 7.68\" S"
Calculates the great circle distance between two coordinate pairs using the Haversine formula.
Parameters:
lat1
(number): First point latitude (-90 to 90)lng1
(number): First point longitude (-180 to 180)lat2
(number): Second point latitude (-90 to 90)lng2
(number): Second point longitude (-180 to 180)unit
(string, optional): 'm' (meters, default), 'km' (kilometers), or 'mi' (miles)
Returns: Number representing distance in specified unit
Examples:
geoDistance(40.7128, -74.0060, 34.0522, -118.2437) // Distance in meters
geoDistance(40.7128, -74.0060, 34.0522, -118.2437, "km") // Distance in kilometers
geoDistance(40.7128, -74.0060, 34.0522, -118.2437, "mi") // Distance in miles
This extension is built as part of the OpenRefine build process. The functions are automatically registered when OpenRefine starts.
- Uses the Haversine formula for accurate great circle distance calculations
- Validates coordinate ranges (latitude: -90 to 90, longitude: -180 to 180)
- Handles edge cases like poles and international date line
- Comprehensive error handling with descriptive error messages
For bug reports or feature requests, please use the main OpenRefine issue tracker at https://github.com/OpenRefine/OpenRefine/issues.
This extension is licensed under the same BSD license as OpenRefine.