--
You received this message because you are subscribed to the Google Groups "SpatiaLite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spatialite-users+unsubscribe@googlegroups.com.
To post to this group, send email to spatialite-users@googlegroups.com.
Visit this group at https://groups.google.com/group/spatialite-users.
For more options, visit https://groups.google.com/d/optout.
As a continuation of TWKB request:for those wishing to test TWKB, I wrote a small utility converting from WKB to TWKB https://github.com/rinigus/wkb2twkb-sqlite . TWKB is also available as a format for SQLite geometry in Mapnik (current master branch)Rinigus
On Mon, Apr 24, 2017 at 9:59 AM, Rinigus <rinig...@gmail.com> wrote:
Hi,in addition to available formats for storing geometries, it would be great to get support to TWKB (https://github.com/TWKB/Specification/blob/master/twkb.md). When compared to other formats (WKB, Spatialite "Compressed"), TWKB allows you to reduce storage requirements significantly taking into account precision that you require. When tested on rendering Sweden on mobile using Mapnik (SQLite), I have not noticed any slowdown using TWKB. However, the database shrank from 1.22GB (WKB) to 563MB (TWKB). TWKB is supported by PostGIS and would be appropriate to get its support in Spatialite as well. As far as I could see from the files, its supported by RT Topology Library https://git.osgeo.org/gogs/rttopo/librttopo as well.Best wishes,Rinigus
--
You received this message because you are subscribed to the Google Groups "SpatiaLite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spatialite-use...@googlegroups.com.
To post to this group, send email to spatiali...@googlegroups.com.
Hi,
What is the difference in the db size if you compare it to compressed SpatiaLite geometries? This document suggest that for lines and polygons the saving is about 50% http://www.gaia-gis.it/gaia-sins/SpatiaLite-Geometries-Addendum.pdf. If the difference is not remarkable big, do you consider that TWKB has some other features that makes it better than compressed Spatialite geometries?
To unsubscribe from this group and stop receiving emails from it, send an email to spatialite-users+unsubscribe@googlegroups.com.
To post to this group, send email to spatialite-users@googlegroups.com.
Hi,in practice, TWKB is used as a lossy format as well. You specify precision while compressing the data with the 7 digits after the comma maximal precision supported by LWGEOM.
As for space savings, that is very much dependent on your data (as usual). In the following examples, I used OSM data and precision 6 which seems to be adequate for drawing road maps. Here, I compare compression with WKB. To compare with Sparialite Compressed, I would have to take time to adjust scripts.When compared with Spatialite compressed format, you could immediately see that TWKB is much less "chatty" in the header. There is an advantage even to use it for POINTs. For example, OSM building label coordinates (GEOMETRY BLOB) are compressed from WKB (double fp coordinates) to TWKB with the factor of 2 (48% remained from original WKB). Compared to WKB, I presume that all Spatialite formats are larger due to included BBOX.
When we talk about LINESTRING and POLYGON, I usually observe compression of Geometry BLOBs in the range of 70-75% (remaining size is 25-30% for geometry blobs).When talking about Mapnik-ready datasets that include RTree, labels, and some additional info, I get reduction (from WKB -> TWKB in MBs):Denmark: 759 -> 446 (60% remained, this country has rather few buildings entered as polygons, mainly label+point)Estonia: 319 -> 151 (47% remained)Sweden: 1251 -> 558 (45% remained)As for additional advantage, TWKB is supported by Mapnik and PostGIS. Mapnik does not support Spatialite Compressed (at least not yet).
what is realistically possible with reasonable
little effort is implementing two further SQL
functions: ToTWKB() and FromTWKB()
(strictly modeled on TOEWKB/FromEWKB, ToWKB/FromWKB
and alike).
this will be enough to create and populate pure
SQLite tables internally storing TWKB geometries;
such tables will not be "vanilla" spatial tables
(they will lack supporting triggers, spatial
index and alike), but will still support a
reasonable level of spatial data processing.
it surely is a compromise, but it's a reasonable
one.
So looking at this I'd forget about twkb and go straight to topo model, if the data size is your top priority. Also both sqlite files are surprising big and therefore less suitable for compact transfer compared to even text-based formats.
On Fri, 28 Apr 2017 01:40:53 -0700 (PDT), Jaak L wrote:
> So twkb is about ~50% of WKB, and clear winner to my surprise is
> topojson.
>
not so much surprisingly.
any topology will define just once any Edge separating two
adjacent Faces, and will thus require about half the storage
space required by the conventional representation of
Polygons.
> sqlites are huge probably due to not optimizisation, include
> big proj tables perhaps.
>
please, don't compare apples and oranges: all the others
are just "data formats" whilst SpatiaLite is a real
Spatial DBMS.
--
You received this message because you are subscribed to the Google Groups "SpatiaLite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spatialite-users+unsubscribe@googlegroups.com.
To post to this group, send email to spatialite-users@googlegroups.com.
Drastically taking my original ~20M spatialite with polygons came down to ~200K (note: this is already before simplification!), which is ~100x smaller file. I would not suggest that spatialite should use internally topo data model in a generic way, but if you design overall solution then it is good to know anyway.Jaak
--
You received this message because you are subscribed to the Google Groups "SpatiaLite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spatialite-users+unsubscribe@googlegroups.com.
To post to this group, send email to spatialite-users@googlegroups.com.