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

Indexing a dataset doesn't result in a record in the spatial index. Updating the spatial index does. #9

Open
alexgleith opened this issue Sep 3, 2024 · 2 comments

Comments

@alexgleith
Copy link
Contributor

Set up datacube:

datacube system init
datacube product add https://raw.githubusercontent.com/digitalearthpacific/pacific-cube-in-a-box/main/products/dep_s2_geomad.odc-product.yaml
datacube spindex create 3832

Index one document:

stac-to-dc \
                --catalog-href='https://stac.staging.digitalearthpacific.org' \
                --bbox='179.99,-17.5,180.0,-17.49' \
                --datetime='2023' \
                --collections='dep_s2_geomad' \
                --update-if-exists

Check postgres:

SELECT * from odc.spatial_3832;

no rows

Run datacube spindex update 3832

1 extents checked and updated in 1 spatial indexes

@Ariana-B
Copy link

Ariana-B commented Sep 9, 2024

The following warning raised by antimeridian.fix_shape for this dataset seems to yield some insight:

FixWindingWarning: The exterior ring of this shape is wound clockwise. Since this is a common error in real-world geometries, this package is reversing the exterior coordinates of the input shape before running its algorithm. If you know that your input shape is correct (i.e. if your data encompasses both poles), pass fix_winding=False.

Subsequently, crs.valid_region.intersects(geo_extent) is False, so no dataset spatial values can be generated and the spatial index entry doesn't get updated. With fix_winding=True, an intersection is found.

@alexgleith
Copy link
Contributor Author

With fix_winding=True, an intersection is found.

Does this mean there are two different code paths between indexing and updating?

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

No branches or pull requests

2 participants