-
Notifications
You must be signed in to change notification settings - Fork 8
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
Allow single point queries with Opendatacube #20
Comments
Related: #14 |
feat: Intersection method in rasterize based on geometry type (#20) 🎁
Unfortunately, #21 changed the loading behaviour of the geometries but did not solve the problem with point-based queries. |
Source of the problem found by @whisperingpixel, thanks! It turns out that deep in the OpenDataCube code there is the assumption of a regular grid and the cell spacing of the first two cells is used to calculate the resolution for the entire grid. Obviously, this is not possible for an AOI consisting of a single point (since the grid only has a single cell in that case). There is the option to hand over a fallback_resolution. We need to set a reasonable default here, e.g. 1. Since this is only used in the case of a point it will be a single pixel anyways corresponding on the pixel size. However, setting this hard-coded could lead to unwanted effects later. We need further testing and understanding what the effect of different sizes is. @whisperingpixel just to confirm, this is not an issue when the AOI consists of multiple points, right? In that case the grid should be regular (except when the points are so close to each other they all fall in the same cell). |
@luukvdmeer - Thanks! Yes, I confirm: If there are two or more points it works. |
@whisperingpixel This should work now, as the spatial resolution is now always stored in the arrays in the way ODC expects it. This means the "fallback resolution" is equal to the resolution the user defined when executing the query. Unfortunately I cannot test good if it works since I don't have a working ODC example. So we should confirm this after updating on the workstation. |
@whisperingpixel Just as a reminder, we should confirm this on the workstation/server whenever the latest semantique version is installed (no urgency from my side of course ;) |
Of course! @augustinh22 is currently setting this up for testing. |
Description
Currently, the intersection of the feature geometries with the pixels are based on the centroids. This is okay and best for Polygons but points are not loaded at all and for lines the centroid points need to be hit like here:
Only polygons can be currently used.
The make_geocube function (
semantique/semantique/extent.py
Lines 184 to 189 in 2244625
There are three situations:
Use centroid intersection (all_touch = false)
Use touch (all_touch = true)
This is a bit difficult. The perfect solution would be to use centroid intersection for polygons, otherwise touch (e.g. splitting the collection and merging the raster results). However, we need this feature rather soon (for points), therefore the acceptable solution would be to use centroid intersection in this case as well.
Additional context
The text was updated successfully, but these errors were encountered: