I am using QGIS on a Mac.

I am working with hydroacoustic data for mapping and interpreting the seafloor. Data are collected, processed and interpreted. The result is a txt file with Lat and Lon in the first columns followed by R, G and B data, e.g. [54.20,7.78,0.94,0.62,0.37]. The files can have 100,000 lines or more. I am not really good in GIS but I need to use it for some reasons. I seem to be unable to plot these data in GIS. There is obviously no symbology/style way to tell the system to take the color values from a file (i.e. the next 3 values in the same line of the file). It is so easy in MatLab: scatter(lat, lon, symbolsize, [R G B]) but I can't work easily with multiple layers in Matlab.

  • Thanks André, this works just perfectly!!!! Absolutely great, thanks so much! Cheers Chris PS. Thanks also user30184 for your answer. I will check that out next.
    – user35592
    Aug 8 '14 at 21:50
  • Please combine your accounts, Chris, so you can comment on your own question. See gis.stackexchange.com/help/merging-accounts.
    – whuber
    Aug 8 '14 at 22:05

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:

  1. Load the data as delimited text, and save it as a shapefile with CRS EPSG:4326 WGS84
  2. Right-click on the layer -> Properties -> Style
  3. Leave the topmost dropdown field at Single Symbol
  4. Click on Simple Marker below
  5. On the right, click on Data defined properties
  6. Check Fill Color, then on the epsilon to the right
  7. In the field top left, select color, then color_rgb
  8. Click on Fields and Values, then on the field for red
  9. add a comma
  10. proceed with the green and blue field, and close the bracket
  11. Click OK to leave the forms

My color values are between 0 and 255, but scaling that should be a minor problem for you...


enter image description here


Partly off-topic but because there is no user-friendly way for doing it with QGIS this image shows how it can be done with OpenJUMP.

enter image description here

OpenJUMP reads attribute column "R_G_B" and colours the feature with RGB values saved into the field as hexadecimal values. Perhaps QGIS some day can do the same or hopefully better by utilizing the OGR Feature Style Specification http://www.gdal.org/ogr_feature_style.html.

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.