[postgis-devel] TWKB in PostGIS, what do you think?

Nicklas Avén nicklas.aven at jordogskog.no
Mon Jun 10 13:40:00 PDT 2013


As you may have noticed, I have continued to work on TWKB (Tiny WKB)

I still believe in it as a small and efficient export format.

When things are optimized in both ends it compresses the geometries
smaller than gzipped geoJSON (with same number of decimals) and it is
done directly after reading the geometry from disk. Not after sending it
to a webserver compressing it in php or something like that.

When the stream gets to the client it can be read directly from the
binary array into the HTML5 canvas or webGL. This part I haven't even
tried to do. In the demos it creates a javascript object (JSON-like) and
includes the geometries to leaflet from that. So it is probably a lot of
optimization that can be done.

The thing is that i think it is difficult to get the openlayers and
leaflet people put work on it before TWKB exists somewhere.

At the same time it doesn't make sense for postGIS to include it before
some client software can handle it.

So, what i would like to ask is if PostGIS PSC and dev community can
decide that TWKB will be included when it is ready?

By ready I mean that there is clients that can read it and that the
specification is properly worked through from both client and server
perspective.

What there is so far of code is placed at github:
http://github.com/nicklasaven


Paul

I think this format might be interesting for exporting your point
clouds. It will need some modifications and a special type, but than it
ought to compress very well.

What is needed then is to change the way it serializes from what I call
"method 0" to "method 2" in the spec:
https://github.com/nicklasaven/TWKB/blob/master/twkb.md

The special point cloud type will also need to contain some metadata
like a light-version of your schema.

If for instance you have a point cloud with in average one point per m2
and the precision is 1/100 meter and the points are ordered spatially
each coordinate value will need 1 byte. If needed more space because the
distance (in x, y or z-direction) between two points are more than 1.27
meters it will use 2 bytes for that value + some overhead for the change
in size.



Best Regards

Nicklas Avén






More information about the postgis-devel mailing list