]> granicus.if.org Git - postgis/commitdiff
Raise a NOTICE when a SRID <= 0 but != SRID_UNKNOWN is converted
authorSandro Santilli <strk@keybit.net>
Thu, 6 Oct 2011 14:08:59 +0000 (14:08 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 6 Oct 2011 14:08:59 +0000 (14:08 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@7956 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwutil.c

index 3cf389aa6e6727613edce5662c8fd4ee0c84a872..679a8ce899c26be07c040b943afca6a21d23a35b 100644 (file)
@@ -373,6 +373,9 @@ error_if_srid_mismatch(int srid1, int srid2)
 int
 clamp_srid(int srid)
 {
-       if ( srid <= 0 ) return SRID_UNKNOWN;
+       if ( srid <= 0 && srid != SRID_UNKNOWN ) {
+               lwnotice("SRID value %d converted to the officially unknown SRID value %d", srid, SRID_UNKNOWN);
+               srid = SRID_UNKNOWN;
+       }
        return srid;
 }