[Proj] tmerc "folding back" far from the central meridian

Frank Warmerdam warmerdam at pobox.com
Tue Jun 17 21:14:10 EDT 2008


Gerald I. Evenden wrote:
> On Tuesday 17 June 2008 12:45 pm, Frank Warmerdam wrote:
>> Folks (mostly Gerald),
>>
>> The tmerc projection has a tendency to fold back on itself when you get
>> really far from the central meridian.  This causes problems when
>> applications naively try to reproject locations from all around the world
>> into transverse mercator without regard to appropriateness.
>>
>> What I would like is if we could make the tmerc projection fail (ie return
>> HUGE_VAL) for points so far from the central meridian that they are likely
>> to start folding back on themselves.
> 
> etmerc has one limit level which is only a few degrees from del-lambda=90.  
> The original code had several "levels" of error of with different return 
> codes but because there was not anyway to do this multilevel return in 
> libproj4 I just used the one at the furthest extent.

Gerald,

I'm not sure what you mean above.  I looked through the code for transverse
mercator in PROJ.4, and libproj4 and I don't observe any obvious limit
logic on lam or y.

> But the method of establishing a limit would appear to be done on the basis of 
> Easting rather than a cutoff due to a lat-lon limit check.  Perhaps do the 
> calculation regarless of geographic coordinates and then reject based upon 
> easting greater than a percentage of a or R or, of course, equation failure.

I can understand this, but the problem is that the lon/lat to
projected conversion is giving a plausible location near the
central meridian in TM projected coordinates even though the
lon/lat location was very very far from the central meridian.
So I don't see how checking the easting after reprojection is
going to be sufficient.

See:
   http://trac.osgeo.org/proj/ticket/5

> On inverse projection just reject if |easting| too large.
 >
> Allow an override option for those who want to play around.  ;-)

I have taken the liberty of adding you as a cc: on the ticket.
If you are interested in adding notes in the ticket, you would need
to create an OSGeo login at:

   https://www.osgeo.org/cgi-bin/ldap_create_user.py

and then login using that.

I'm going to do a preliminary hack, but I'm hoping you will
consider applying a more generalized/good solution upstream in
libproj4.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the Proj mailing list