[postgis-devel] TWKB_agg broken ?

Nicklas Avén nicklas.aven at jordogskog.no
Thu Aug 7 03:20:29 PDT 2014


I will try to take a look this evening.


I seems like a too big difference. But there is two moe things that will save some space in the aggregate version.


1) the header byte will not be repeated
2) If all geometries is of the same type, also the type byte will be saved type (type 21), but if it is more that 1 included type it will be a type 24.


I see that the spec is a mess about those multi types. I will have to lok through it, and it is needd with a discussion about what is best.


The question is if type 21 shall be of a collection of multipoints or single points. If it is multipoints it will need a  extra npoints VarINT, if it is single points the id will be repeated over many points when it is feeded with multipoints. The third option is one type for aggregated single points and one for aggregated multipoints. But that I think will be to complicate things too much.


I think I have a long list now of things thatI have promised to do :-) 


Actuelly I did a decent try yesterday evening, but I was just messing with very very bad network connections for a few hours before giving up. (I live in one of the richest coutries in the world, but investing in the internet infrastructure seems to be just dreams)


But I have modified the cunit tests for wkb to work for twkb. I will comit them if I get out on the net this evening (or i will bring it to the work on friday).


/Nicklas



2014-08-07 Sandro Santilli  wrote:

On Thu, Aug 07, 2014 at 10:44:40AM +0200, Nicklas Avén wrote:
>> 
>> 
>> 2014-08-07 Sandro Santilli  wrote:
>> 
>> On Wed, Aug 06, 2014 at 07:04:34PM +0200, Nicklas Avén wrote:
>> >> On on., 2014-08-06 at 18:40 +0200, Sandro Santilli wrote:
>> >> > Nicklas, I was looking at ST_AsTWKB_agg but I think it's broken.
>> >> > Why would otherwise the output of ST_AsTWKB_agg be smaller than
>> >> > the output of ST_AsTWKB ?
>> >> 
>> >> It is possible because the aggregate version uses delta values between
>> >> the points which often gives smaller values to store. 
>> >
>> >Is there no separator between records in the output of the aggregator ?
>> >How's it different from collecting the geometries and passing the
>> >collection to ST_AsTWKB ?
>> 
>> The differnce is that by using ST_AsTWKBagg you won't loose the individual id:s.
>> If you use ST_Collect it will just be a collection.
>
>I requested no IDs, the queries were:
>
> ST_AsTWKB   (g,0)
> ST_AsTWKBagg(g,0)
>
>The dataset I selected (10000 points) have this extent:
>
> BOX(-169.499567541294 -79.583924216684,-160.680307442788 -71.3369439435191)
>
>I specified 0 as number of digits.  This means that any absolute value
>also fits a single byte, right ?
>
>So, if IDs are absent in both and delta values fit within one byte in both...
>what else could make 10k points take 60k bytes with the non-aggregate
>and  20k bytes (1/3) with the aggregate call ?
>
>--strk;
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20140807/53491e95/attachment.html>


More information about the postgis-devel mailing list