[OSGeo-Standards] An idea about a compressed binary geometry format

Nicklas Avén nicklas.aven at jordogskog.no
Tue Aug 20 11:32:53 PDT 2013


Hallo Cameron

Thanks for commenting.

Do you know what that investigation led to?

To me it seems like a little extra away around the goal to pack a
text-based format using a binary version of a markup method. But it is
very much possible that I miss the point.

Just to explain from what angle I have thought about TWKB. The structure
comes mostly from the WKB format. But there is two main differences, The
geometry holds an ID. That makes it possible to nest the geometry (like
in vector tiles) or send it separated from the attribute data but still
keeping the ID.
The second big difference is that except for the first coordinate in a
geometry (big nested or small single) the other coordinates is delta
values like in svg or topoJSON. To get the gain of those small delta
values there is a need for a variable INT type. First I tried with a
home brewed way of doing it described in the spec. But now it is the
varInt method used in protobuffers. It performs very good and is much
easier to implement. 


/Nicklas



On Tue, 2013-08-20 at 07:21 +1000, Cameron Shorter wrote:
> Hi Nicklas,
> You might want to look into Binary XML, which I understand was being
> investigated for GML at one point - apparently into a white paper
> according to:
> http://en.wikipedia.org/wiki/Binary_XML
> 
> On 20/08/13 06:27, Nicklas Avén wrote:
> 
> > Hallo
> > 
> > I do not know if this list is the right place so that will be my first
> > question.
> > 
> > I have a naive idea about a compressed binary format for geometries.
> > 
> > I have done some work to sketch what it is about.
> > 
> > The name so far is TWKB (Tiny WKB)
> > 
> > Can this list be the right place to discuss this format. It is just an
> > embryo, and my hope is that it can be something designed by and hard
> > connected to the FOSS4G-community.
> > 
> > 
> > What is done is:
> > 
> > A draft of a spec:
> > https://github.com/nicklasaven/TWKB/blob/master/twkb.md
> > 
> > including ideas from Evan Rouault and Oliver Tonnhofer 
> > 
> > 
> > Demos:
> > Streaming TWKB from PostGIS to Leaflet via websocket.
> > http://178.79.156.122/twkb_node/
> > 
> > Streaming TWKB-aggregates (tiles created on the fly) from PostGIS to
> > Leaflet
> > http://178.79.156.122/twkb_agg
> > 
> > A page to compare twkb in timing and size with geoJSON directly from
> > PostGIS.
> > http://178.79.156.122/twkb_test
> > 
> > 
> > Examples of implementation.
> > The PostGIS part is in the trunk:
> > http://svn.osgeo.org/postgis/trunk/
> > 
> > The client parts is exemplified here:
> > https://github.com/nicklasaven/twkb_web
> > 
> > 
> > So, first, can this list host discussions about TWKB (or whatever name
> > it gets)?
> > If not where should it go?
> > 
> > Second, any feedback is very welcome
> > 
> > 
> > 
> > Best Regards
> > 
> > Nicklas Avén
> > 
> > _______________________________________________
> > Standards mailing list
> > Standards at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/standards
> 
> _______________________________________________
> Standards mailing list
> Standards at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/standards




More information about the Standards mailing list