Change color polygons by area of polygons












4














I have polygons with the area in the attribute table and I want change polygons to red color if they have area less 70.



area and polygon










share|improve this question









New contributor




Evgeny Ryvkin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Thank you for help, yes is also a GOOD answer, if I want to save the changes in GeoJSON, can I do it or I need to create an attribute table different column and save the color by a polygon?
    – Evgeny Ryvkin
    yesterday










  • See this for saving styles in geojson: gis.stackexchange.com/questions/22474/… If this does not answer your question open up a new one. Also feel free to mark the answer that answered your question the best as accepted. See our short Tour.
    – MrXsquared
    yesterday










  • is help me and useful, I just try to learn more about this program.
    – Evgeny Ryvkin
    yesterday










  • Unrelated to your question, but I noticed that the feature in the top-left of your screenshot looks like it has self-intersecting boundaries, which would make it an invalid geometry.
    – csk
    yesterday
















4














I have polygons with the area in the attribute table and I want change polygons to red color if they have area less 70.



area and polygon










share|improve this question









New contributor




Evgeny Ryvkin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • Thank you for help, yes is also a GOOD answer, if I want to save the changes in GeoJSON, can I do it or I need to create an attribute table different column and save the color by a polygon?
    – Evgeny Ryvkin
    yesterday










  • See this for saving styles in geojson: gis.stackexchange.com/questions/22474/… If this does not answer your question open up a new one. Also feel free to mark the answer that answered your question the best as accepted. See our short Tour.
    – MrXsquared
    yesterday










  • is help me and useful, I just try to learn more about this program.
    – Evgeny Ryvkin
    yesterday










  • Unrelated to your question, but I noticed that the feature in the top-left of your screenshot looks like it has self-intersecting boundaries, which would make it an invalid geometry.
    – csk
    yesterday














4












4








4


1





I have polygons with the area in the attribute table and I want change polygons to red color if they have area less 70.



area and polygon










share|improve this question









New contributor




Evgeny Ryvkin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I have polygons with the area in the attribute table and I want change polygons to red color if they have area less 70.



area and polygon







qgis






share|improve this question









New contributor




Evgeny Ryvkin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Evgeny Ryvkin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited yesterday









Vince

14.4k32647




14.4k32647






New contributor




Evgeny Ryvkin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









Evgeny Ryvkin

211




211




New contributor




Evgeny Ryvkin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Evgeny Ryvkin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Evgeny Ryvkin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • Thank you for help, yes is also a GOOD answer, if I want to save the changes in GeoJSON, can I do it or I need to create an attribute table different column and save the color by a polygon?
    – Evgeny Ryvkin
    yesterday










  • See this for saving styles in geojson: gis.stackexchange.com/questions/22474/… If this does not answer your question open up a new one. Also feel free to mark the answer that answered your question the best as accepted. See our short Tour.
    – MrXsquared
    yesterday










  • is help me and useful, I just try to learn more about this program.
    – Evgeny Ryvkin
    yesterday










  • Unrelated to your question, but I noticed that the feature in the top-left of your screenshot looks like it has self-intersecting boundaries, which would make it an invalid geometry.
    – csk
    yesterday


















  • Thank you for help, yes is also a GOOD answer, if I want to save the changes in GeoJSON, can I do it or I need to create an attribute table different column and save the color by a polygon?
    – Evgeny Ryvkin
    yesterday










  • See this for saving styles in geojson: gis.stackexchange.com/questions/22474/… If this does not answer your question open up a new one. Also feel free to mark the answer that answered your question the best as accepted. See our short Tour.
    – MrXsquared
    yesterday










  • is help me and useful, I just try to learn more about this program.
    – Evgeny Ryvkin
    yesterday










  • Unrelated to your question, but I noticed that the feature in the top-left of your screenshot looks like it has self-intersecting boundaries, which would make it an invalid geometry.
    – csk
    yesterday
















Thank you for help, yes is also a GOOD answer, if I want to save the changes in GeoJSON, can I do it or I need to create an attribute table different column and save the color by a polygon?
– Evgeny Ryvkin
yesterday




