Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions debug_reading_netcdf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import numpy as np
from rasters import Raster
from rasters import Point

# reading URI: netcdf:"/Users/halverso/data/GEOS5FP/2021.05.29/GEOS.fp.asm.tavg3_2d_aer_Nx.20210529_1930.V01.nc4":TOTEXTTAU nodata: nan geometry: POINT (-110.0522 31.7438) resampling: nearest
URI = 'netcdf:"/Users/halverso/data/GEOS5FP/2021.05.29/GEOS.fp.asm.tavg3_2d_aer_Nx.20210529_1930.V01.nc4":TOTEXTTAU'
nodata = np.nan
geometry = Point(-110.0522, 31.7438)
resampling = 'nearest'
raster = Raster.open(URI, nodata=nodata, geometry=geometry, resampling=resampling)
print(raster)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "rasters"
version = "1.13.1"
version = "1.13.2"
description = "raster processing toolkit"
readme = "README.md"
authors = [
Expand Down
4 changes: 4 additions & 0 deletions rasters/CRS.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def __init__(self, projparams: Any = None, **kwargs) -> None:
projparams (Any): Projection parameters used to initialize the CRS object.
**kwargs: Additional keyword arguments passed to the pyproj.CRS constructor.
"""
# Handle None, empty string, or other invalid projparams by defaulting to WGS84
if projparams is None or projparams == '' or (isinstance(projparams, str) and projparams.strip() == ''):
projparams = "EPSG:4326"

super(CRS, self).__init__(projparams=projparams, **kwargs)
self._proj4_string = None # Cache for proj4 string

Expand Down