Repository navigation
|
Hello! I am reading netcdf files from s3 and saving locally as geotiff using Sedona and PySpark. If I do not explicitly set the SRID with So is there a way I can register the WKT string of the netcdf data to a user-defined EPSG code (ex. 99999) to use with the The netcdf data is the National Water Model v3.0 retrospective rainfall data, ex: https://noaa-nwm-retrospective-3-0-pds.s3.amazonaws.com/index.html#CONUS/netcdf/FORCING/1979/ I'm using PySpark 4.0, Sedona 1.8.0, and the GeoTools extension (org.datasyslab:geotools-wrapper:1.8.0-33.1) Ex. read: raster_sdf = (
spark
.read
.format("binaryFile")
.load(s3_glob_pattern)
.selectExpr("RS_FromNetCDF(content, 'RAINRATE', 'x', 'y') as raster", "path as filepath")
.selectExpr("RS_SetSRID(raster, 99999) as raster", "filepath") # <-- can I set 99999 to a custom WKT string?
.selectExpr("RS_AsGeoTiff(raster, 'LZW', 1) as raster", "filepath")
)Then writing to geotiff like: raster_sdf.write.format("raster").mode("overwrite").partitionBy("value_time").save(f"{output_dir.as_posix()}")Any tips/guidance would be greatly appreciated, thanks! |
Replies: 4 comments 1 reply
|
Does each raster have its own WKT string or all rasters in the table have the same CRS? |
|
Hi @jiayuasu thanks for the reply, all rasters have the same CRS, which is available as a WKT or proj4 string |
|
Hi just wondering if anyone has any insight here? Thanks in advance! |
|
@samlamont thanks for reporting this. Custom CRS support for vector geometry is already merged and will be released in the upcoming Sedona 1.9.0. We've started to work on this support in Raster as well. I've created a ticket for this: #2674 |
@samlamont thanks for reporting this.
Custom CRS support for vector geometry is already merged and will be released in the upcoming Sedona 1.9.0.
We've started to work on this support in Raster as well. I've created a ticket for this: #2674