diff --git a/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp b/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp index cf0d00cbe..efa4b06c5 100644 --- a/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp +++ b/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp @@ -201,11 +201,23 @@ void object::test<12>() ensure_equals(GEOSGeom_getCoordinateDimension(geom2_), 2); } +//-- test that a large gridsize works +template<> +template<> +void object::test<13>() +{ + geom1_ = fromWKT("LINESTRING (657035.913 6475590.114,657075.57 6475500)"); + geom2_ = GEOSGeom_setPrecision(geom1_, 100, 0); +//std::cout << toWKT(geom2_) << std::endl; + ensure_geometry_equals(geom2_, + "LINESTRING (657000 6475600, 657100 6475500)"); +} + // Test more exact rounding for integral scale factors // see https://trac.osgeo.org/postgis/ticket/5520 template<> template<> -void object::test<13>() +void object::test<14>() { geom1_ = fromWKT("LINESTRING (657035.913 6475590.114,657075.57 6475500)"); geom2_ = GEOSGeom_setPrecision(geom1_, .001, 0); @@ -214,17 +226,19 @@ void object::test<13>() "LINESTRING (657035.913 6475590.114, 657075.57 6475500)"); } -//-- test that a large gridsize works +// see https://trac.osgeo.org/postgis/ticket/5425 template<> template<> -void object::test<14>() +void object::test<15>() { - geom1_ = fromWKT("LINESTRING (657035.913 6475590.114,657075.57 6475500)"); - geom2_ = GEOSGeom_setPrecision(geom1_, 100, 0); + geom1_ = fromWKT("LINESTRING(674169.89 198051.38,674197.7 198065.55,674200.36 198052.38)"); + geom2_ = GEOSGeom_setPrecision(geom1_, .001, 0); //std::cout << toWKT(geom2_) << std::endl; ensure_geometry_equals(geom2_, - "LINESTRING (657000 6475600, 657100 6475500)"); + "LINESTRING (674169.89 198051.38, 674197.7 198065.55, 674200.36 198052.38)"); } + + } // namespace tut