Skip to content
GuidesPlaygroundDashboard

Calculate an isochrone from a point

client.Routing.Isochrone(ctx, query) (*GeoJsonFeature, error)
GET/api/v1/isochrone

Calculate an isochrone from a point

ParametersExpand Collapse
query RoutingIsochroneParams
Lat param.Field[float64]

Latitude

Lng param.Field[float64]

Longitude

Time param.Field[float64]

Travel time in seconds (1-7200)

Mode param.Field[string]optional

Travel mode (auto, foot, bicycle)

ReturnsExpand Collapse
type GeoJsonFeature struct{…}
Coordinates GeoJsonGeometryCoordinatesUnion

GeoJSON coordinates array (nesting depth varies by geometry type)

One of the following:
type GeoJsonGeometryCoordinatesArray []float64
type GeoJsonGeometryCoordinatesArray [][]float64
type GeoJsonGeometryCoordinatesArray [][][]float64
type GeoJsonGeometryCoordinatesArray [][][][]float64
Type GeoJsonGeometryType
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]
Type GeoJsonFeatureType
ID stringoptional

Feature identifier (type/osm_id)

OsmID int64optional

OpenStreetMap ID

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"),
  )
  geoJsonFeature, err := client.Routing.Isochrone(context.TODO(), githubcomplazafyiplazago.RoutingIsochroneParams{
    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", geoJsonFeature.ID)
}
Returns Examples