Thank you for help, yes is also a GOOD answer, if I want to save the changes in GeoJSON, can I do it or I need to create an attribute table different column and save the color by a polygon?
– Evgeny Ryvkin
yesterday












See this for saving styles in geojson: gis.stackexchange.com/questions/22474/… If this does not answer your question open up a new one. Also feel free to mark the answer that answered your question the best as accepted. See our short Tour.
– MrXsquared
yesterday




See this for saving styles in geojson: gis.stackexchange.com/questions/22474/… If this does not answer your question open up a new one. Also feel free to mark the answer that answered your question the best as accepted. See our short Tour.
– MrXsquared
yesterday












is help me and useful, I just try to learn more about this program.
– Evgeny Ryvkin
yesterday




is help me and useful, I just try to learn more about this program.
– Evgeny Ryvkin
yesterday












Unrelated to your question, but I noticed that the feature in the top-left of your screenshot looks like it has self-intersecting boundaries, which would make it an invalid geometry.
– csk
yesterday




Unrelated to your question, but I noticed that the feature in the top-left of your screenshot looks like it has self-intersecting boundaries, which would make it an invalid geometry.
– csk
yesterday










2 Answers
2






active

oldest

votes


















5














Create a rule based symbology like this:
One with the rule "area" < 70 and one with the rule ELSE
("area" refers to an attribute value while $area calculates the area; use the one you need; according to your sceenshot it is "area")



enter image description here






share|improve this answer





















  • Many Thanks to you, that helps me!
    – Evgeny Ryvkin
    yesterday










  • @EvgenyRyvkin you can also use a graduated renderer on the $area variable (rather than a SHAPE_AREA column), then set your own class breaks and colours.
    – DPSSpatial
    yesterday



















4














Here's another method. It's not really any better than MrXsquared's answer, but I had already started writing it.



Use data-defined settings to control fill color



enter image description here



with this expression:
if("area"<70, '#ff0000','#00ff00')



