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 | The name of the projection to use. If unspecified, the GeoJSON data will not be projected. |
field | Field | The data field containing GeoJSON data. If unspecified, the full input data object will be used. |
pointRadius | Number | Expr | Sets the default radius (in pixels) to use when drawing GeoJSON Point and MultiPoint geometries. An expression value can be used to set the point radius as a function of properties of the input GeoJSON. ≥ 3.1 |
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
.