-
Notifications
You must be signed in to change notification settings - Fork 232
Support polygon-based subsetting in grdcut -F with GeoDataFrame #4124
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
Conversation
💖 Thanks for opening this pull request! 💖 Please make sure you read our contributing guidelines and abide by our code of conduct. A few things to keep in mind:
|
bb308c5
to
e4fbd13
Compare
e4fbd13
to
aa7d40a
Compare
Hey @kshitijaucharmal, great that you started working on this quite old issue! And the PR looks already quite promising 🙂.
If I understood the Hacktoberfest correctly it’s fine to have the PR merged between October 1 and October 31, and we have to add the corresponding label so that this PR is considered. |
Thanks for the suggestions @yvonnefroehlich ! The +c and +I options will need to be mentioned, I'll make sure to add that asap. And yeah the filename does contain a typo, don't know how I let it through, but will fix it right away! Regarding Hacktoberfest, this PR won't be counted anyway as the creation time of the PR matters not the merging time, so the label isn't required. Wasn't sure how it worked before, I'll remove the request from the PR description as well |
@kshitijaucharmal Thanks for your contribution. I noticed that you're pushing changes directly to your main branch. This is not a good practice and will definitely cause more troubles for you. Please create a separate branch next time. |
Yeah I should have created a new branch, I do accept the mistake on my part 😅 @yvonnefroehlich @seisman May I close this PR and reopen it when October starts as it's not going to be merged before then anyways? |
Well, I have no experience with this Hacktoberfest and how strict they are with the rules, but from my side, you can try this. |
Thanks! I think it'll be worth a try, so I'll take down this PR for now. |
Description of proposed changes
This PR enhances the pygmt.grdcut function to support polygon-based subsetting of grids using the -F option. Users can now provide polygons in three different formats:
Additionally, a gallery example has been added to demonstrate all three methods and how they produce the same cropped grid. This improves PyGMT’s functionality for extracting regions of interest from raster grids and makes the workflow more Pythonic and flexible.
Fixes #1529 (implements rather)
Preview:
Users can crop grids using polygons without manually creating ASCII files.
Example figure showing original grid and cropped grids using all three polygon input methods.
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.