-
Notifications
You must be signed in to change notification settings - Fork 858
Add proj_trans_bounds_3D() #4394
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
Merged
Merged
Conversation
This file contains hidden or 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
8a6c085 to
51f6720
Compare
nyalldawson
reviewed
Feb 4, 2025
|
Thanks @rouault ! |
f1e0ef6 to
6158a7d
Compare
No functional change, just moving code around. 4D_api.cpp has become quite large and a set of 'random' things, that didn't correlate well with the '4D' naming. Some re-organization was needed. Create following files: - src/area.cpp: PJ_AREA related code - src/coordinates.cpp: functions related to coordinate manipulation - src/coord_operation.cpp: PJCoordOperation methods - src/create.cpp: pj_create_internal() related stuff - src/crs_to_crs.cpp: proj_create_crs_to_crs() and the like - src/dist.cpp: distance related functions - src/info.cpp: proj_info() and proj_pj_info() - src/trans.cpp: proj_trans(), proj_trans_array(), proj_trans_generic(), proj_roundtrip() - src/trans_bounds.cpp: proj_trans_bounds() Some other functions also moved to more relevant existing source files.
Fixes OSGeo#4392 ```c++ /** \brief Transform boundary, taking into account 3D coordinates. * * Transform boundary densifying the edges to account for nonlinear * transformations along these edges and extracting the outermost bounds. * * Note that the current implementation is not "perfect" when the source CRS is * geocentric, the target CRS is geographic, and the input bounding box * includes the center of the Earth, a pole or the antimeridian. In those * circumstances, exact values of the latitude of longitude of discontinuity * will not be returned. * * If one of the source or target CRS of the transformation is not 3D, the * values of *out_zmin / *out_zmax may not be significant. * * For 2D or "2.5D" transformation (that is planar component is * geographic/coordinates and 3D axis is elevation), the documentation of * proj_trans_bounds() applies. * * @param context The PJ_CONTEXT object. * @param P The PJ object representing the transformation. * @param direction The direction of the transformation. * @param xmin Minimum bounding coordinate of the first axis in source CRS * (target CRS if direction is inverse). * @param ymin Minimum bounding coordinate of the second axis in source CRS. * (target CRS if direction is inverse). * @param zmin Minimum bounding coordinate of the third axis in source CRS. * (target CRS if direction is inverse). * @param xmax Maximum bounding coordinate of the first axis in source CRS. * (target CRS if direction is inverse). * @param ymax Maximum bounding coordinate of the second axis in source CRS. * (target CRS if direction is inverse). * @param zmax Maximum bounding coordinate of the third axis in source CRS. * (target CRS if direction is inverse). * @param out_xmin Minimum bounding coordinate of the first axis in target CRS * (source CRS if direction is inverse). * @param out_ymin Minimum bounding coordinate of the second axis in target CRS. * (source CRS if direction is inverse). * @param out_zmin Minimum bounding coordinate of the third axis in target CRS. * (source CRS if direction is inverse). * @param out_xmax Maximum bounding coordinate of the first axis in target CRS. * (source CRS if direction is inverse). * @param out_ymax Maximum bounding coordinate of the second axis in target CRS. * (source CRS if direction is inverse). * @param out_zmax Maximum bounding coordinate of the third axis in target CRS. * (source CRS if direction is inverse). * @param densify_pts Recommended to use 21. This is the number of points * to use to densify the bounding polygon in the transformation. * @return an integer. 1 if successful. 0 if failures encountered. * @SInCE 9.6 */ ```
6158a7d to
99a8b73
Compare
|
Would there be any benefit to adding the time component? One idea I have was for this to behave like proj_trans and make z and t optional. Then, this would become the successor of proj_trans_bounds. |
I considered that for about 1000 ms, but failed to see the practical interest, so I preferred to keep things simpler. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
(on top of PR #4393; only last commit is specific to this PR)
Fixes #4392