driptorch.BurnUnit.to_json#

BurnUnit.to_json(**kwargs) dict#

Returns a GeoJSON representation of the BurnUnit as a string

Parameters
**kwargs

Keyword arguments passed to write_geojson

Examples

>>> from shapely.geometry import Polygon
>>> polygon = Polygon([(-114.478, 47.163), (-114.471, 47.163), (-114.471, 47.167), (-114.478, 47.167)])
>>> burn_unit = driptorch.BurnUnit(polygon, firing_direction=270)
>>> burn_unit.to_json()
'{'type': 'FeatureCollection', 'features': [{'type': 'Feature', 'properties': {},         'geometry': {'type': 'Polygon', 'coordinates': (((-114.478, 47.163), (-114.471, 47.16299999999998),         (-114.471, 47.16699999999999), (-114.478, 47.16699999999999), (-114.478, 47.163)),)}}]}'