Creates a new Cercalia client instance.
The Cercalia API configuration.
Calculate a single isochrone (service area) from a center point
Center coordinate for the isochrone (WGS84)
Isochrone calculation options (value, weight, method)
IsochroneResult with WKT polygon geometry
const service = new IsochroneService(config);
// 10-minute driving time isochrone
const result = await service.calculate(
{ lat: 41.9723144, lng: 2.8260807 },
{ value: 10, weight: 'time' }
);
// 1000-meter distance isochrone
const result2 = await service.calculate(
{ lat: 41.9723144, lng: 2.8260807 },
{ value: 1000, weight: 'distance' }
);
Calculate multiple isochrones (concentric service areas)
This method allows you to calculate multiple isochrone levels in a single API request. For example, 5, 10, and 15-minute travel time isochrones.
Center coordinate (WGS84)
Array of values (e.g., [5, 10, 15] for 5, 10, 15 minutes)
Optionaloptions: Omit<IsochroneOptions, "value">Base options (weight, method) - value is taken from the values array
Array of IsochroneResult, one for each value
const service = new IsochroneService(config);
// Multiple time-based isochrones
const results = await service.calculateMultiple(
{ lat: 41.9723144, lng: 2.8260807 },
[5, 10, 15],
{ weight: 'time' }
);
// Multiple distance-based isochrones
const results2 = await service.calculateMultiple(
{ lat: 41.9723144, lng: 2.8260807 },
[500, 1000, 2000],
{ weight: 'distance', method: 'convexhull' }
);
ProtectedrequestExecutes a generic request to the Cercalia API.
Query parameters for the API request.
Human-readable name for logging and debugging.
OptionalbaseUrl: stringOptional override for the base API URL.
A promise resolving to the parsed API response.
IsochroneService - Calculates service areas (isochrones) using Cercalia API
An isochrone is a polygon representing the area reachable from a center point within a given time or distance constraint.
Cercalia API documentation: cmd=isochrone
See
https://www.cercalia.com/docs/webservices/