Skip to content
GuidesBlogPlaygroundDashboard

Calculate an isochrone from a point

client.Routing.IsochronePost(ctx, body) (*RoutingIsochronePostResponse, error)
POST/api/v1/isochrone

Calculate an isochrone from a point

ParametersExpand Collapse
body RoutingIsochronePostParams
Lat param.Field[float64]

Latitude

Lng param.Field[float64]

Longitude

Time param.Field[float64]

Travel time in seconds (1-7200)

Format param.Field[string]optional

Response format: json (default), geojson, csv, ndjson

Mode param.Field[string]optional

Travel mode (auto, foot, bicycle)

OutputFields param.Field[string]optional

Comma-separated property fields to include

OutputGeometry param.Field[bool]optional

Include geometry (default true)

OutputInclude param.Field[string]optional

Extra computed fields: bbox, center

OutputPrecision param.Field[int64]optional

Coordinate decimal precision (1-15, default 7)

OutputSimplify param.Field[float64]optional

Simplify geometry tolerance in meters

ReturnsExpand Collapse
type RoutingIsochronePostResponse struct{…}

GeoJSON Feature or FeatureCollection representing isochrone polygons — areas reachable within the specified travel time(s). Single time value returns a Feature; comma-separated times return a FeatureCollection with one polygon per contour.

Features []GeoJsonFeatureoptional

Array of isochrone polygon Features (multi-contour only)

GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints.

Coordinates GeoJsonGeometryCoordinatesUnion

Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc.

One of the following:
type GeoJsonGeometryCoordinatesPoint []float64

[longitude, latitude] or [longitude, latitude, elevation]

type GeoJsonGeometryCoordinatesLineStringOrMultiPoint [][]float64

Array of [lng, lat] positions

type GeoJsonGeometryCoordinatesPolygonOrMultiLineString [][][]float64

Array of linear rings / line strings

type GeoJsonGeometryCoordinatesMultiPolygon [][][][]float64

Array of polygons

Type GeoJsonGeometryType

Geometry type

One of the following:
const GeoJsonGeometryTypePoint GeoJsonGeometryType = "Point"
const GeoJsonGeometryTypeLineString GeoJsonGeometryType = "LineString"
const GeoJsonGeometryTypePolygon GeoJsonGeometryType = "Polygon"
const GeoJsonGeometryTypeMultiPoint GeoJsonGeometryType = "MultiPoint"
const GeoJsonGeometryTypeMultiLineString GeoJsonGeometryType = "MultiLineString"
const GeoJsonGeometryTypeMultiPolygon GeoJsonGeometryType = "MultiPolygon"
Properties map[string, unknown]

OSM tags flattened as key-value pairs, plus @type (node/way/relation) and @id (OSM ID) metadata fields. May include distance_m for proximity queries.

Type GeoJsonFeatureType

Always Feature

ID stringoptional

Compound identifier in type/osm_id format

Geometry GeoJsonGeometryoptional

GeoJSON Geometry object per RFC 7946. Coordinates use [longitude, latitude] order. 3D coordinates [lng, lat, elevation] are used for elevation endpoints.

Coordinates GeoJsonGeometryCoordinatesUnion

Coordinates array. Nesting depth varies by geometry type: Point = [lng, lat], LineString = [[lng, lat], ...], Polygon = [[[lng, lat], ...], ...], etc.

One of the following:
type GeoJsonGeometryCoordinatesPoint []float64

[longitude, latitude] or [longitude, latitude, elevation]

type GeoJsonGeometryCoordinatesLineStringOrMultiPoint [][]float64

Array of [lng, lat] positions

type GeoJsonGeometryCoordinatesPolygonOrMultiLineString [][][]float64

Array of linear rings / line strings

type GeoJsonGeometryCoordinatesMultiPolygon [][][][]float64

Array of polygons

Type GeoJsonGeometryType

Geometry type

