0

I've added Landsat 8 collection 2 level-2 dataset to Open Data Cube. While trying to access the dataset through the Jupyter Notebook with the following code,

ds2 = dc.load(product='LC08_L2SP_T1',
        longitude=(83.95406, 86.18206),
        latitude=(19.15230, 21.29480),
        output_crs='EPSG:32645',
        resolution=(-30, 30))
print(ds2)

I'm getting the following error.

 IllegalArgumentException: CGAlgorithmsDD::orientationIndex encountered NaN/Inf numbers
---------------------------------------------------------------------------
PredicateError                            Traceback (most recent call last)
~\miniconda3\envs\cubeenv2\lib\site-packages\shapely\predicates.py in __call__(self, this, other, *args)
     14         try:
---> 15             return self.fn(this._geom, other._geom, *args)
     16         except PredicateError as err:

~\miniconda3\envs\cubeenv2\lib\site-packages\shapely\geos.py in errcheck_predicate(result, func, argtuple)
    583     if result == 2:
--> 584         raise PredicateError("Failed to evaluate %s" % repr(func))
    585     return result

PredicateError: Failed to evaluate <_FuncPtr object at 0x000000F145F88A08>

During handling of the above exception, another exception occurred:

TopologicalError                          Traceback (most recent call last)
<ipython-input-6-d359eaacd2e8> in <module>
      3         latitude=(19.15230, 21.29480),
      4         output_crs='EPSG:32645',
----> 5         resolution=(-30, 30))
      6 print(ds2)

~\miniconda3\envs\cubeenv2\lib\site-packages\datacube\api\core.py in load(self, product, measurements, output_crs, resolution, resampling, skip_broken_datasets, dask_chunks, like, fuse_func, align, datasets, progress_cbk, **query)
    290 
    291         if datasets is None:
--> 292             datasets = self.find_datasets(product=product, like=like, ensure_location=True, **query)
    293         elif isinstance(datasets, collections.abc.Iterator):
    294             datasets = list(datasets)

~\miniconda3\envs\cubeenv2\lib\site-packages\datacube\api\core.py in find_datasets(self, **search_terms)
    329         .. seealso:: :meth:`group_datasets` :meth:`load_data` :meth:`find_datasets_lazy`
    330         """
--> 331         return list(self.find_datasets_lazy(**search_terms))
    332 
    333     def find_datasets_lazy(self, limit=None, ensure_location=False, **kwargs):

~\miniconda3\envs\cubeenv2\lib\site-packages\datacube\api\core.py in <genexpr>(.0)
    354 
    355         if ensure_location:
--> 356             datasets = (dataset for dataset in datasets if dataset.uris)
    357 
    358         return datasets

~\miniconda3\envs\cubeenv2\lib\site-packages\datacube\api\core.py in select_datasets_inside_polygon(datasets, polygon)
    682     query_crs = polygon.crs
    683     for dataset in datasets:
--> 684         if intersects(polygon, dataset.extent.to_crs(query_crs)):
    685             yield dataset
    686 

~\miniconda3\envs\cubeenv2\lib\site-packages\datacube\utils\geometry\_base.py in intersects(a, b)
   1270     """ Returns True if geometries intersect, else False
   1271     """
-> 1272     return a.intersects(b) and not a.touches(b)
   1273 
   1274 

~\miniconda3\envs\cubeenv2\lib\site-packages\datacube\utils\geometry\_base.py in wrapped(*args)
    361                 raise CRSMismatchError((first.crs, arg.crs))
    362 
--> 363         result = method(*[arg.geom for arg in args])
    364         if isinstance(result, base.BaseGeometry):
    365             return Geometry(result, first.crs)

~\miniconda3\envs\cubeenv2\lib\site-packages\datacube\utils\geometry\_base.py in touches(self, other)
    467     @wrap_shapely
    468     def touches(self, other: 'Geometry') -> bool:
--> 469         return self.touches(other)
    470 
    471     @wrap_shapely

~\miniconda3\envs\cubeenv2\lib\site-packages\shapely\geometry\base.py in touches(self, other)
    773     def touches(self, other):
    774         """Returns True if geometries touch, else False"""
--> 775         return bool(self.impl['touches'](self, other))
    776 
    777     def within(self, other):

~\miniconda3\envs\cubeenv2\lib\site-packages\shapely\predicates.py in __call__(self, this, other, *args)
     16         except PredicateError as err:
     17             # Dig deeper into causes of errors.
---> 18             self._check_topology(err, this, other)
     19 
     20 

~\miniconda3\envs\cubeenv2\lib\site-packages\shapely\topology.py in _check_topology(self, err, *geoms)
     36                     "The operation '%s' could not be performed. "
     37                     "Likely cause is invalidity of the geometry %s" % (
---> 38                         self.fn.__name__, repr(geom)))
     39         raise err
     40 

TopologicalError: The operation 'GEOSTouches_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.polygon.Polygon object at 0x000000F146A6FA08>

I've no idea what's wrong here so I have pasted the entire error message. What's wrong here?

dc.list_products() for this product (LC08_L2SP_T1) shows CRS: EPSG:32645, resolution: (-30, 30) and spatial_dimensions: (y, x)

I'm using this demo notebook after making a clone of this repository on my local machine. Loading LISS3 Resourcecat-1 data works fine. I am doing a local installation of Open Data Cube and indexed some datasets with PostgreSQL on a Windows 8.1 system.

These are the product definition and dataset document files of the same product that I've indexed.

2
  • Hey Badal, did you ever solve this one? Aug 16, 2021 at 6:33
  • @Robbi Unfortunately no. Still facing same issue.
    – Badal
    Aug 16, 2021 at 13:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.