fix typo (map_ext.intersects(map_ext) -> map_ext.intersects(layer_ext)) and add small optimization so that if projections are equal we don't check intersection twice before returning no hit
This commit is contained in:
parent
572da8766f
commit
c5c729b17c
1 changed files with 11 additions and 6 deletions
|
@ -231,11 +231,16 @@ private:
|
|||
|
||||
// first, try to forward project map ext into layer srs
|
||||
if (prj_trans.forward(map_ext) && map_ext.intersects(layer_ext))
|
||||
{
|
||||
{
|
||||
layer_ext.clip(map_ext);
|
||||
}
|
||||
// if no intersection and projections are also equal, early return
|
||||
else if (prj_trans.equal())
|
||||
{
|
||||
return;
|
||||
}
|
||||
// fallback to back projecting layer into map srs
|
||||
else if (prj_trans.backward(layer_ext) && map_ext.intersects(map_ext))
|
||||
else if (prj_trans.backward(layer_ext) && map_ext.intersects(layer_ext))
|
||||
{
|
||||
layer_ext.clip(map_ext);
|
||||
// forward project layer extent back into native projection
|
||||
|
|
Loading…
Reference in a new issue