[postgis-users] Tolerance on ST_Union?

Sandro Santilli strk at keybit.net
Tue Dec 18 00:03:32 PST 2012


On Mon, Dec 17, 2012 at 08:39:41PM -0500, Mathieu Basille wrote:
> Dear Sandro,
> 
> It's nice to see that it is actually planed! As for contributions, I
> would have gladly add ST_Union in the wiki, e.g. with my
> reproducible example, but I don't even know if it is a PostGIS or
> GEOS approach... It's hard to help when you don't know the mechanics
> of the engine!

I belive it must be exported by GEOS first, and then used by PostGIS.
The most easily approachable way, IMHO, is to give "precision model"
an exposure to GEOS C-API interface, and to make that also a prime
time concept in postgis. It would be nice to have a way to tell on
which grid we're working.

One issue with GEOS algorithms dealing with a precision grid is that
they expect the input to be already rounded on that grid, so in order
for us to be sure we must either embed the precision model info in
the geometry object itself or leave it to the user to be sure.

There'll need to be a function to apply the required rounding
(ST_SnapToGrid would likely be appropriate but has to be double checked
to ensure the exact same grid model is shared between PostGIS and GEOS).
Then all the geos-implemented operations (and maybe also growing to
internal ones) will need to be expanded to allow for specifying the grid
and the GEOS side of it must be ready to accept such info.

Sounds like an interesting project for Q1 2013.
Wouldn't it be nice to put an end to all those exceptions ? :)

--strk; 

 http://www.cartodb.com - Map, analyze and build applications with your data

                                       ~~ http://strk.keybit.net 



More information about the postgis-users mailing list