Expand description
The compiled geometry encoding.
One blob holds one connected polygon component: an exterior ring and its holes, as 1e-6-degree integer coordinates, delta-encoded and zigzag-varint packed, with ring closure implicit.
Working in fixed-point integers is what makes the boundary rule exact. A point on a boundary counts as inside, everywhere, and deciding that with floating-point coordinates would mean choosing an epsilon and hoping three implementations chose the same one.
Structs§
- Ring
- One closed ring, without its repeated closing vertex.
Enums§
- Geometry
Error - A malformed or unsupported geometry blob.
Constants§
- COORD_
SCALE - Coordinate units per degree.
- GEOMETRY_
FORMAT_ VERSION - Version of the blob layout this reader understands.
- RING_
EXTERIOR - The role a ring plays in its polygon.
- RING_
HOLE - A hole cut out of the exterior.
Functions§
- decode
- Decode one polygon component.
- from_e6
- Convert a stored coordinate back to degrees.
- point_
in_ rings - Exact integer point-in-polygon, boundary inclusive.
- to_e6
- Quantize a degree value onto the storage grid, rounding half away from zero.