topojson.core.extract
Extract
Extract(self, data, options={})
This class targets the following objectives:
- Detection of geometrical type of the object
- Extraction of linestrings from the object
The extract function is the first step in the topology computation. The following sequence is adopted:
- extract
- join
- cut
- dedup
- hashmap
For each line or polygon geometry in the input hash, including nested geometries as in geometry collections, the coordinates
array is replaced with an equivalent "coordinates"
array that points to one of the linestrings as indexed in bookkeeping_geoms
and stored in linestrings
.
For Points geometries count the same, but are stored in coordinates
and referenced in bookkeeping_coords
.
Parameters
Returns
to_dict
Extract.to_dict(self)
Convert the Extract object to a dictionary.
to_svg
Extract.to_svg(self, separate=False)
Display the linestrings as SVG.
Parameters