osrm-backend/test/t/geom/test_factory_with_projection.cpp
Patrick Niklaus 6eb4f090f9 Squashed 'third_party/libosmium/' content from commit ce865381f
git-subtree-dir: third_party/libosmium
git-subtree-split: ce865381fb752323ff1e66181f5a49b7f500ffa3
2017-08-30 09:30:27 +00:00

22 lines
726 B
C++

#include "catch.hpp"
#include <osmium/geom/mercator_projection.hpp>
#include <osmium/geom/projection.hpp>
#include <osmium/geom/wkb.hpp>
#include <osmium/geom/wkt.hpp>
TEST_CASE("Projection using MercatorProjection class to WKT") {
osmium::geom::WKTFactory<osmium::geom::MercatorProjection> factory{2};
const std::string wkt{factory.create_point(osmium::Location{3.2, 4.2})};
REQUIRE(wkt == "POINT(356222.37 467961.14)");
}
TEST_CASE("Projection using Projection class to WKT") {
osmium::geom::WKTFactory<osmium::geom::Projection> factory{osmium::geom::Projection{3857}, 2};
const std::string wkt{factory.create_point(osmium::Location{3.2, 4.2})};
REQUIRE(wkt == "POINT(356222.37 467961.14)");
}