Skip to content

Commit

Permalink
adjust spindex_for_crs for WKT based CRS loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Snow committed Oct 13, 2022
1 parent 8f8c95d commit ade84ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datacube/drivers/postgis/_spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def spindex_for_epsg(epsg: int) -> Type[SpatialIndex]:

def spindex_for_crs(crs: CRS) -> Type[SpatialIndex]:
"""Return ORM class of a SpatialIndex for CRS - dynamically creating if necessary"""
if not (str(crs).startswith('EPSG') and crs.epsg):
if not str(crs).startswith("EPSG:") and crs.epsg is None:
# Postgis identifies CRSs by a numeric "SRID" which is equivalent to EPSG number.
_LOG.error("Cannot create a postgis spatial index for a non-EPSG-style CRS.")
return None
Expand Down

0 comments on commit ade84ea

Please sign in to comment.