1

I'm trying to access the Open Data Cube product (indexed Landsat-8) through the Jupyter notebook. Except for the name and description, all other product information such as instrument, format, CRS, resolution, etc is all None or NaN. But I had put that information in the dataset document file.

enter image description here

For this dataset, while I'm trying to execute the following code,

api = DataAccessApi(config = 'C:/Users/user/datacube.conf')
product = "LC08_L2SP"

# Get product extents
prod_extents = api.get_query_metadata(product=product)
latitude_extents = prod_extents['lat_extents']
print("Lat bounds:", latitude_extents)
longitude_extents = prod_extents['lon_extents']
print("Lon bounds:", longitude_extents)

I'm getting errors like,

    .........................
c:\users\user\datacube-1.8.3\datacube\api\core.py in output_geobox(like, output_crs, resolution, align, grid_spec, datasets, geopolygon, **query)
        660         # specification from grid_spec
        661         if grid_spec is None or grid_spec.crs is None:
    --> 662             raise ValueError("Product has no default CRS. Must specify 'output_crs' and 'resolution'")
        663         crs = grid_spec.crs
        664         if resolution is None:
    
    ValueError: Product has no default CRS. Must specify 'output_crs' and 'resolution'

I've done a local installation of Open Data Cube on Windows 8 and with PostgreSQL. Created the product definition file and dataset document file (File attached) as described in Datacube documentation.

  1. Product definition file
  2. Dataset document file
1

The product list shows information about a product, and a product doesn't require any of those fields, though you can set them and should in some cases.

This is an example product definition with a few fields set, like CRS.

Here's the top of the file:

name: gm_s2_annual
description: Surface Reflectance Annual Geometric Median and Median
  Absolute Deviations, Sentinel-2
metadata_type: eo3

license: CC-BY-4.0

metadata:
  product:
    name: gm_s2_annual

storage:
  crs: EPSG:6933
  resolution:
    x: 10
    y: -10
  tile_size:
    x: 96000.0
    y: 96000.0

measurements:

You haven't actually asked a question here, though, so I'm just assuming you're wondering why the fields are empty. And it's because you didn't add them to your product definition!

You can still load data, though, because the dataset documents will have information about each dataset.

EDIT: the answer to your error, which is:

ValueError: Product has no default CRS. Must specify 'output_crs' and 'resolution'

Is to either specify a CRS and resolution on your product (you do this when all datasets have the same CRS) or on your dc.load command.

I still don't understand your code. Have you looked at examples? Perhaps look through the frequently used code: https://docs.dea.ga.gov.au/notebooks/Frequently_used_code/README.html.

1
  • Sorry for the unclear question. As I've updated the question, I'm not able to load the data.
    – Badal
    Jul 28 '21 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.