diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-05-17 22:07:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-17 22:07:31 +0200 |
| commit | 0403980832dbaadad73e51da76ac0e71d37eec85 (patch) | |
| tree | 33459f7caba4fe3092857d1b4dd9a60c529ddf91 /src/apps | |
| parent | b349fa73847740950b2c5f5e6e1f5769ab594b44 (diff) | |
| parent | 95e877761865f073f4df7f52d9e97b899db92efd (diff) | |
| download | PROJ-0403980832dbaadad73e51da76ac0e71d37eec85.tar.gz PROJ-0403980832dbaadad73e51da76ac0e71d37eec85.zip | |
Merge pull request #2206 from rouault/deformation_model_for_merge
Add a +proj=defmodel transformation for multi-component time-based deformation models
Diffstat (limited to 'src/apps')
| -rw-r--r-- | src/apps/gie.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/apps/gie.cpp b/src/apps/gie.cpp index 6ce0ab18..8940afde 100644 --- a/src/apps/gie.cpp +++ b/src/apps/gie.cpp @@ -723,18 +723,27 @@ Attempt to interpret args as a PJ_COORD. /* This could be avoided if proj_dmstor used the same proj_strtod() */ /* as gie, but that is not the case (yet). When we remove projects.h */ /* from the public API we can change that. */ + + // Even Rouault: unsure about the above. Coordinates are not necessarily + // geographic coordinates, and the roundtrip through radians for + // big projected coordinates cause inaccuracies, that can cause + // test failures when testing points at edge of grids. + // For example 1501000.0 becomes 1501000.000000000233 double d = proj_strtod(prev, (char **) &endp); - double dms = PJ_TODEG(proj_dmstor (prev, (char **) &dmsendp)); - /* TODO: When projects.h is removed, call proj_dmstor() in all cases */ - if (d != dms && fabs(d) < fabs(dms) && fabs(dms) < fabs(d) + 1) { - d = dms; - endp = dmsendp; + if( *endp != '\0' && !isspace(*endp) ) + { + double dms = PJ_TODEG(proj_dmstor (prev, (char **) &dmsendp)); + /* TODO: When projects.h is removed, call proj_dmstor() in all cases */ + if (d != dms && fabs(d) < fabs(dms) && fabs(dms) < fabs(d) + 1) { + d = dms; + endp = dmsendp; + } + /* A number like -81d00'00.000 will be parsed correctly by both */ + /* proj_strtod and proj_dmstor but only the latter will return */ + /* the correct end-pointer. */ + if (d == dms && endp != dmsendp) + endp = dmsendp; } - /* A number like -81d00'00.000 will be parsed correctly by both */ - /* proj_strtod and proj_dmstor but only the latter will return */ - /* the correct end-pointer. */ - if (d == dms && endp != dmsendp) - endp = dmsendp; /* Break out if there were no more numerals */ if (prev==endp) |
