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

Can we optimize zonal_statistics by spatially grouping polygon sets? #324

Open
emlys opened this issue Jun 6, 2023 · 0 comments
Open

Can we optimize zonal_statistics by spatially grouping polygon sets? #324

emlys opened this issue Jun 6, 2023 · 0 comments
Labels
question Further information is requested

Comments

@emlys
Copy link
Member

emlys commented Jun 6, 2023

The bulk of the runtime of zonal_statistics is taken up iterating through raster blocks:

for each raster:
    for each disjoint polygon set:
        for each block offset:
            calculate stats

Could we reduce the number of block offsets by only working on the area that's the intersection of the raster and each set of polygons? (Currently, we iterate through the area that's the intersection of the raster and all the polygons).

If so, the difference might be small, because each disjoint polygon set could be spread over the whole area. Would it help to use more, smaller, disjoint polygon sets that each have a smaller bounding box?

I'd need to do some testing to determine if this optimization would work.

@emlys emlys added the question Further information is requested label Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant