GeoSpark

v0.10.0
io.github.Maz2580/geospark Checked 46 minutes ago Published 21 days ago

Verifiable geospatial tools: distances, topology, isochrones, Overture Maps, with sources.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

calculate_distance Geodesic distance

Exact geodesic distance between two places or geometries on the WGS84 ellipsoid. Use for any "how far" question instead of estimating. For NAMED places pass place_a and place_b; the server geocodes them, so never type coordinates for a place yourself. Use point_a/point_b only for coordinates the user gave or another tool returned. For lines and polygons the distance is between their nearest points. Returns metres and kilometres.

ParameterTypeDescription
place_aA place NAME, e.g. 'Adelaide Oval'; geocoded on the server (preferred)
place_bA place NAME, e.g. 'Adelaide Oval'; geocoded on the server (preferred)
point_aA GeoJSON geometry, e.g. {"type": "Point", "coordinates": [lon, lat]}; only for coordinates the user gave or a tool returned
point_bA GeoJSON geometry, e.g. {"type": "Point", "coordinates": [lon, lat]}; only for coordinates the user gave or a tool returned

check_spatial_relationship Topological relationship

Ground-truth topology: does geometry_a <relationship> geometry_b? Use instead of guessing containment, overlap or adjacency. Invalid geometries (for example self-intersecting polygons) are refused with the reason.

ParameterTypeDescription
geometry_a *objectA GeoJSON geometry, e.g. {"type": "Point", "coordinates": [lon, lat]}
geometry_b *objectA GeoJSON geometry, e.g. {"type": "Point", "coordinates": [lon, lat]}
relationship *stringThe relationship to test: does geometry_a <relationship> geometry_b

spatial_operation Geometry operation

Compute a buffer (shape-preserving, metres), geodesic area or length, centroid or convex hull. Returns the resulting geometry as GeoJSON with its measurements and units.

ParameterTypeDescription
geometry *objectA GeoJSON geometry, e.g. {"type": "Point", "coordinates": [lon, lat]}
operation *stringWhat to compute; buffer also needs radius_m
radius_mBuffer radius in metres

geocode Geocode a place

Find coordinates for an address or place name (OpenStreetMap Nominatim). Check `geospark.warnings` for ambiguous names (e.g. "Springfield") and ask the user which one they mean, or add a region.

ParameterTypeDescription
query *stringAddress or place name
limitintegerMaximum number of matches to return

reverse_geocode Reverse geocode

Find the address or place at a coordinate (OpenStreetMap Nominatim).

ParameterTypeDescription
latitude *numberLatitude in degrees (WGS84)
longitude *numberLongitude in degrees (WGS84)

get_elevation Elevation

Ground elevation in metres (Copernicus GLO-30, Open Elevation fallback), with its vertical datum and accuracy.

ParameterTypeDescription
latitude *numberLatitude in degrees (WGS84)
longitude *numberLongitude in degrees (WGS84)

route Driving route

Driving route between two points (OSRM over OpenStreetMap): line geometry, distance in metres and duration in seconds.

ParameterTypeDescription
from_latitude *numberLatitude in degrees (WGS84)
from_longitude *numberLongitude in degrees (WGS84)
to_latitude *numberLatitude in degrees (WGS84)
to_longitude *numberLongitude in degrees (WGS84)

get_weather Weather

Current weather and a daily forecast for a point (Open-Meteo, no key needed).

ParameterTypeDescription
latitude *numberLatitude in degrees (WGS84)
longitude *numberLongitude in degrees (WGS84)
forecast_daysintegerNumber of days of daily forecast

get_air_quality Air quality

Latest PM2.5, NO2, O3 from the nearest monitoring stations (OpenAQ; the server needs an OPENAQ_API_KEY), with each station's data licence.

ParameterTypeDescription
latitude *numberLatitude in degrees (WGS84)
longitude *numberLongitude in degrees (WGS84)

get_active_fires Active fires

Satellite active-fire detections near a point (NASA FIRMS; the server needs a FIRMS_MAP_KEY).

ParameterTypeDescription
latitude *numberLatitude in degrees (WGS84)
longitude *numberLongitude in degrees (WGS84)
daysintegerHow many days back to look for detections

isochrone Isochrone (reachable area)

Where can you get to from a point within N minutes on foot, by bike or by car? Returns one polygon per contour with its geodesic area (Valhalla over OpenStreetMap).

ParameterTypeDescription
latitude *numberLatitude in degrees (WGS84)
longitude *numberLongitude in degrees (WGS84)
minutesarrayContour times, 1-60
modestringTravel mode: walk, bike or drive

travel_time_matrix Travel-time matrix

Network travel time (minutes) and distance (metres) from each origin to each destination. Note: points here are [latitude, longitude] pairs.

ParameterTypeDescription
destinations *array[[lat, lon], ...]
origins *array[[lat, lon], ...]
modestringTravel mode: walk, bike or drive

overture_features Overture Maps features

Open global map data from Overture Maps, no API key: points of interest (with categories), building footprints (height, floors, geodesic footprint area), road and path segments (geodesic length), or `divisions`, the administrative areas containing the point (country, region, city, neighbourhood). Results are nearest first, with distances in metres. Can take 5-20 s on a cold cache.

