[Proj] What is the expected Proj4 result when an input is out of range?

Mikael Rittri Mikael.Rittri at carmenta.com
Fri Feb 23 08:27:52 EST 2018


Hello, list.

I am confused about the result I get from the Proj4 inverse projection of Lambert Azimuthal Equal Area,
when the original projected input point is outside the valid circle.

I thought that in cases like these, the result point should have coordinates that are HUGE_VAL ,  that is, 1e+300.
There seems to be code in pj_inv.c that checks error conditions and sets coordinates to HUGE_VAL, but these
checks aren't triggered in my example.
Instead, my debugger says that I get a point with coordinates  -nan(ind).
I suppose that is an Indefinite NaN.  I am not too familiar with the various flavours of NaN, but it's certainly different from 1e+300.

Here is a concrete example that I have run in the console application, using Proj 4.9.3 and EPSG:3035 which is ETRS89 / LAEA Europe:

C:\> proj -I +init=epsg:3035
4321000 3210000
10dE    52dN
16350000 -1090000
-2147483648d-2147483648'-1.#IO"E        -2147483648d-2147483648'-1.#IO"N

I think I remember that invalid coordinates are usually written as asterisks by the console application.

Avoiding the default DMS formatting of the output, I get the following instead:

C:\>proj -I +init=epsg:3035 -f "%.5f"
4321000 3210000
10.00000        52.00000
16350000 -1090000
-1.#IND0        -1.#IND0

So my question is, is this a kind of bug in the implementation of inverse LAEA, or is it to be expected that invalid coordinates
can be represented by either HUGE_VAL or NaN depending on the projection?

Best regards,

Mikael Rittri
Carmenta
Sweden
http://www.carmenta.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/proj/attachments/20180223/62aa5364/attachment.htm 


More information about the Proj mailing list