Module blob

Module blob 

Source
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§

GeometryError
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.