Skip to content

Commit

Permalink
fix projection info for generic projection
Browse files Browse the repository at this point in the history
fixes #571

(cherry picked from commit ce2de49)
  • Loading branch information
lonvia authored and pnorman committed Apr 25, 2016
1 parent b9d089b commit 84335a0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions reprojection.cpp
Expand Up @@ -75,7 +75,8 @@ class generic_reprojection_t : public reprojection
{
public:
generic_reprojection_t(int srs)
: pj_target(srs), pj_source(PROJ_LATLONG), pj_tile("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs")
: m_target_srs(srs), pj_target(srs), pj_source(PROJ_LATLONG),
pj_tile("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs")
{}

osmium::geom::Coordinates reproject(osmium::Location loc) const override
Expand All @@ -94,10 +95,11 @@ class generic_reprojection_t : public reprojection
*lat = c.y;
}

int target_srs() const override { return PROJ_SPHERE_MERC; }
const char *target_desc() const override { return "Spherical Mercator"; }
int target_srs() const override { return m_target_srs; }
const char *target_desc() const override { return pj_get_def(pj_target.get(), 0); }

private:
int m_target_srs;
osmium::geom::CRS pj_target;
/** The projection of the source data. Always lat/lon (EPSG:4326). */
osmium::geom::CRS pj_source;
Expand Down

0 comments on commit 84335a0

Please sign in to comment.