[Tile-serving] [openstreetmap/osm2pgsql] Support for TWKB output (#1085)

Sven Geggus notifications at github.com
Tue Mar 3 14:59:01 UTC 2020


TWKB is a multi-purpose format for serializing vector geometry data into a byte buffer, with an emphasis on minimizing size of the buffer. The format is already supported by PostGIS.

See https://github.com/TWKB/Specification/blob/master/twkb.md for details.

It is somewhat similar to PBF format.

While this will impact the database import and query speed in some way it will help to reduce the size of production tables in a significant way.

Importing a small extract of the planet I was able to reduce the size of the standard production tables by 36.3 % using seven digits after the decimal point, which should be the original resolution of the imported OSM data.

Here are the results of calling **pg_relation_size** on them:

```
 twkb_osm_point | planet_osm_point                                                                                                          
----------------+-----------------
 77 MB          | 86 MB
(1 Zeile)

 twkb_osm_line | planet_osm_line 
---------------+----------------
 98 MB         | 168 MB
(1 Zeile)

 twkb_osm_polygon | planet_osm_polygon 
------------------+-------------------
 226 MB           | 377 MB
(1 Zeile)

 twkb_osm_roads | planet_osm_roads 
----------------+-----------------
 16 MB          | 24 MB
(1 Zeile)

All tables:

----------------+-----------------
 417 MB         | 655 MB
```

A TWKB output option might well make sense using the generic backend as well as the new flex backend.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/1085
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20200303/9486f73a/attachment.htm>


More information about the Tile-serving mailing list