-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 a gdal::GCP class to make GCP handling from C++ easier #9285
Merged
Conversation
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
rouault
force-pushed
the
gcp_cppification
branch
2 times, most recently
from
February 22, 2024 21:52
13c03f3
to
84f0c44
Compare
@elpaso any opinion on this? |
Good work! |
rouault
force-pushed
the
gcp_cppification
branch
from
February 26, 2024 16:07
84f0c44
to
337cc4f
Compare
rouault
changed the title
[WIP] Add a gdal::GCP class to make GCP handling from C++ easier
Add a gdal::GCP class to make GCP handling from C++ easier
Feb 26, 2024
rouault
force-pushed
the
gcp_cppification
branch
from
February 26, 2024 17:04
337cc4f
to
7b4cc89
Compare
rouault
force-pushed
the
gcp_cppification
branch
from
February 26, 2024 21:17
7b4cc89
to
1e7aed6
Compare
This is ready for review |
6 tasks
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.
GDAL_GCP is a C-only structure. The typical/recommended pattern to create GCPs from C is:
This is "fine" for a C user, but quite tedious in a C++ context. Big users of creating GCPs are GDAL drivers themselves.
So we introduce a gdal::GCP class that has a single GDAL_GCP private member, and handle memory allocation/deallocation, with helpers to navigate between the C and C++ worlds.
No attempt has been made (yet?) to modify the C++ API, in particularly the GDALDataset::GetGCPCount(), GetGCPs(), SetGCPs() method. I guess we'd need to keep the existing methods to avoid breaking external code, as wrappers over new methods that would return / accept
std::vector<gdal::GCP>
(This is an alternative to the messy earlier attempt of #9191)
@dg0yt @dbaston thoughts?