Tag Info

Hot answers tagged

5

I don't know how GDAL handles JPEG compression on a four band raster, it does not make much sense to me, JPEG is meant to be used against RGB (three band) or gray (one band) images. When you gdal_translate it you can also shave off the fourth band with, I believe, -b 1 -b 2 -b 3


4

The Gdal_translate utility can be used. The documentation mentions: ...to convert raster data between different formats, potentially performing some operations like subsettings, resampling, and rescaling pixels in the process. It also has an option for bands, where you selects which bands you want to operate on. So if you want to export just the ...


3

I would recommend calculating soil moisture indices from Landsat TM bands. MTRI has an interesting article on creating soil moisture index (SMI) from Landsat TM 5. Also, I would recommend exploring soil moisture estimates using TM band 6 (Thermal IR). Attached is a good tutorial on calculating indices from Landsat TM bands using ArcGIS 9.x (as you ...


3

Use gdalbuildvrt fiveband.vrt -separate dem.tif threebandalpha.tif gdal_translate fiveband.vrt fiveband.tif If you application uses GDAL, you can just open the vrt.


2

Enable the GDALTools plugin (Plugins->Manage Plugins... menu) and use the Merge tool (Raster->Miscellaneous menu) and tick the Layer stack option.


2

Building on FelixIP's answer, the following method checks for 1) zero values in a 200x200m area located at the center of the image and 2) corrupt rasters that will not read. The bad files are added to one of two lists based on the problem. Efficiency is good, with the script scanning ~2 tiles/sec. import arcpy, os, numpy arcpy.env.workspace = ...


2

Replace point coordinates below by raster extent centre point coordinates p=arcpy.Point() with arcpy.da.UpdateCursor(pntFile,("SHAPE@XY",theFLD)) as rows: for row in rows: XY=row[0] p.X,p.Y=XY myArray = arcpy.RasterToNumPyArray(raster,p,1,1,-9999) ...


1

I would just add all of the rasters to a mosaic dataset (requires at least an ArcGIS Standard license), without any conversion. If you want to add info about the date, you can add a field to the attribute table of the mosaic's footprints (not even necessary if the name of the raster file is enough: it is added to the attribute table of the footprints when ...


1

I don't know about QGIS, but in ArcMap you could use Extract Values To Table (Geostatistical Analyst) You simply give the grid .shp and land-use class raster and the results is a table with unique values within each cell. All you have to do is to calculate the counts and percentages, preferably in R or some other statistical software (or by hand if you ...


1

You could create a GDALDataset with as many bands as you have raster bands, then copy the data from each of your bands into the corresponding band in the GDALDataset. Here's some example code in C++ (since that's where I'm most familiar with GDAL). //create the dataset const char *filename = "example.tif"; GDALDriver *pDriverTiff = ...


1

I dont think thereĀ“s a faster way to do that, but what you can do is a list in a table with the name of each multilayerraster with an identifier (column names: id & name, in this order). So you can write this: #load the table with the name of the image & id list<-read.table("Table.txt",header=T) # select "automatic" correlative id id<-id+1 ...


1

To elaborate on @Stacky's comment: When opening the Layer Properties dialog box for a multiband raster and selecting the Symbology tab, the options available are "Stretched" and "RGB Composite". "Stretched" is useful when only a single band from the raster is needed, but "RGB Composite" is obviously appropriate for a raster with RGB bands. At the top of ...


1

If the output file format is not geotiff, rgb2pct.py creates an intermediate geotiff to write the results into before converting that to the final output format. The comments in the code state: # Create the working file. We have to use TIFF since there are few formats # that allow setting the color table after creation. From lines 127-129 of ...


1

BANDS When working with e.g. scanned maps raster the three (four) bands are exactly the same as RGB(A) channels in e.g. GIMP. But that does not apply to other kinds of raster data. For example, remote sensing data such as multispectral images acquired from satellites can contain (almost) any number of bands with each pixel value for a specific band ...


1

You can also use GRASS for this work, I have found that it provides robust results for indices calculation when atmospheric correction is applied as per the modules.



Only top voted, non community-wiki answers of a minimum length are eligible