Fiona reads and writes spatial data files
88
Build a utility that converts between different geometry representation formats, with a focus on binary geometry handling.
Create a Python module that provides functionality to:
The module should handle common geometry types including:
@generates
def wkb_to_geometry(wkb_bytes):
"""
Parse WKB binary data and return a geometry dictionary.
Parameters:
- wkb_bytes: bytes, Well-Known Binary geometry data
Returns:
dict: GeoJSON-like geometry with 'type' and 'coordinates' keys
"""
def geometry_to_wkb(geometry):
"""
Convert a geometry dictionary to WKB binary format.
Parameters:
- geometry: dict, GeoJSON-like geometry with 'type' and 'coordinates'
Returns:
bytes: Well-Known Binary representation of the geometry
"""
def validate_roundtrip(geometry):
"""
Validate that a geometry survives round-trip conversion to WKB and back.
Parameters:
- geometry: dict, GeoJSON-like geometry
Returns:
bool: True if the round-trip conversion produces an equivalent geometry
"""Provides geospatial data reading and writing capabilities, including WKB binary geometry handling.
Install with Tessl CLI
npx tessl i tessl/pypi-fionadocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10