| Age | Commit message (Collapse) | Author |
|
|
|
when it returns invalid coordinate
|
|
Fixes #2482
And also add proj_context_errno_string()
Revise gie 'expect failure errno XXXX' strings
|
|
The restriction was a copy&paste from the Evenden/Snyder approximate
ellipsoidal implementation, but the spherical one is exact, so this
restriction isn't needed.
Also tune a bit the handling of lat=0, |lon| > 90
|
|
(fixes #2468)
Corrected formula given by @evanmiller
|
|
Gone are pj_malloc, pj_calloc, pj_dalloc and pj_dealloc. Their primary
function as API memory functions in proj_api.h is no longer there and
the other use as a workaround for old errno problems is no longer valid
either.
Replaced with malloc and free across the codebase.
|
|
|
|
P->n
|
|
Fixes #2326
Partially reverts commit b84c9d0cb61f3bd561da6092e15e294ae7e410e0 to
remove the use of the gcc 6 mechanism of generated multiple versions of
functions with different optimization flags, which was found to causes
crashes when dlopen'ing PROJ on CentOS 7.8 with gcc 8.3.1
|
|
|
|
|
|
tmerc/utm: add a +algo=auto/evenden_snyder/poder_engsager parameter
|
|
The default remains +alg=poder_engsager.
This default value can be changed in proj.ini
+algo=auto will use Evenden Synder implementation if the error in
doing so remains below 0.1 mm on Earth-sized ellipsoid
|
|
Saves a useless sqrt() call
|
|
__attribute__((target_clones("fma","default"))) doesn't work for some reason
|
|
duplication
|
|
Approximate tmerc (Snyder): speed optimizations
|
|
Extended tmerc (Poder/Engsager): speed optimizations
|
|
ENOMEM was wrongly set after setting PJD_ERR_ELLIPSOID_USE_REQUIRED
Note: it is a bit strange to forbid the pure spherical case whereas the
maths would allow it. I presume this is due to the typical usage of those
methods.
|
|
fwd: 7% faster on Core-i7@2.6GHz (with FMA triggered), 22% faster on GCE Xeon@2GHz (with FMA)
inv: 31% faster on Core-i7@2.6GHz (with FMA triggered), 60% faster on GCE Xeon@2GHz (with FMA)
The optimizations consists in different things:
- optionaly use the FMA (Fused Multiply Addition) instruction set with gcc >= 6.
Binaries are generated with the standard instruction set (SSE/SSE2),
and with one variant with FMA, and the appropriate version is selected automatically
at runtime. This gives a modest speedup, but measurable. The speedup is more
obvious on lower clocked CPU.
- inline mlfn and inv_mlfn
- for inv_mlfn avoid recomputation of sin()/cos() at each iteration stage,
by observing that the argument changes in modest way at each iteration,
and using approximation of sin()/cos(). The differences due to that approximation
are way below the 1e-11 tolerance threshold.
Different in results are neglectable (only found in areas where the approximations
of the Snyder formulas are already no longer valid)
Before:
$ echo 8e5 9e6 | src/proj -d 12 +proj=utm +zone=31 -I +approx | src/proj -d 12 +proj=utm +zone=31 +approx
799997.896522093331 8999999.520601103082
$ echo 8e5 5e6 | src/proj -d 12 +proj=utm +zone=31 -I +approx | src/proj -d 12 +proj=utm +zone=31 +approx
800000.000007762224 4999999.999971268699
$ echo 18e5 9e6 | src/proj -d 12 +proj=utm +zone=31 -I +approx | src/proj -d 12 +proj=utm +zone=31 +approx
1079182.990696100984 8661150.574729491025
$ echo 18e5 5e6 | src/proj -d 12 +proj=utm +zone=31 -I +approx | src/proj -d 12 +proj=utm +zone=31 +approx
1799997.510861013783 4999999.567328464240
After:
$ echo 8e5 9e6 | src/proj -d 12 +proj=utm +zone=31 -I +approx | src/proj -d 12 +proj=utm +zone=31 +approx
799997.896522093331 8999999.520601103082
$ echo 8e5 5e6 | src/proj -d 12 +proj=utm +zone=31 -I +approx | src/proj -d 12 +proj=utm +zone=31 +approx
800000.000007762224 4999999.999971268699
$ echo 18e5 9e6 | src/proj -d 12 +proj=utm +zone=31 -I +approx | src/proj -d 12 +proj=utm +zone=31 +approx
1079182.990696124267 8661150.574729502201
$ echo 18e5 5e6 | src/proj -d 12 +proj=utm +zone=31 -I +approx | src/proj -d 12 +proj=utm +zone=31 +approx
1799997.510861013783 4999999.567328464240
|
|
fwd: 52% faster on Core-i7@2.6GHz, 40% faster on GCE Xeon@2GHz
inv: 24% faster on Core-i7@2.6GHz, 36% faster on GCE Xeon@2GHz
Those speed-ups are obtained due to elimination of a number of
transcendental functions (atan, sincos, cosh, sinh), through the
use of usual trigonometric/hyperbolic formulas.
The numeric results before/after seem identical at worse up to
14 decimal digits, which is way beyond the apparent accuracy of the
computations
On a point, far from central meridian, where round-tripping is not so great:
Before:
echo "81 1" | src/proj -d 18 +proj=utm +zone=31 | src/proj -d 18 -I +proj=utm +zone=31
80.999994286593448578 0.999987970918421620
After:
$ echo "81 1" | src/proj -d 18 +proj=utm +zone=31 | src/proj -d 18 -I +proj=utm +zone=31
80.999994286593448578 0.999987970918422175
The benchmarking program used is:
```
#include "proj.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char* argv[])
{
if( argc != 3 ) {
fprintf(stderr, "Usage: bench quoted_proj_string fwd/inv\n");
exit(1);
}
PJ* p = proj_create(0, argv[1]);
const int dir = strcmp(argv[2], "inv") == 0 ? PJ_INV : PJ_FWD;
PJ_COORD coord;
if( dir == PJ_FWD )
{
coord.xy.x = 0.5; // rad
coord.xy.y = 0.5; // rad
}
else
{
coord.xy.x = 450000; // m
coord.xy.y = 5000000; // m
}
for(int i = 0; i < 40 * 1000* 1000; i++)
proj_trans(p, dir, coord);
proj_destroy(p);
return 0;
}
```
|
|
per line
Should hopefully result in no change in results, and hopefully more
readable code...
|
|
needs <limits.h>. Update scripts/reference_exported_symbols.txt and
src/proj_symbol_rename.h.
|
|
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13893
Credit to OSS Fuzz
|
|
* Make tmerc an alias for etmerc
This switches the algorithm used in tmerc to the Poder/Engsager
tmerc algorithm. The original tmerc algorithm of Evenden/Snyder
origin can still be accessed by adding the +approx flag when
initializing a tmerc projection. The +approx flag can also
be used when initializing UTM projections, in which case the
Evenden/Snyder algorithm is used as well.
If a tmerc projection is instantiated on a spherical earth
the Evenden/Snyder algorithm is used as well since the
Poder/Engsager algorithm is only defined on the ellipsoid.
+proj=etmerc can still be instantiated for backwards compatibility
reasons.
Co-authored-by: Kristian Evers <kristianevers@gmail.com>
Co-authored-by: Even Rouault <even.rouault@spatialys.com>
|
|
|
|
structures
|
|
|