Skip to content
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

Improvements gdf to da #290

Merged
merged 9 commits into from
Nov 17, 2023
Merged

Improvements gdf to da #290

merged 9 commits into from
Nov 17, 2023

Conversation

bdestombe
Copy link
Collaborator

Improvements to intersecting shapes to grid functions.

The buffer argument I would like to use for identifying transition zones between two layer_models.

Introduced a new function that counts in how many shapes a cell is present. Basically all the code was already there

The buffer argument I would like to use for identifying transition zones between two layer_models.

Introduced a new function that counts in how many shapes a cell is present. Basically all the code was already there
@bdestombe bdestombe changed the base branch from main to dev November 14, 2023 17:23
@bdestombe
Copy link
Collaborator Author

bdestombe commented Nov 14, 2023

Is there a flopy function to leave out parts of a vertex modelgrid? I would like to try it to see if it would speed up gdf_to_da

@dbrakenhoff
Copy link
Collaborator

Is there a flopy function to leave out parts of a vertex modelgrid? I would like to try it to see if it would speed up gdf_to_da

I'm not aware of any such functionality, though it should be fairly easy to use gridintersect to create a subset of geometries based on an intersection result. Recreating a model grid from that object would be a bit difficult though. But since you need to build the intersection geometries for that step anyway, I doubt it will speed things up much leaving them out of the next intersection calculations? The shapely intersection routines should be able to query the relevant parts of the grid relatively quickly, I think?

@bdestombe bdestombe marked this pull request as ready for review November 16, 2023 12:16
@bdestombe
Copy link
Collaborator Author

bdestombe commented Nov 16, 2023

The PR currently contains all the improvents I was looking for. According to codacy there is a space too many. However, the tests stopped passing after PR #803, so passing that that seems out of the scope for this PR.

In a future PR it would be interesting to also vectorize the "aggregate values based on nearest to cell node"-function, and other aggregation functions.

@rubencalje
Copy link
Collaborator

rubencalje commented Nov 16, 2023

Nice! I have fixed the failing test in pull request #289, so I think this is ok to merge. We should add some test for gdf_to_da, gdf_to_bool_da and the other methods in grid.py...

@bdestombe
Copy link
Collaborator Author

Is there a flopy function to leave out parts of a vertex modelgrid? I would like to try it to see if it would speed up gdf_to_da

I'm not aware of any such functionality, though it should be fairly easy to use gridintersect to create a subset of geometries based on an intersection result. Recreating a model grid from that object would be a bit difficult though. But since you need to build the intersection geometries for that step anyway, I doubt it will speed things up much leaving them out of the next intersection calculations? The shapely intersection routines should be able to query the relevant parts of the grid relatively quickly, I think?

Perfect, thank you so much for your response. I'll leave it at that then.

@bdestombe bdestombe merged commit 6a6cf75 into dev Nov 17, 2023
2 of 3 checks passed
@bdestombe bdestombe deleted the improvements-gdf-to-da branch November 17, 2023 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants