]> granicus.if.org Git - postgis/commitdiff
Renamed Apply_Grid to SnapToGrid, documented behaviour of collapsed geoms.
authorSandro Santilli <strk@keybit.net>
Thu, 6 Jan 2005 15:29:03 +0000 (15:29 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 6 Jan 2005 15:29:03 +0000 (15:29 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@1235 b70326c6-7e19-0410-871a-916f4a2858ee

doc/postgis.xml
lwgeom/lwgeom_functions_analytic.c
lwgeom/lwpostgis.sql.in

index 5e9fcbf147eebb633bc2a3a57b9e61c79398a41f..bb8115b5ce115e346cb2dd6e663b3d08a608c81c 100644 (file)
@@ -4057,14 +4057,19 @@ FROM geometry_table;</literallayout>
         </varlistentry>
 
         <varlistentry>
-          <term>Apply_Grid(geometry, originX, originY, sizeX, sizeY)</term>
-          <term>Apply_Grid(geometry, sizeX, sizeY)</term>
-          <term>Apply_Grid(geometry, size)</term>
+          <term>SnapToGrid(geometry, originX, originY, sizeX, sizeY)</term>
+          <term>SnapToGrid(geometry, sizeX, sizeY)</term>
+          <term>SnapToGrid(geometry, size)</term>
 
           <listitem>
-            <para>Apply the grid defined by its origin and cell size to
-           the geometry points so that each one falls on a cell.
-            Remove consecutive points falling on the same cell.</para>
+            <para>Snap all points of the input geometry to the grid
+           defined by its origin and cell size.
+            Remove consecutive points falling on the same cell,
+           eventually returning NULL if output points are not
+           enough to define a geometry of the given type.
+           Collapsed geometries in a collection are stripped
+           from it.
+           </para>
           </listitem>
         </varlistentry>
 
index 567361fad57d52982c3ad753079017b242a6dc68..048087276940f5a4c96d1ed1b16f989f53a5a1a1 100644 (file)
@@ -464,7 +464,7 @@ Datum LWGEOM_line_interpolate_point(PG_FUNCTION_ARGS)
  * 
  *  Run like this:
  * 
- *     SELECT apply_grid(<geometry>, <originX>, <originY>, <sizeX>, <sizeY>);
+ *     SELECT SnapToGrid(<geometry>, <originX>, <originY>, <sizeX>, <sizeY>);
  * 
  *     Grid cells are not visible on a screen as long as the screen
  *     point size is equal or bigger then the grid cell size.
@@ -501,7 +501,7 @@ LWPOINT * lwpoint_grid(LWPOINT *point, gridspec *grid);
 LWPOLY * lwpoly_grid(LWPOLY *poly, gridspec *grid);
 LWLINE *lwline_grid(LWLINE *line, gridspec *grid);
 POINTARRAY *ptarray_grid(POINTARRAY *pa, gridspec *grid);
-Datum LWGEOM_apply_grid(PG_FUNCTION_ARGS);
+Datum LWGEOM_snaptogrid(PG_FUNCTION_ARGS);
 
 /*
  * Stick an array of points to the given gridspec.
@@ -786,8 +786,8 @@ lwgeom_grid(LWGEOM *lwgeom, gridspec *grid)
        }
 }
 
-PG_FUNCTION_INFO_V1(LWGEOM_apply_grid);
-Datum LWGEOM_apply_grid(PG_FUNCTION_ARGS)
+PG_FUNCTION_INFO_V1(LWGEOM_snaptogrid);
+Datum LWGEOM_snaptogrid(PG_FUNCTION_ARGS)
 {
        Datum datum;
        PG_LWGEOM *in_geom;
@@ -819,7 +819,7 @@ Datum LWGEOM_apply_grid(PG_FUNCTION_ARGS)
        in_lwgeom = lwgeom_deserialize(SERIALIZED_FORM(in_geom));
 
 #if VERBOSE
-       elog(NOTICE, "apply_grid got a %s", lwgeom_typename(TYPE_GETTYPE(in_lwgeom->type)));
+       elog(NOTICE, "SnapToGrid got a %s", lwgeom_typename(TYPE_GETTYPE(in_lwgeom->type)));
 #endif
 
        out_lwgeom = lwgeom_grid(in_lwgeom, &grid);
@@ -841,7 +841,7 @@ Datum LWGEOM_apply_grid(PG_FUNCTION_ARGS)
        }
 
 #if VERBOSE
-       elog(NOTICE, "apply_grid made a %s", lwgeom_typename(TYPE_GETTYPE(out_lwgeom->type)));
+       elog(NOTICE, "SnapToGrid made a %s", lwgeom_typename(TYPE_GETTYPE(out_lwgeom->type)));
 #endif
 
        out_geom = pglwgeom_serialize(out_lwgeom);
index 2ea7579c15347d2daf4022b785278854ad588c16..42e9bb06a0fb03756cc713639dc9f6b8ad243c82 100644 (file)
@@ -3166,19 +3166,19 @@ CREATEFUNCTION simplify(geometry, float8)
    AS '@MODULE_FILENAME@', 'LWGEOM_simplify2d'
    LANGUAGE 'C' WITH (isstrict,iscachable);
 
-CREATEFUNCTION apply_grid(geometry, float8, float8, float8, float8)
+CREATEFUNCTION SnapToGrid(geometry, float8, float8, float8, float8)
    RETURNS geometry
-   AS '@MODULE_FILENAME@', 'LWGEOM_apply_grid'
+   AS '@MODULE_FILENAME@', 'LWGEOM_snaptogrid'
    LANGUAGE 'C' WITH (isstrict,iscachable);
 
-CREATEFUNCTION apply_grid(geometry, float8, float8)
+CREATEFUNCTION SnapToGrid(geometry, float8, float8)
    RETURNS geometry
-   AS 'SELECT apply_grid($1, 0, 0, $2, $3)'
+   AS 'SELECT SnapToGrid($1, 0, 0, $2, $3)'
    LANGUAGE 'SQL' WITH (isstrict,iscachable);
 
-CREATEFUNCTION apply_grid(geometry, float8)
+CREATEFUNCTION SnapToGrid(geometry, float8)
    RETURNS geometry
-   AS 'SELECT apply_grid($1, 0, 0, $2, $2)'
+   AS 'SELECT SnapToGrid($1, 0, 0, $2, $2)'
    LANGUAGE 'SQL' WITH (isstrict,iscachable);
 
 CREATEFUNCTION line_interpolate_point(geometry, float8)