Changeset 655 for trunk

Show
Ignore:
Timestamp:
02/20/08 07:44:34 (9 months ago)
Author:
artem
Message:

convert to degrees if projection is geographic

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/projection.cpp

    r632 r655  
    8383        x = p.u; 
    8484        y = p.v; 
     85        if (pj_is_latlong(proj_)) 
     86        { 
     87           x *=RAD_TO_DEG; 
     88           y *=RAD_TO_DEG; 
     89        }            
    8590    } 
    8691     
     
    9095       mutex::scoped_lock lock(mutex_); 
    9196#endif 
    92         projUV p; 
    93         p.u = x; 
    94         p.v = y; 
    95         p = pj_inv(p,proj_); 
    96         x = RAD_TO_DEG * p.u; 
    97         y = RAD_TO_DEG * p.v; 
     97       if (pj_is_latlong(proj_)) 
     98       { 
     99          x *=DEG_TO_RAD; 
     100          y *=DEG_TO_RAD; 
     101       }   
     102       projUV p; 
     103       p.u = x; 
     104       p.v = y; 
     105       p = pj_inv(p,proj_); 
     106       x = RAD_TO_DEG * p.u; 
     107       y = RAD_TO_DEG * p.v; 
    98108    } 
    99109