This expression will set the fill color to red (#ff0000 in hex notation) when the area is less than 70, and green otherwise.



enter image description here



If you want to use different shades of red and green, you can get the hex notation for the desired color from the "select color" dialog - just select the color you want and scroll down to find the hex notation near the bottom.



enter image description here






share|improve this answer





















  • Thank you for your answer, yes is a good example of how can I write different color in hexa and using data-defined.
    – Evgeny Ryvkin
    yesterday











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Evgeny Ryvkin is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f307421%2fchange-color-polygons-by-area-of-polygons%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









5














Create a rule based symbology like this:
One with the rule "area" < 70 and one with the rule ELSE
("area" refers to an attribute value while $area calculates the area; use the one you need; according to your sceenshot it is "area")



enter image description here






share|improve this answer





















  • Many Thanks to you, that helps me!
    – Evgeny Ryvkin
    yesterday










  • @EvgenyRyvkin you can also use a graduated renderer on the $area variable (rather than a SHAPE_AREA column), then set your own class breaks and colours.
    – DPSSpatial
    yesterday
















5














Create a rule based symbology like this:
One with the rule "area" < 70 and one with the rule ELSE
("area" refers to an attribute value while $area calculates the area; use the one you need; according to your sceenshot it is "area")



enter image description here






share|improve this answer





















  • Many Thanks to you, that helps me!
    – Evgeny Ryvkin
    yesterday










  • @EvgenyRyvkin you can also use a graduated renderer on the $area variable (rather than a SHAPE_AREA column), then set your own class breaks and colours.
    – DPSSpatial
    yesterday














5












5








5






Create a rule based symbology like this:
One with the rule "area" < 70 and one with the rule ELSE
("area" refers to an attribute value while $area calculates the area; use the one you need; according to your sceenshot it is "area")



enter image description here






share|improve this answer












Create a rule based symbology like this:
One with the rule "area" < 70 and one with the rule ELSE
("area" refers to an attribute value while $area calculates the area; use the one you need; according to your sceenshot it is "area")



enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered yesterday









MrXsquared

799216




799216












  • Many Thanks to you, that helps me!
    – Evgeny Ryvkin
    yesterday










  • @EvgenyRyvkin you can also use a graduated renderer on the $area variable (rather than a SHAPE_AREA column), then set your own class breaks and colours.
    – DPSSpatial
    yesterday


















  • Many Thanks to you, that helps me!
    – Evgeny Ryvkin
    yesterday










  • @EvgenyRyvkin you can also use a graduated renderer on the $area variable (rather than a SHAPE_AREA column), then set your own class breaks and colours.
    – DPSSpatial
    yesterday
















Many Thanks to you, that helps me!
– Evgeny Ryvkin
yesterday




Many Thanks to you, that helps me!
– Evgeny Ryvkin
yesterday












@EvgenyRyvkin you can also use a graduated renderer on the $area variable (rather than a SHAPE_AREA column), then set your own class breaks and colours.
– DPSSpatial
yesterday




@EvgenyRyvkin you can also use a graduated renderer on the $area variable (rather than a SHAPE_AREA column), then set your own class breaks and colours.
– DPSSpatial
yesterday













4














Here's another method. It's not really any better than MrXsquared's answer, but I had already started writing it.



Use data-defined settings to control fill color



enter image description here



with this expression:
if("area"<70, '#ff0000','#00ff00')



This expression will set the fill color to red (#ff0000 in hex notation) when the area is less than 70, and green otherwise.



enter image description here



If you want to use different shades of red and green, you can get the hex notation for the desired color from the "select color" dialog - just select the color you want and scroll down to find the hex notation near the bottom.



enter image description here






share|improve this answer





















  • Thank you for your answer, yes is a good example of how can I write different color in hexa and using data-defined.
    – Evgeny Ryvkin
    yesterday
















4














Here's another method. It's not really any better than MrXsquared's answer, but I had already started writing it.



Use data-defined settings to control fill color



enter image description here



with this expression:
if("area"<70, '#ff0000','#00ff00')



This expression will set the fill color to red (#ff0000 in hex notation) when the area is less than 70, and green otherwise.



enter image description here



If you want to use different shades of red and green, you can get the hex notation for the desired color from the "select color" dialog - just select the color you want and scroll down to find the hex notation near the bottom.



enter image description here






share|improve this answer





















  • Thank you for your answer, yes is a good example of how can I write different color in hexa and using data-defined.
    – Evgeny Ryvkin
    yesterday














4












4








4






Here's another method. It's not really any better than MrXsquared's answer, but I had already started writing it.



Use data-defined settings to control fill color



enter image description here



with this expression:
if("area"<70, '#ff0000','#00ff00')



This expression will set the fill color to red (#ff0000 in hex notation) when the area is less than 70, and green otherwise.



enter image description here



If you want to use different shades of red and green, you can get the hex notation for the desired color from the "select color" dialog - just select the color you want and scroll down to find the hex notation near the bottom.



enter image description here






share|improve this answer












Here's another method. It's not really any better than MrXsquared's answer, but I had already started writing it.



Use data-defined settings to control fill color



enter image description here



with this expression:
if("area"<70, '#ff0000','#00ff00')



This expression will set the fill color to red (#ff0000 in hex notation) when the area is less than 70, and green otherwise.



enter image description here



If you want to use different shades of red and green, you can get the hex notation for the desired color from the "select color" dialog - just select the color you want and scroll down to find the hex notation near the bottom.



enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered yesterday









csk

6,890733




6,890733












  • Thank you for your answer, yes is a good example of how can I write different color in hexa and using data-defined.
    – Evgeny Ryvkin
    yesterday


















  • Thank you for your answer, yes is a good example of how can I write different color in hexa and using data-defined.
    – Evgeny Ryvkin
    yesterday
















Thank you for your answer, yes is a good example of how can I write different color in hexa and using data-defined.
– Evgeny Ryvkin
yesterday




Thank you for your answer, yes is a good example of how can I write different color in hexa and using data-defined.
– Evgeny Ryvkin
yesterday










Evgeny Ryvkin is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Evgeny Ryvkin is a new contributor. Be nice, and check out our Code of Conduct.













Evgeny Ryvkin is a new contributor. Be nice, and check out our Code of Conduct.












Evgeny Ryvkin is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f307421%2fchange-color-polygons-by-area-of-polygons%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown