Hot answers tagged

21

A few months ago I wrote a technical blog post (Planespotting) on intra-detector parallax effects in Sentinel-2 imagery, which can cause aircraft contrails to appear as rainbow stripes. The post also discusses inter-detector parallax effect and motion effects, which also can cause color shifts. Here is a summary of intra-detector spectral band parallax: ...


14

On later version of QGIS is easier to perform the requested task. Just open Layer Properties, Style Tab, and make sure Single Symbol is selected. Click the box next to the "Fill" color and choose "Edit. You will be editing the base color of your polygon bases on RGB colors present on the data table, with a constant border color (you can apply the same ...


11

here's a better answer, use gdalbuildvrt with either srcnodata or vrtnodata flag: gdalbuildvrt -srcnodata "123 231 67" outfile.vrt input.tif If the next application in line doesn't understand .vrt, translate to a new tif: gdal_translate outfile.vrt final.tif


9

Your fire hydrants will have a very unique spectral signature, therefore I would use supervised maximum likelihood classification to classify your raster. An alternative is to run an ISODATA algorithm for an unsupervised approach. Try the following (partial) workflow: Open Iso Cluster Unsupervised Classification in ArcGIS Enter ALL 3 bands (i.e. R, G, B) ...


9

gdal_translate is able to extract single bands: gdal_translate -b 1 in.tif out1.tif gdal_translate -b 2 in.tif out2.tif gdal_translate -b 3 in.tif out3.tif gdal_translate -b 4 in.tif out4.tif Raster -> Conversion -> Translate will create a gdal_translate command line, which you can edit to specify the band you want.


8

There are 2 parts of the problem. The first is that you want to convert from 16 bits to 8bit, and the -scale option of gdal_translate does it, as mentioned in the previous answer. -scale minOriginal maxOriginal minOutput maxOutput The second problem is a contrast enhancement problem: when you rescale, you want to have a high contrast for the pixels ...


7

You can simply use the TCI.jp2 file that its included in the SAFE.zip files. Note that these files are not available in S2 files before October 2016 Alternatively you can convert the bands using GDAL: # Merge bands gdalbuildvrt -separate TCI.vrt B04.jp2 B03.jp2 B02.jp2 # Convert to uncompressed GeoTiff gdal_translate -ot Byte -co TILED=YES -scale 0 4096 0 ...


6

This error is because you're building pyramids internally (default) on a GeoTIFF file which is not a big TIFF. The pyramids are being appended to the existing file which makes the resultant file exceed the 4 GiB limit. This is evident by the error message Maximum TIFF file size exceeded. From here you have some options, the error message indicates using ...


5

