Isochrone polygons are a great way of visualising complex travel-time datasets in a powerful way - what does “half an hour away” really look like? With TargomoR you can add them straight into a leaflet map, or get the data in a convenient form for analysis such as testing intersections with known boundaries (i.e. is any part of this region within half an hour of that point?).

Getting the Data

For the isochrone polygon service, getTargomoPolygons() returns a Simple Feature Collection of 2 fields. The fields are:

  • time - the time in seconds of each isochrone
  • area - the area in square metres of the isochrone

Each feature is a POLYGON (or MULTIPOLYGON). There is one feature per time specified in the travelTimes argument of targomoOptions() - see the vignette on Options for more information.

Integration with Leaflet

If we want to integrate this into a leaflet map, you can either:

The second option looks like:

Drawing Options

Using addTargomoPolygons() you can customise the way the polygons appear on the map with a call to polygonDrawOptions(). The options available are:

Option Default Meaning
stroke TRUE Should the polygons have a border?
weight 5 The border stroke-weight
color list("red", "orange", "green") The border color
opacity 0.5 The border opacity
fill TRUE Should the interior of the polygons be filled?
fillColor color The interior fill color (defaults to border color)
fillOpacity 0.2 The fill opacity
dashArray NULL The border dash pattern
smoothFactor 1 How much to simplify the polylines
noClip FALSE Disable polyline clipping?

For example, if we wish to re-create the map above, but with opaque polygons in shades of blue with thin black outlines, we can do the following (this time using drawTargomoPolygons()):