2

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.

2
  • 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, 2014 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, 2014 at 22:05

2 Answers 2

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:

  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...

N,E,R,G,B
54.20,7.78,239,158,94
51,8,129,72,122
50.5,7,123,34,55
50,6,23,210,233
51.5,8,233,14,140
52,7.5,23,25,100
53,6,100,23,23
52.5,7,200,40,10

enter image description here

0

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 and acknowledge you have read our privacy policy.

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