Changeset 2059
- Timestamp:
- 11/23/05 06:52:39 (6 years ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
CHANGES (modified) (1 diff)
-
lwgeom/lwgeom_ogc.c (modified) (4 diffs)
-
regress/regress_expected (modified) (1 diff)
-
regress/regress.sql (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHANGES
r2053 r2059 24 24 - Initial support for topology modelling 25 25 - Stricter mapping between DBF and SQL integer and string attributes 26 - Changed M() and Z() functions to return NULL if requested 27 dimension is not available 26 28 27 29 PostGIS 1.0.5CVS -
trunk/lwgeom/lwgeom_ogc.c
r1903 r2059 617 617 // Z(GEOMETRY) -- find the first POINT(..) in GEOMETRY, returns its Z value. 618 618 // Return NULL if there is no POINT(..) in GEOMETRY. 619 // Return 0if there is no Z in this geometry.619 // Return NULL if there is no Z in this geometry. 620 620 PG_FUNCTION_INFO_V1(LWGEOM_z_point); 621 621 Datum LWGEOM_z_point(PG_FUNCTION_ARGS) … … 629 629 geom = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0)); 630 630 631 // if there's no Z return 0632 if ( ! TYPE_HASZ(geom->type) ) PG_RETURN_ FLOAT8(0.0);631 // if there's no Z return NULL 632 if ( ! TYPE_HASZ(geom->type) ) PG_RETURN_NULL(); 633 633 634 634 inspected = lwgeom_inspect(SERIALIZED_FORM(geom)); … … 656 656 // M(GEOMETRY) -- find the first POINT(..) in GEOMETRY, returns its M value. 657 657 // Return NULL if there is no POINT(..) in GEOMETRY. 658 // Return 0if there is no M in this geometry.658 // Return NULL if there is no M in this geometry. 659 659 PG_FUNCTION_INFO_V1(LWGEOM_m_point); 660 660 Datum LWGEOM_m_point(PG_FUNCTION_ARGS) … … 668 668 geom = (PG_LWGEOM *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0)); 669 669 670 // if there's no M return 0671 if ( ! TYPE_HASM(geom->type) ) PG_RETURN_ FLOAT8(0.0);670 // if there's no M return NULL 671 if ( ! TYPE_HASM(geom->type) ) PG_RETURN_NULL(); 672 672 673 673 inspected = lwgeom_inspect(SERIALIZED_FORM(geom)); -
trunk/regress/regress_expected
r2057 r2059 133 133 131|1 134 134 132|2 135 133|0 135 133| 136 133a|3 137 133b| 138 133c| 139 133d|4 140 133e| 136 141 134|0 137 142 135|13 -
trunk/regress/regress.sql
r2057 r2059 224 224 select '132', Y('POINT(1 2)'); 225 225 select '133', Z('POINT(1 2)'); 226 select '133a', Z('POINT(1 2 3)'); 227 select '133b', Z('POINTM(1 2 3)'); 228 select '133c', M('POINT(1 2)'); 229 select '133d', M('POINTM(1 2 4)'); 230 select '133e', M('POINT(1 2 4)'); 226 231 227 232 select '134', distance('POINT(1 2)', 'POINT(1 2)');
