[postgis-devel] snapping Z and M values with SnapToGrid (was before "measures test fail")

Nicklas Avén nicklas.aven at jordogskog.no
Sun Oct 24 07:56:27 PDT 2010


Same again just to get better subject


On Sun, 2010-10-24 at 16:53 +0200, Nicklas Avén wrote:
> It seems like m and z snapping is implemented  at the "version 4" (in
> doc) of the function, when a point is used to define the origin of the
> grid cell. Bu tin the more common ST_Snaptogrid(geometry,
> size_of_grid) there is no snapping to m and z.
> 
> In lwgeom_functions_analytic.c there is a comment on line 790
> 
> /* Do not support gridding Z and M values for now */
> grid.ipz=grid.ipm=grid.zsize=grid.msize=0;
> 
> 
> The problem now if we want those other version to also snap z and m is
> that we will have to mess up the order of arguments in some way.
> 
> In the documentation
> http://postgis.org/documentation/manual-1.5/ST_SnapToGrid.html
> 
> The version of the ordinary snaptogrid function with all arguments 
> have this form:
> ST_SnapToGrid(geometry geomA, float originX, float originY, float
> sizeX, float sizeY);
> 
> so, where to put z and m arguments?
> to not change the old ones we have to put them in the end. But to
> follow the form from before we out to have the originZ and originM
> before, sizeX
> 
> Any ideas?
> 
> /Nicklas
> 
> 
> 
> 
> On Mon, 2010-10-18 at 17:39 +0200, strk wrote: 
> > On Mon, Oct 18, 2010 at 03:42:58PM +0200, Nicklas Avén wrote:
> > > Hallo Sandro
> > > 
> > > I was about to do the same a few weeks ago when I realized that
> > > snaptogrid is only workin in 2 dimensions now. 
> > > 
> > > I think we said then we should open up for the third dimension in
> > > snaptogrid to. As I understand it it is all prepared (you are the author
> > > aren't you :-)  ). I have not looked at it since the discussion on the
> > > list a few weeks ago, but maybe it is easier and faster for you to open
> > > up for 3D snapping. 
> > 
> > Seems like done already, from postgis.sql.in.c:
> > 
> > -- SnapToGrid(input, point_offsets, xsize, ysize, zsize, msize)
> > -- Availability: 1.2.2                                                          CREATE OR REPLACE FUNCTION ST_SnapToGrid(geometry, geometry, float8, float8, float8, float8) AS 'MODULE_PATHNAME', 'LWGEOM_snaptogrid_pointoff'
> >         LANGUAGE 'C' IMMUTABLE STRICT;
> > 
> > Does up to 4d..
> > 
> > --strk;
> > 
> >   ()   Free GIS & Flash consultant/developer
> >   /\   http://strk.keybit.net/services.html
> > _______________________________________________
> > postgis-devel mailing list
> > postgis-devel at postgis.refractions.net
> > http://postgis.refractions.net/mailman/listinfo/postgis-devel
> > 
> 
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel





More information about the postgis-devel mailing list