我有一堆没有 SRS 的 geotiff。 可以使用 GDAL 命令修复 SRS:
gdal_translate -a_srs EPSG:25832 srcfile targetfile
如何使用 geotrellis 代码替换 GDAL 命令?
最佳答案
import geotrellis.proj4._
import geotrellis.raster.io.geotiff._
val fileName: String = ???
val tif = SinglebandGeoTiff(fileName)
val targetCrs = CRS.fromName("EPSG:25832”)
val reprojected = tif.projectedRaster.reproject(targetCrs)
GeoTiff(reprojected.raster, reprojected.crs).write("/Users/eugene/reprojected.tif")
如果您使用多个频段,则可以使用 MultibandGeoTiff
。
关于gis - 如何使用 geotrellis 修复 geotiff 中丢失的 SRS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39869065/