34 Proj(
const std::string &input,
const std::string &output) {
36 std::string input_with_crs(input);
37 if ((input.find(
"+proj") != std::string::npos or input.find(
"+init") != std::string::npos) and
38 input.find(
"+type=crs") == std::string::npos) {
39 input_with_crs +=
" +type=crs";
44 PJ *pj = proj_create_crs_to_crs(PJ_DEFAULT_CTX, input_with_crs.c_str(), output.c_str(), 0);
49 m_pj = proj_normalize_for_visualization(PJ_DEFAULT_CTX, pj);
55 if (
m_pj ==
nullptr) {
58 "Failed to initialize projection transformation '%s' to '%s' (errno: %d, %s).",
59 input_with_crs.c_str(), output.c_str(), proj_errno(0), proj_errno_string(proj_errno(0)));