There is no specific GIS software for doing this: most will handle the RGB image and the Lidar data. Basically, NDVI is (NIR - RED)/(NIR + RED). Most of the time, aerial Lidar gives you the NIR value (to be checked in metadata) and the first band of your RGB image gives you the RED value. Just make sure that your data are calibrated to reflectance (or, if ...


5

As a geologist, I make geological cross section using the elevations values from a DEM and the colors from a geological map, look at the pure Python solution with osgeo.gdal in Python Script for getting elevation difference between two points But now, since PyQGIS 2.x, it is easier with PyQGIS and the QgsRaster.IdentifyFormatValuefunction example with a ...


5

Vegetation extraction is a bit more complex than running the spatial analysis tools that you named. For better results I would suggest the following: run analysis on a 4 band image (e.g. R,G,B,NIR) change image to be symbolized as 432 for RGB not 321 create training samples that represent vegetation and run a supervised classification These steps will ...


5

If you are looking for a solution as the one you linked in the question you should follow and adjust the Landsat 8 processing shell skript that is provided for download in the tutorial. Particularly, as is done there, you first might want to rescale the single bands, e.g as follows: gdal_translate -ot Byte -scale 0 10000 0 255 B04.jp2 B04-scaled.tif ...


4

Herein lies a misunderstanding: "...that is done separately for each band and not for a specific colour." "Each band" and "specific colour" are in fact the same thing. That is, it is the values in each band that, when combined together, make a specific colour. For example the RGB triplet 255,0,0 is the specific colour of pure red, comprised of band-red at ...


4

The fourth value is alpha (i.e. RGBA), which you can ignore. The four value structure is expected. You can read the colour tables into native lists/dicts with GDAL. from osgeo import gdal gdal.UseExceptions() ds = gdal.Open(fname) band = ds.GetRasterBand(1) arr = band.ReadAsArray() ct = band.GetColorTable() # index value to RGB (ignore A) i2rgb = [ct....


4

Use the PointCloudOnRasterComponentSetter transformer in FME. Check out this tutorial: https://knowledge.safe.com/articles/1096/color-and-point-clouds.html


4

The header needs to be set with a point format that supports RGB colors, see: https://pythonhosted.org/laspy/tut_background.html. For LAS 1.2, the minimum point format for color is 2: header = laspy.header.Header(point_format=2) # LAS point format 2 supports color with laspy.file.File(output_path, mode="w", header=header) as lasfile: lasfile.header....


4

There's a function in rgdal for this SGDF2PCT, so here I coerce to SpatialGridDataFrame, build the colour table and rebuild the raster. Note that indexing in raster is assuming [0, 255]. Control the number of colours with ncolors argument. library(raster) b <- brick(system.file("external/rlogo.grd", package="raster")) pct <- rgdal::SGDF2PCT(as(b, "...


4

You can use an expression to control colour, for example in the Simple Fill of a polygon, click the "expression" button at the right hand side, then choose "Edit": Then in the expression enter something like: where "red", "green", and "blue" are the field names with the colour values from 0 to 255. Put the names in double quotes as shown. Help on the ...


3

Seems the bugs you mention with GRASS are a known issue with the standalone version. Nothing to do with mapcalc... this was a packaging issue that has been solved on osgeo4w and now is just needed to wait for updated standalone installers. Réf : https://hub.qgis.org/issues/8529


3

Try converting your color list from RGB format to HSV format and then sort the HSV list. What program did you get the RGB values out of? You might be able to tell it to simply report out HSV values. If you can't get HSV directly from that program, you could convert RGB to HSV here http://www.rapidtables.com/convert/color/rgb-to-hsv.htm Background: RGB ...


3

You need to convert each channel into a luminosity channel. So instead of this: red = Image.open("red.TIF") you need to do this: red = Image.open("red.TIF").convert('L') rinse and repeat for G and B and you're done!


3

You can do it like this: # I'm assuming cat is the full path to a raster # or a raster object TempDir = os.environ.get("TEMP") # Your temp folder ColFile = os.path.join(TempDir,"TEMP_CLR_FILE.clr") with open(ColFile,'w') as ColWrite: ColWrite.write("1 255 0 0\n") # 1 = red ColWrite.write("2 0 0 255\n") # 2 = blue arcpy.AddColormap_management(cat,...


3

This functionality was removed from libLAS and moved over to PDAL. The filter you want to use is called filters.colorization, and it allows you to control how the bands map to the color values of the LAS file in addition to other useful switches. See the filters.colorization documentation for how to use the filter. See the PDAL QuickStart for how to use ...


3

You need to add the -separate option in order to place each input file into a separate band and (optionally) the -co PHOTOMETRIC=RGB creation option to force the photometric interpretation (to avoid e.g. the ColorInterp=undefined and set the right color interpretation for each band): gdal_merge -separate -co PHOTOMETRIC=RGB -o merged.tif B04.jp2 B03.jp2 B02....


3

I have submitted an ArcGIS Idea to be able to Set ArcGIS Pro symbol color from RGB values in attribute table: Set symbol color from RGB values in attribute table is a popular idea for ArcMap to have: The ability to set the fill colour for a symbol from RGB values stored in the attribute table of a shapefile/feature class. ...


3

you can use Orfeo Toolbox, a c++ library with a lot of usefull applications. In your case, otbcli_BandMathX would do the job in one line: otbcli_BandMathX -il input.tif -out output.tif -exp "((im1b1==0) and (im1b2==0)and (im1b3==0))?{1,1,1}:im1" That is: if the three bands of your raster are equal to zero, then write a pixel of value [1,1,1] otherwise ...


3

If you do not want RGB visualization bands, then you should not call image.visualize({}). The visualize algorithm creates RGB bands. Simply replace image.visualize({}).addBands(image), which adds the original bands back to the visualization bands, with image. The toFloat will probably also be unneeded then. for (var i in listOfNumbers) { var image = ee....


2

ArcScan is meant to digitize drawings (typically scanned cadastral maps or the likes). In your case you want to classify an RGB image. With a true color image, you can use the image classification toolbar . You'll need to draw some sample polygons and use them for training a classifier. You need spatial analyst licence for that, and I would rather use an ...


2

The feature you want is implemented as "Data defined properties". See Data-defined Styles in QGIS for a first announcement. It works for me this way: Load the data as delimited text, and save it as a shapefile with CRS EPSG:4326 WGS84 Right-click on the layer -> Properties -> Style Leave the topmost dropdown field at Single Symbol Click on Simple Marker ...


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