1

I have a polygon shapefile of geological units. Someone has already created a symbology and assigned standard colours to the units, available as a .lyr file.

What I need to do is create a list of the the 40+ units with their assigned RGB values using an ArcMap tool or maybe ArcPy.

I have been able to use polygon to raster, but it doesn't preserve the correct RGB values. That could be a feasible option and allow me to sample the colour if anyone has a suggestion on that path.

I have ArcGIS Desktop 10.5 Advanced License.

  • Does your polygon file already have RGB values stored in a field or fields? – PolyGeo Jul 14 '17 at 22:30
  • Is this a single layer file, classified by an attribute? And you want to get the RGB associated which each classification by attribute? What is your desired output format? A line of text + RGB value, ie- "MySoil- 120,35, 210" or something else? – RyanDalton Jul 14 '17 at 22:34
  • Nope, not in the attribute table at least. Just a very specific colour ramp. – meguh78 Jul 14 '17 at 22:39
  • RyanDalton Yes its a single shapefile, there's also the lyr file associated with it. The colours are classified by attribute (unit name). Yes to getting the RGB value associated with each classification. A text file would be fine. – meguh78 Jul 14 '17 at 22:41
1
  • Export colored polygons as png raster with world file.
  • Export result as grid format
  • add components of above as separate grids
  • Sample points inside polygons

enter image description here

  • Thanks FelixIP, but it still does not export with the correct colours, which is the same problem I had when making a geotiff with the polygon to raster tool. The result is closer but still not correct. Do you know why this would be? – meguh78 Jul 18 '17 at 19:25
  • Something to do with display color scheme. Perhaps play with outputs – FelixIP Jul 18 '17 at 19:32
  • Thanks for that, exporting the map as a .bmp + worldfile seemed to work, but only with the DPI way down (less than 75). The higher the DPI, the greater the divergence from the original colours for some reason. Also I double checked that the colour mode was set to 24-bit true colour. – meguh78 Jul 18 '17 at 19:47

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.