projection - rename 'expanded' to 'definition' (PJ_PROJ_INFO) + add 'description' method

This commit is contained in:
Artem Pavlenko 2023-02-24 09:23:52 +00:00
parent ce073c64c7
commit 8efaa959f0
2 changed files with 18 additions and 3 deletions

View file

@ -77,7 +77,8 @@ class MAPNIK_DECL projection
std::string const& params() const;
void forward(double& x, double& y) const;
void inverse(double& x, double& y) const;
std::string expanded() const;
std::string definition() const;
std::string description() const;
void init_proj() const;
private:

View file

@ -196,13 +196,27 @@ projection::~projection()
#endif
}
std::string projection::expanded() const
std::string projection::description() const
{
#ifdef MAPNIK_USE_PROJ
if (proj_)
{
PJ_PROJ_INFO info = proj_pj_info(proj_);
return mapnik::util::trim_copy(info.definition);
if (std::strlen(info.description) > 0)
return mapnik::util::trim_copy(info.description);
}
#endif
return std::string("Undefined");
}
std::string projection::definition() const
{
#ifdef MAPNIK_USE_PROJ
if (proj_)
{
PJ_PROJ_INFO info = proj_pj_info(proj_);
if (std::strlen(info.definition) > 0)
return mapnik::util::trim_copy(info.definition);
}
#endif
return params_;