Skip to content

Commit

Permalink
+ applied mapnik-skip-projection-if-equal.patch (jonb)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemp committed Dec 7, 2008
1 parent a3e81dd commit 65ea5bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/mapnik/proj_transform.hpp
Expand Up @@ -46,6 +46,7 @@ namespace mapnik {
projection const& dest_;
bool is_source_latlong_;
bool is_dest_latlong_;
bool is_source_equal_dest;
};
}

Expand Down
6 changes: 6 additions & 0 deletions src/proj_transform.cpp
Expand Up @@ -40,13 +40,17 @@ namespace mapnik {
#endif
is_source_latlong_ = pj_is_latlong(source_.proj_);
is_dest_latlong_ = pj_is_latlong(dest_.proj_);
is_source_equal_dest = (source_ == dest_);
}

bool proj_transform::forward (double & x, double & y , double & z) const
{
#ifdef MAPNIK_THREADSAFE
mutex::scoped_lock lock(projection::mutex_);
#endif
if (is_source_equal_dest)
return true;

if (is_source_latlong_)
{
x *= DEG_TO_RAD;
Expand All @@ -73,6 +77,8 @@ namespace mapnik {
#ifdef MAPNIK_THREADSAFE
mutex::scoped_lock lock(projection::mutex_);
#endif
if (is_source_equal_dest)
return true;

if (is_dest_latlong_)
{
Expand Down

0 comments on commit 65ea5bc

Please sign in to comment.