1

I need to get a raster layer from a vector layer using a tool called "Polygon to Raster". My problem is that when I use this tool, the polygon's colors are lost, and the raster obtained is randomly colored.

Here, I show you the colors of the original vector layer, the ones I would like to keep.

This is the raster I obtain when using the Polygon to Raster tool.

How do I keep the polygon colors from the initial layer?

2
  • 1
    The symbology (colour scheme) for a layer is not stored as part of the feature class or raster, but only in the layer, which is a separate to the data itself. In theory, you could configure the polygon layer to use colour based on some attribute field in the polygon feature class. Then use that same field as the value when converting to raster, and then use the same colour scheme based on the raster value. Not sure how feasible this really is in practice, though (having not tried it myself). Commented Nov 21, 2021 at 22:58
  • Thank you very much, I tried it, but it didn't work. Anyway, thanks again for the comment.
    – Hasilvap
    Commented Nov 24, 2021 at 19:56

1 Answer 1

0

As @Son of a Beach says in the comments the symbology is part of the layer object and not the data. Explore using the tool Apply Symbology From Layer to transfer symbology between layers.

2
  • Many thanks. Sadly for me, I get an error when trying to apply a polygon layer symbology to a raster feature. I've learned something new though.
    – Hasilvap
    Commented Nov 24, 2021 at 19:55
  • You can save each color to a style, then access the style when resymbolizing, which will save a bit of time.
    – danak
    Commented Mar 18, 2022 at 16:11

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.