Python: module TileStache.Goodies.VecTiles.wkb

TileStache.Goodies.VecTiles.wkb | index

`Shapeless handling of WKB geometries.
Use approximate_wkb() to copy an approximate well-known binary representation of
a geometry. Along the way, reduce precision of double floating point coordinates
by replacing their three least-significant bytes with nulls. The resulting WKB
will match the original at up to 26 bits of precision, close enough for
spherical mercator zoom 18 street scale geography.
Reduced-precision WKB geometries will compress as much as 50% smaller with zlib.
See also:
http://edndoc.esri.com/arcsde/9.0/general_topics/wkb_representation.htm
http://en.wikipedia.org/wiki/Double-precision_floating-point_format`

Functions
`` |  | approx_geometry(src, dest) approx_line(src, dest, copy_int, approx_point) approx_point_big(src, dest) `Copy a pair of big-endian doubles between files, truncating significands.` approx_point_little(src, dest) `Copy a pair of little-endian doubles between files, truncating significands.` approx_polygon(src, dest, copy_int, approx_point) approximate_wkb(wkb_in) `Return an approximation of the input WKB with lower-precision geometry.` copy_byte(src, dest) `Copy an unsigned byte between files, and return it.` copy_int_big(src, dest) `Copy a big-endian unsigned 4-byte int between files, and return it.` copy_int_little(src, dest) `Copy a little-endian unsigned 4-byte int between files, and return it.` unpack(...) `Unpack the string containing packed C structure data, according to fmt. Requires len(string) == calcsize(fmt).`

Data
`` |  | wkbGeometryCollection = 7 wkbLineString = 2 wkbMultiLineString = 5 wkbMultiPoint = 4 wkbMultiPolygon = 6 wkbMultis = (4, 5, 6, 7) wkbNDR = 1 wkbPoint = 1 wkbPolygon = 3 wkbXDR = 0