ParameterTypeDescription
latitude *numberLatitude in degrees (WGS84)
longitude *numberLongitude in degrees (WGS84)
theme *stringWhich data: places (points of interest), buildings, transportation (road and path segments) or divisions (areas containing the point)
categoryPlaces only, e.g. 'cafe'
limitMaximum number of features to return, nearest first
radius_mnumberSearch radius in metres

transform_coordinates Transform coordinates (official datums)

Convert coordinates between CRSs as the official transformation does: GDA94 to GDA2020, MGA zones, British National Grid (OSTN15), NAD27 to NAD83 (NADCON), ITRF at an epoch, and any other EPSG pair. Uses national grids (downloaded once), refuses PROJ's ballpark approximations, and returns the operation and its stated accuracy. Use this instead of applying datum parameters yourself.

ParameterTypeDescription
coordinates *array[x, y] or [x, y, z]: [lon, lat] or [easting, northing]
source_crs *stringCRS name or EPSG code, e.g. 'GDA94 / MGA zone 55' or EPSG:28355
target_crs *stringCRS name or EPSG code, e.g. 'GDA2020 / MGA zone 55' or EPSG:7855
epochDecimal year, for ITRF/ATRF frames

convert_height Convert height (geoid models)

Convert a height between the ellipsoid (GNSS, drones) and a national height datum with the official geoid model: AHD (AUSGeoid2020), ODN (OSGM15), NZVD2016 (NZGeoid2016), NAVD88 (GEOID18), or global EGM2008. Never estimate a geoid separation from memory: it is often tens of metres and varies by metres across a region.

ParameterTypeDescription
from_reference *string'ellipsoidal', AHD, ODN, NZVD2016, NAVD88 or EGM2008
height_m *numberThe height to convert, in metres
latitude *numberLatitude in degrees (WGS84)
longitude *numberLongitude in degrees (WGS84)
to_reference *string'ellipsoidal', AHD, ODN, NZVD2016, NAVD88 or EGM2008

sun_position Sun position and shadow

The Sun's apparent elevation and azimuth (from true north) at a place and time, and the shadow a vertical object casts on level ground (NOAA solar position, refraction included).

ParameterTypeDescription
latitude *numberLatitude in degrees (WGS84)
longitude *numberLongitude in degrees (WGS84)
time *stringISO 8601, with a UTC offset (2026-12-21T12:00:00+11:00) or local with tz
object_height_mHeight of a vertical object, for its shadow
tzIANA time zone for a local time, e.g. Australia/Melbourne

sun_times Sunrise, sunset and hours of sun

Sunrise, solar noon, sunset and day length on a date for a flat horizon; with terrain=True, also the hours of direct sun once hills are taken into account.

ParameterTypeDescription
date *stringLocal date, YYYY-MM-DD
latitude *numberLatitude in degrees (WGS84)
longitude *numberLongitude in degrees (WGS84)
terrainbooleanAlso count hours of direct sun above the terrain horizon (reads the DEM; ~10-60 s)
tzIANA time zone, e.g. Australia/Melbourne; default UTC

terrain_horizon Terrain horizon

The skyline the terrain makes around a point: for each azimuth, the elevation angle of the horizon and how far away the blocking terrain is (Copernicus 30 m DEM, Earth curvature and refraction). Use for solar-panel shading, valley sunlight, or what hills hide. ~10-60 s.

ParameterTypeDescription
latitude *numberLatitude in degrees (WGS84)
longitude *numberLongitude in degrees (WGS84)
max_distance_mnumberHow far out to look for blocking terrain, in metres
observer_height_mnumberEye or sensor height above ground
step_degnumberAzimuth spacing; must divide 360

line_of_sight Line of sight

Whether A and B can see each other over the terrain (Copernicus 30 m DEM, curvature and refraction), the minimum clearance and where it occurs; with frequency_mhz, the first Fresnel zone clearance of a radio link (60% clear is the usual rule).

ParameterTypeDescription
lat_a *numberLatitude in degrees (WGS84)
lat_b *numberLatitude in degrees (WGS84)
lon_a *numberLongitude in degrees (WGS84)
lon_b *numberLongitude in degrees (WGS84)
frequency_mhzFor a radio link: report first Fresnel zone clearance
height_a_mnumberHeight above ground at A (e.g. a mast)
height_b_mnumberHeight above ground at B

location_report Location report

A dossier for a place: address, elevation, weather, and nearby amenities with exact distances, as a GeoJSON map layer listing every data source used. Takes ~10-30 s.

ParameterTypeDescription
location *stringPlace to analyse
radius_mnumberSearch radius for nearby amenities, in metres

select_site Site selection

Rank candidate sites in an area by geodesic distance to amenities you want nearby and away from ones to avoid (OpenStreetMap data). Takes ~10-30 s.

ParameterTypeDescription
within *stringCity or neighbourhood
avoidarrayAmenity types to stay away from
facility_typestringWhat the site is for, e.g. 'pharmacy'; labels the result, does not change the ranking
neararrayAmenity types to be close to
radius_mnumberSearch radius in metres from the centre of the area