New answers tagged

3

First of all, make sure forfile command returns the files you want to process. The next command prints all HDF files' name in the folder: forfiles /p C:\Users\HP\Desktop\deneme\ham_veri /m *.hdf /c "cmd /c echo @path You may think of using this: FORFILES /m *.hdf /P C:\Users\HP\Desktop\deneme\ham_veri /C "cmd /C gdal_translate -sds @file C:\Users\...


1

This seems to work, just using gdal_calc.py: gdal_calc.py -A a1.tif --outfile=a3.tif --calc="(A<-9000)*65535 + (A>0)*A+8500" --NoDataValue=65535 --type=Int32 --overwrite converts to Int32 shifts the valid data up by 8500 shifts and sets the nodata value to 0xFFFF You might need to change the nodata test as my nodata value was -9999 but I ...


1

The functional solution is to use sed. sed -i '/<Entry c1="0" c2="0" c3="0" c4="255" \/>/,/<Entry c1="255" c2="255" c3="255" c4="255" \/>/d; /<ColorTable>/r COLORTABLE.txt' $F_VRT Or COLORTABLE.txt contains the values I want.


0

The Python package osgeo.gdal is not really "Pythonic", so there are several quirks and gotchas to be aware of. The NoneType returned from Open means that the file could not be opened. Here's a quick demo: from osgeo import gdal ds = gdal.Open("NETCDF:file.nc:velocity") # you may see the following message in a console: # ERROR 4: `NETCDF:...


0

Try this: gdal_translate -a_ullr -180 90 180 -90 NETCDF:test.nc:chlor_a_diff test.tif Original file: print(gdal.Open('test.nc').GetGeoTransform()) => (0.0, 1.0, 0.0, 0.0, 0.0, 1.0) gdal_translate -a_ullr -180 90 180 -90 NETCDF:test.nc:chlor_a_diff test.tif print(gdal.Open('test.tif').GetGeoTransform()) => (-180.0, 0.020830922346950585, 0.0, 90.0, 0.0,...


Top 50 recent answers are included