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

implement polygon query #10

Merged
merged 31 commits into from
Feb 28, 2023
Merged

implement polygon query #10

merged 31 commits into from
Feb 28, 2023

Conversation

rogerkuou
Copy link
Member

@rogerkuou rogerkuou commented Jan 31, 2023

Implement polygon enrichment and polygon subset.

@rogerkuou rogerkuou changed the title rename stmat to stm implement polygon query Jan 31, 2023
@rogerkuou rogerkuou marked this pull request as ready for review February 15, 2023 17:01
@rogerkuou
Copy link
Member Author

Hi @meiertgrootes. I implemented the polygon query in this branch. Could you please review it?

You can use this notebook to test.

Your example notebook has been moved here.

@rogerkuou
Copy link
Member Author

@meiertgrootes I have updated this PR with new example notebooks, on both local and Spider. Thanks for the reviewing!

Copy link

@meiertgrootes meiertgrootes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to merge to me. I do have a number of comments, however. These are more about some possible refactoring and expansion than any blocking issues. Please consider converting some into issues so we can pick them up later while still adding the basic functionality to the main branch now

(max(self._obj[kwargs["y"]]) - min(self._obj[kwargs["y"]]))
/ kwargs["dy"]
)
raster = features.rasterize(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A possible draw back is having to create ever finer rasters for higher desired densities, as well as the need for possibly non-intuuitive cell sizes.

E.g: select at density 1/m^2 -> grid of dx = dy = 1m
how to select at e.g 5/m^2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for the heads up Meiert! For this function, the application is only for select points to make a network, and there should not be too short arcs within the network. Then I think the requirement is to ensure there is no second point within a specific range. Therefore I think the current implementation is fine.

stm/stm.py Show resolved Hide resolved
stm/stm.py Show resolved Hide resolved
@rogerkuou
Copy link
Member Author

Thx @meiertgrootes for the feedback! I agree with almost all of them. I converted most of your comments to issues. Also added in-line documentation for density subsetting.

Just one thought on the density implementation.

Will merge it for now

@rogerkuou rogerkuou merged commit 3672fb0 into main Feb 28, 2023
@rogerkuou rogerkuou deleted the 3_query_from_polygon branch July 27, 2023 13:52
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.

None yet

2 participants