]> granicus.if.org Git - postgis/commitdiff
#1292 commit patch ST_SnapToGrid returns a value of of range
authorRegina Obe <lr@pcorp.us>
Fri, 3 May 2013 05:54:48 +0000 (05:54 +0000)
committerRegina Obe <lr@pcorp.us>
Fri, 3 May 2013 05:54:48 +0000 (05:54 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11345 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/geography_inout.c
regress/tickets.sql
regress/tickets_expected

index f77deab4e545b4005de041739aaf4c91c731b995..bd4441d547167655e980de511f70b2dad3b9ec8f 100644 (file)
@@ -83,7 +83,8 @@ GSERIALIZED* gserialized_geography_from_lwgeom(LWGEOM *lwgeom, int32 geog_typmod
        geography_valid_type(lwgeom->type);
 
        /* Force the geometry to have valid geodetic coordinate range. */
-       if ( ! lwgeom_nudge_geodetic(lwgeom) && lwgeom_force_geodetic(lwgeom) == LW_TRUE )
+       lwgeom_nudge_geodetic(lwgeom);
+       if ( lwgeom_force_geodetic(lwgeom) == LW_TRUE )
        {
                ereport(NOTICE, (
                        errmsg_internal("Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY" ))
@@ -584,7 +585,8 @@ Datum geography_from_geometry(PG_FUNCTION_ARGS)
        srid_is_latlong(fcinfo, lwgeom->srid);
 
        /* Force the geometry to have valid geodetic coordinate range. */
-       if ( ! lwgeom_nudge_geodetic(lwgeom) && lwgeom_force_geodetic(lwgeom) == LW_TRUE )
+       lwgeom_nudge_geodetic(lwgeom);
+       if ( lwgeom_force_geodetic(lwgeom) == LW_TRUE )
        {
                ereport(NOTICE, (
                        errmsg_internal("Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY" ))
index cbe197eed4bf6523619dbd8c75a0673eefeb21b1..ed7d4a37ab5ed507bbbf329cddd91aa8c3a04453 100644 (file)
@@ -479,6 +479,10 @@ SELECT '#1292', ST_AsText(ST_SnapToGrid(ST_GeomFromText(
        'GEOMETRYCOLLECTION(POINT(180 90),POLYGON((140 50,150 50,180 50,140 50),(140 60,150 60,180 60,140 60)))'
        , 4326), 0.00001)::geography);
 
+-- #1292.1
+SELECT '#1292.1', ST_AsText(ST_GeomFromText('POINT(180.00000000001 95)')::geography),
+       ST_AsText(ST_GeomFromText('POINT(185 90.00000000001)')::geography);
+
 -- #1320
 SELECT '<#1320>';
 CREATE TABLE A ( geom geometry(MultiPolygon, 4326),
index 91bda2781cc0f7215ec8914118e3b34754dd2f7d..d2579fcd29425213f6b95b0da398aef6f6ca965b 100644 (file)
@@ -151,6 +151,9 @@ ERROR:  stats for "t.g" do not exist
 #877.4|-10.15000|20.15000|-50.40000|30.40000
 #877.5|-10.15000|20.15000|-50.40000|30.40000
 #1292|GEOMETRYCOLLECTION(POINT(180 90),POLYGON((140 50,150 50,180 50,140 50),(140 60,150 60,180 60,140 60)))
+NOTICE:  Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY
+NOTICE:  Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRAPHY
+#1292.1|POINT(180 85)|POINT(-175 90)
 <#1320>
 #1320.geog.1|MULTIPOLYGON|4326
 #1320.geom.1|MULTIPOLYGON|4326