One of the following:
const GeoJsonGeometryTypePoint GeoJsonGeometryType = "Point"
const GeoJsonGeometryTypeLineString GeoJsonGeometryType = "LineString"
const GeoJsonGeometryTypePolygon GeoJsonGeometryType = "Polygon"
const GeoJsonGeometryTypeMultiPoint GeoJsonGeometryType = "MultiPoint"
const GeoJsonGeometryTypeMultiLineString GeoJsonGeometryType = "MultiLineString"
const GeoJsonGeometryTypeMultiPolygon GeoJsonGeometryType = "MultiPolygon"
Properties RoutingIsochronePostResponsePropertiesoptional

Isochrone metadata

AreaM2 float64optional

Area of the isochrone polygon in square meters (multi-contour features only)

MaxCostS float64optional

Maximum actual travel cost in seconds to the isochrone boundary (single contour only)

Mode RoutingIsochronePostResponsePropertiesModeoptional

Travel mode used for the isochrone calculation

One of the following:
const RoutingIsochronePostResponsePropertiesModeAuto RoutingIsochronePostResponsePropertiesMode = "auto"
const RoutingIsochronePostResponsePropertiesModeFoot RoutingIsochronePostResponsePropertiesMode = "foot"
const RoutingIsochronePostResponsePropertiesModeBicycle RoutingIsochronePostResponsePropertiesMode = "bicycle"
TimeSeconds float64optional

Travel time budget in seconds

VerticesReached int64optional

Number of road network vertices within the isochrone

Type RoutingIsochronePostResponseTypeoptional

Feature for single contour, FeatureCollection for multiple contours

One of the following:
const RoutingIsochronePostResponseTypeFeature RoutingIsochronePostResponseType = "Feature"
const RoutingIsochronePostResponseTypeFeatureCollection RoutingIsochronePostResponseType = "FeatureCollection"

Calculate an isochrone from a point

package main

import (
  "context"
  "fmt"

  "github.com/plazafyi/plaza-go"
  "github.com/plazafyi/plaza-go/option"
)

func main() {
  client := githubcomplazafyiplazago.NewClient(
    option.WithAPIKey("My API Key"),
  )
  response, err := client.Routing.IsochronePost(context.TODO(), githubcomplazafyiplazago.RoutingIsochronePostParams{
    Lat: githubcomplazafyiplazago.F(0.000000),
    Lng: githubcomplazafyiplazago.F(0.000000),
    Time: githubcomplazafyiplazago.F(0.000000),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Features)
}
{
  "features": [
    {
      "geometry": {
        "coordinates": [
          2.3522,
          48.8566
        ],
        "type": "Point"
      },
      "properties": {
        "@id": "bar",
        "@type": "bar",
        "amenity": "bar",
        "cuisine": "bar",
        "name": "bar"
      },
      "type": "Feature",
      "id": "node/21154906"
    }
  ],
  "geometry": {
    "coordinates": [
      2.3522,
      48.8566
    ],
    "type": "Point"
  },
  "properties": {
    "area_m2": 0,
    "max_cost_s": 0,
    "mode": "auto",
    "time_seconds": 0,
    "vertices_reached": 0
  },
  "type": "Feature"
}
Returns Examples
{
  "features": [
    {
      "geometry": {
        "coordinates": [
          2.3522,
          48.8566
        ],
        "type": "Point"
      },
      "properties": {
        "@id": "bar",
        "@type": "bar",
        "amenity": "bar",
        "cuisine": "bar",
        "name": "bar"
      },
      "type": "Feature",
      "id": "node/21154906"
    }
  ],
  "geometry": {
    "coordinates": [
      2.3522,
      48.8566
    ],
    "type": "Point"
  },
  "properties": {
    "area_m2": 0,
    "max_cost_s": 0,
    "mode": "auto",
    "time_seconds": 0,
    "vertices_reached": 0
  },
  "type": "Feature"
}