[Proj] tmerc

support.mn at elisanet.fi support.mn at elisanet.fi
Wed Jun 18 17:35:18 EDT 2008

> 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.
> Is this a reasonable idea?  What longitude range would be suitable?
> Should we make this conditional on some extra parameter in the projeciton
> definition?  I have a ticket at:

Hello, some ideas:

The idea about the warning is ok, but let the library try as far as possible.

I think best would be to try to do what the projection says as far as possible,
since the distortion is part of the original "deal" (so not to return HUGE_VAL's,
but what ever it can do and then add maybe a warning somwhere that the
coordinates produced have more error than some predefined level allows).

The application could then start to limit the output or continue to generate
something based on the warning issued by some mechanism. But the
library should try as long as possible. There is no correct projection, since
every projection produces errors somewhere, there is no such plane
available that can represent a ball without any errors.

There are basicly 2 errors in coordinates:

1) Error compared to the ideal projection (more or less proj-4
     internal error). Library application programmers would hope
     this would be zero, But what I have understood it is not.

    double max_routine_error; // generate warning if greater than this

2) Error compared to the actual point and generated. This is what
     the end user is worried about. They tend to belive that it is
     possible to represent earth on a plane without any errors.

     double max_point_error; // generate warning if greater than this

There could also be more warnings about several other issues, such as
illegal projection parameters etc. Since users tend to try what ever and if
the library does not issue a warning they might belive they have it right.

Basicly the library should set a flag for warning and the application should
check this flag where wanted and then fetch the actal warning using some
kind of a standard mechanism. The error text should be predefined in the
library (in english) so that they could be shown to the user if wanted.

      int pj_check_warning();
      // returns none zero if warning triggered (= pj_error_number)

      char* pj_get_warning_text(int errno);
      // using previous error number return the text associated with it

Regards: Janne


More information about the Proj mailing list