-
Notifications
You must be signed in to change notification settings - Fork 0
Geo Paths
For cartographic visualizations, D3 supports a handful of utilities for displaying and manipulating geographic data. These utilities are based on the GeoJSON format, which is standard way of representing geographic features in JavaScript. For example, GDAL includes the ogr2ogr tool which can convert binary shapefiles into GeoJSON; the shapefile is another common representation for geographic data, frequently used by the U.S. Census Bureau.

The primary mechanism for displaying geographic data is d3.geo.path. In many ways, this class is similar to d3.svg.line: given a geometry or feature object, it generates the path data string suitable for the "d" attribute of an SVG path element.
# d3.geo.path()
# path(data[, index])
# path.projection([projection])
# path.area(feature)
# path.centroid(feature)
# path.pointRadius([radius])
# d3.geo.bounds(feature)