1

I was trying to convert a netcdf file (~5 GB in size) to a tiff format using both Gdal_translate and ENVI. Was successful in ENVI but I'm missing spatial information. Using gdal_translate (gdal_translate - sds file.nc file.tiff), it looks like file is too heavy as it's taking long. I used QGIS too but there was a slight spatial shift in the two images.

I've checked similar past Q/Q but none seems to give me a solution. Any better idea out there?

1

Do you use R? I'd do these steps...

library(raster)

# read the netcdf file as raster
nc_raster = raster("input_file.nc")

# if raster crs is NA, set the correct projection using proj4
projection(nc_raster) = CRS(+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0)

# save output
writeRaster(nc_raster, "nc_raster.tif", "GTiff")

The most important is to know the correct proj4 format, otherwise the data will be shifted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.