geo2svg

geo2svg [options…] [file]

Converts the specified GeoJSON file to SVG. With --newline-delimited, each input feature is rendered as a separate path element; otherwise, a single path element is generated.

By default, the SVG’s fill is set to none and the stroke is set to black. To override these values on a per-feature basis, the following GeoJSON feature properties will be propagated to attributes:

  • fill
  • fill-rule (or fillRule)
  • fill-opacity (or fillOpacity)
  • stroke
  • stroke-width (or strokeWidth)
  • stroke-linecap (or strokeLinecap)
  • stroke-linejoin (or strokeLinejoin)
  • stroke-miterlimit (or strokeMiterlimit)
  • stroke-dasharray (or strokeDasharray)
  • stroke-dashoffset (or strokeDashoffset)
  • stroke-opacity (or strokeOpacity)

If the feature has an id, the path element will have a corresponding id attribute. If the feature has a title property, the path element will have a title element with the corresponding value. For an example of per-feature attributes, see this California population density map.

Note: per-feature attributes are most useful in conjunction with newline-delimited input, as otherwise the generated SVG only has a single path element. To set these properties dynamically, pass the input through ndjson-map.

doc_D3_Js
2016-11-24 10:27:46
Comments
Leave a Comment

Please login to continue.