GeoPath Transform

The geopath transform maps GeoJSON features to SVG path strings according to a provided cartographic projection. It is intended for use with the path mark type. This transform is similar in functionality to the geoshape transform, but immediately generates SVG path strings, rather than producing a shape instance that delays projection until the rendering stage. The geoshape transform may have better performance for the case of canvas-rendered dynamic maps.

This transform uses the d3-geo library.

Example

Transform Parameters

Property Type Description
projection String Required. The name of the projection to use.
field Field The data field containing GeoJSON data. If unspecified, the full input data object will be used.
as String The output field to write. The default is "path".

Usage

{
  "type": "geopath",
  "projection": "projection"
}

Generates path data for GeoJSON objects, using the specified projection. Results are written to the default output field path.