diff --git a/test/unit/projection/proj_transform.cpp b/test/unit/projection/proj_transform.cpp index 5fc30459b..31fc2f1ea 100644 --- a/test/unit/projection/proj_transform.cpp +++ b/test/unit/projection/proj_transform.cpp @@ -128,9 +128,20 @@ SECTION("Test proj antimeridian bbox") mapnik::proj_transform prj_trans_fwd(prj_proj, prj_geog); mapnik::proj_transform prj_trans_rev(prj_geog, prj_proj); - // bad = mapnik.Box2d(-177.31453250437079, -62.33374815225163, 178.02778363316355, -24.584597490955804) - const mapnik::box2d better(-180.0, -62.33374815225163, - 180.0, -24.584597490955804); + // reference values taken from proj4 command line tool: + // (non-corner points assume PROJ_ENVELOPE_POINTS == 20) + // + // cs2cs -Ef %.10f +init=epsg:2193 +to +init=epsg:4326 < better(-180.0, -62.3337481525, + 180.0, -24.5845974912); { mapnik::box2d ext(274000, 3087000, 3327000, 7173000); @@ -151,18 +162,17 @@ SECTION("Test proj antimeridian bbox") CHECK(ext.maxy() == Approx(better.maxy())); } - { - // checks for not being snapped (ie. not antimeridian) - mapnik::box2d ext(274000, 3087000, 3327000, 7173000); - prj_trans_rev.backward(ext, PROJ_ENVELOPE_POINTS); - CHECK(ext.minx() == Approx(better.minx())); - CHECK(ext.miny() == Approx(better.miny())); - CHECK(ext.maxx() == Approx(better.maxx())); - CHECK(ext.maxy() == Approx(better.maxy())); - } - - const mapnik::box2d normal(148.766759749, -60.1222810238, - 159.95484893, -24.9774643167); + // reference values taken from proj4 command line tool: + // + // cs2cs -Ef %.10f +init=epsg:2193 +to +init=epsg:4326 < normal(148.7667597489, -60.1222810241, + 159.9548489296, -24.9771195155); { // checks for not being snapped (ie. not antimeridian)