-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for NADCON5 grids and transformation method #3510
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
fa97a9c
Add a +proj=gridshift (general grid shift) method to be used for NADC…
rouault 7888f3b
GTiff grid reading: speed-up retrieving data in last accessed tile
rouault b15909e
gridshift: add a +no_z_transform flag
rouault b55fd3c
Add NADCON5 transformation method support and database entries
rouault 526178d
metadata.sql: bump PROJ_DATA.VERSION to 1.13
rouault ce95d2e
Database: add concatenated operations for NADCON5 transformations
rouault 69cfda9
Add a GenericShiftGrid::valuesAt() method for faster value retrieval
rouault f29145c
gridshift: use GenericShiftGrid::valuesAt()
rouault 9c3f30f
pj_get_suggested_operation(): make sure to use NADCON5 grids rather t…
rouault c159d42
bench_proj_trans: add options to add random noise
rouault 4ca9950
gridshift: cache grid values when interpolating repeatedly in the sam…
rouault e732237
pj_get_suggested_operation(): tune so that NADCON5 grid is used for N…
rouault File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
.. _gridshift: | ||
|
||
================================================================================ | ||
General grid shift | ||
================================================================================ | ||
|
||
.. versionadded:: 9.2.0 | ||
|
||
Translation of geodetic coordinates using a grid shift. | ||
|
||
+-----------------+-------------------------------------------------------------------+ | ||
| **Alias** | gridshift | | ||
+-----------------+-------------------------------------------------------------------+ | ||
| **Domain** | 2D and 3D | | ||
+-----------------+-------------------------------------------------------------------+ | ||
| **Input type** | Geodetic coordinates (horizontal), meters (vertical) | | ||
+-----------------+-------------------------------------------------------------------+ | ||
| **Output type** | Geodetic coordinates (horizontal), meters (vertical) | | ||
+-----------------+-------------------------------------------------------------------+ | ||
|
||
The transformation may apply horizontal geodetic offsetting and/or vertical | ||
(ellipsoidal or orthometric height) offsetting, depending on the type of the | ||
grid(s). | ||
|
||
This is a generalization of the :ref:`hgridshift` and :ref:`vgridshift` methods, | ||
that may be used in particular for US NADCON5 grids that contain both horizontal | ||
geodetic and ellipsoidal height offsets. | ||
|
||
|
||
Example | ||
------------------------------------------------------------------------------- | ||
|
||
Transformation of a point from NAD83(NSRS2007) to NAD83(2011) on conterminous USA | ||
using a NADCON5 grid that contains horizontal and ellipsoidal height offsets. | ||
|
||
:: | ||
|
||
+proj=gridshift +grids=us_noaa_nadcon5_nad83_2007_nad83_2011_conus.tif | ||
|
||
Parameters | ||
################################################################################ | ||
|
||
Required | ||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
|
||
.. option:: +grids=<list> | ||
|
||
Comma-separated list of grids to load. If a grid is prefixed by an ``@`` the | ||
grid is considered optional and PROJ will the not complain if the grid is | ||
not available. | ||
|
||
Grids must be in GeoTIFF format (:ref:`geodetictiffgrids`) and have an | ||
explicit TYPE metadata item whose value is ``HORIZONTAL_OFFSET``, | ||
``GEOGRAPHIC_3D_OFFSET``, ``ELLIPSOIDAL_HEIGHT_OFFSET`` | ||
``VERTICAL_OFFSET_GEOGRAPHIC_TO_VERTICAL`` or ``VERTICAL_OFFSET_VERTICAL_TO_VERTICAL``. | ||
|
||
Optional | ||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
|
||
.. option:: +interpolation=bilinear/biquadratic | ||
|
||
Default is bilinear, unless the grid contains a ``interpolation_method`` | ||
metadata item specifying the method. | ||
Biquadratic is typically used for NADCON5 grids, and is defined in | ||
`NOAA Technical Memorandum NOS NGS 84 - Biquadratic Interpolation | ||
<https://geodesy.noaa.gov/library/pdfs/NOAA_TM_NOS_NGS_0084.pdf>`__ | ||
|
||
.. option:: +no_z_transform | ||
|
||
If specified, vertical coordinate transformation will be skipped. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What use-case is behind this addition? A similar thing could be done with pop and push
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use-case is for example NAD83 to NAD83(2011) for which elliposoidal height changes are not significant given that NAD83 is 2D-only officially and the grid for the transformation NAD83 to NAD83(HARN) has no ellipsoidal height offset. Hence it is useless to pay the price for the ellipsoidal height offset interpolation for the 3 next grids of the concatenated transformation.
Below performance with the pipeline output by "projinfo -s NAD83 -t NAD83(2011)" that will insert +no_z_transform where it makes sense
compared to using push/pop and letting z interpolation:
Juts seeing that the difference is no longer that big since I added various optimizations in grid caching & interpolation, but it was more significant at an earlier stage of developpement. For some grids like Alaska where there's a dedicated subgrid for the ellipsoidal height offset, skipping the Z interpolation saves I/O, which can speed up things in a remote grid use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect that NAD83(1986) does not have ellipsoidal or XYZ forms. I guess you are saying that once you have started with a 2D datum the point is to skip additional work and that the user has to treat the result as 2D only even though it is a value in a 3D CRS. Did I follow that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, taking into account the ellipsoidal height offsets of the HARN -> FBN -> NSRS2007 -> 2011 transformations when the starting point is 86 would give a false sense of accuracy given that the offset between 86 and HARN is probably much more bigger but nobody knows its value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. It makes a lot of sense to optimize performance!