don't project query point if host projection is geographic
This commit is contained in:
parent
4772a16eb6
commit
bb035bdc54
1 changed files with 8 additions and 3 deletions
11
src/map.cpp
11
src/map.cpp
|
@ -329,8 +329,13 @@ namespace mapnik
|
||||||
double x = lon;
|
double x = lon;
|
||||||
double y = lat;
|
double y = lat;
|
||||||
double z = 0;
|
double z = 0;
|
||||||
mapnik::projection dest(srs_);
|
mapnik::projection dest(srs_);
|
||||||
dest.forward(x,y);
|
|
||||||
|
if (!dest.is_geographic())
|
||||||
|
{
|
||||||
|
dest.forward(x,y);
|
||||||
|
}
|
||||||
|
|
||||||
mapnik::projection source(layer.srs());
|
mapnik::projection source(layer.srs());
|
||||||
proj_transform prj_trans(source,dest);
|
proj_transform prj_trans(source,dest);
|
||||||
prj_trans.backward(x,y,z);
|
prj_trans.backward(x,y,z);
|
||||||
|
@ -371,7 +376,7 @@ namespace mapnik
|
||||||
mapnik::Layer const& layer = layers_[index];
|
mapnik::Layer const& layer = layers_[index];
|
||||||
CoordTransform tr = view_transform();
|
CoordTransform tr = view_transform();
|
||||||
tr.backward(&x,&y);
|
tr.backward(&x,&y);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
mapnik::projection dest(srs_);
|
mapnik::projection dest(srs_);
|
||||||
|
|
Loading…
Add table
Reference in a new issue