]> granicus.if.org Git - postgis/commitdiff
Make non-M attempts to run LRS functions error out instead of return NULL (#113)
authorPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 5 Nov 2009 00:37:32 +0000 (00:37 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Thu, 5 Nov 2009 00:37:32 +0000 (00:37 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4745 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/lwgeom_functions_lrs.c

index 540ea6affd5a1004b449b69dbf5c3dba57f174dc..50032f73b087fb706ef14ea83ba5062b0c709de3 100644 (file)
@@ -495,10 +495,11 @@ Datum LWGEOM_locate_between_m(PG_FUNCTION_ARGS)
        }
 
        /*
-        * Return NULL if input doesn't have a measure
+        * Return error if input doesn't have a measure
         */
        if ( ! lwgeom_hasM(gin->type) )
        {
+               lwerror("Geometry argument does not have an 'M' ordinate");
                PG_RETURN_NULL();
        }
 
@@ -507,6 +508,7 @@ Datum LWGEOM_locate_between_m(PG_FUNCTION_ARGS)
         * or a collection
         */
        type=lwgeom_getType(gin->type);
+               
        if ( type == POLYGONTYPE || type == MULTIPOLYGONTYPE || type == COLLECTIONTYPE )
        {
                lwerror("Areal or Collection types are not supported");