[postgis-devel] SnapToGrid and higher dimensions

strk at refractions.net strk at refractions.net
Thu Dec 1 11:24:55 PST 2005


I've been asked to add support for higher dimensions
in SnapToGrid.

As a first step I changed the primitive ptarray_grid()
so to accept and use a 4D grid specification.
Dimensions actually gridded are determined by the cell
size specification of it in the grid structure.
A size of 0 means "do not grid this dimension".
As a consequence the SnapToGrid function does not
discard higher dimensions anymore.

Now, we need more function signatures for SnapToGrid
to allow for fine-control the grid.

We currently have a C function:

	1. SnapToGrid(geom, XSIZE, YSIZE, XOFFSET, YOFFSET)

And two SQL wrappers:

	2. SnapToGrid(geom, XSIZE, YSIZE) -- Offsets set to 0
	3. SnapToGrid(geom, SIZE) -- All sizes to SIZE, Offsets set to 0

The problem is that if we want to use the same function name
we'll end up having troubles. For example, the complete signature
would be something like:

	SnapToGrid(geom, XSIZE, YSIZE, ZSIZE, MSIZE,
		         XOFFS, YOFFS, ZOFFS, MOFFS)

Then how should we interpret function 1. above ?
Would the 4 floats be X,Y,Z and M sizes or XY size and offsets ?

Suggestions ?

--strk; 

 /"\    ASCII Ribbon Campaign
 \ /    Respect for open standards
  X     No HTML/RTF in email
 / \    No M$ Word docs in email




More information about the postgis-devel mailing list