From: Paul Ramsey Date: Thu, 5 Nov 2009 00:37:32 +0000 (+0000) Subject: Make non-M attempts to run LRS functions error out instead of return NULL (#113) X-Git-Tag: 1.5.0b1~290 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=593c75be5b4b45547fc4dbc2a41ce4e7025f21ac;p=postgis Make non-M attempts to run LRS functions error out instead of return NULL (#113) git-svn-id: http://svn.osgeo.org/postgis/trunk@4745 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/lwgeom_functions_lrs.c b/postgis/lwgeom_functions_lrs.c index 540ea6aff..50032f73b 100644 --- a/postgis/lwgeom_functions_lrs.c +++ b/postgis/lwgeom_functions_lrs.c @@ -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");