A Fast Way to Color Polygon With 200 Row With Six Selected Color in QGIS 3.4.2

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
5
down vote

favorite
1












I have a layer of the world that contains 200 rows.



I am required to color the map with six selected colors, the rainbow colors.



enter image description here



I figure that I can save selected countries and save them separately.



enter image description here



Once they saved I can upload them and make the color ramp I needed.



enter image description here



However, I was wondered is there a faster way to do this without making six layers and without choosing each country manually in the Layer Styling bar panel.



enter image description here










share|improve this question

























    up vote
    5
    down vote

    favorite
    1












    I have a layer of the world that contains 200 rows.



    I am required to color the map with six selected colors, the rainbow colors.



    enter image description here



    I figure that I can save selected countries and save them separately.



    enter image description here



    Once they saved I can upload them and make the color ramp I needed.



    enter image description here



    However, I was wondered is there a faster way to do this without making six layers and without choosing each country manually in the Layer Styling bar panel.



    enter image description here










    share|improve this question























      up vote
      5
      down vote

      favorite
      1









      up vote
      5
      down vote

      favorite
      1






      1





      I have a layer of the world that contains 200 rows.



      I am required to color the map with six selected colors, the rainbow colors.



      enter image description here



      I figure that I can save selected countries and save them separately.



      enter image description here



      Once they saved I can upload them and make the color ramp I needed.



      enter image description here



      However, I was wondered is there a faster way to do this without making six layers and without choosing each country manually in the Layer Styling bar panel.



      enter image description here










      share|improve this question













      I have a layer of the world that contains 200 rows.



      I am required to color the map with six selected colors, the rainbow colors.



      enter image description here



      I figure that I can save selected countries and save them separately.



      enter image description here



      Once they saved I can upload them and make the color ramp I needed.



      enter image description here



      However, I was wondered is there a faster way to do this without making six layers and without choosing each country manually in the Layer Styling bar panel.



      enter image description here







      qgis layers






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 9 at 7:01









      Nitzan Matan

      1,6021027




      1,6021027




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          6
          down vote



          accepted










          Following further clarification by Nitzan Matan, this is another map representation.



          enter image description here



          This categorization was made by round((y(centroid($geometry))+80)/30) .



          To divide latitude range (-90 ~ +80) in this sample data from Natural Earth into 6 zones (bands), I first added 80 and divided by 30. You will need to modify these numbers according to your dataset.



          enter image description here



          Now change the color to fit with your rainbow palette.



          NB One caveat - you will notice Alaska is green. If you want it to be like Russia and Canada, consider breaking US into parts.






          share|improve this answer




















          • Very smart!, Can you explained more about the latitude range?
            – Nitzan Matan
            Dec 9 at 9:36






          • 2




            @NitzanMatan Yes, more specifically the latitude ranges (-90.00000 ~ 83.64513) and found as part of Extent in the Layer Properties | Information. But I need to know only the y-coord of centroid so it does not have to be such precise.
            – Kazuhito
            Dec 9 at 9:48


















          up vote
          3
          down vote













          As you are using QGIS 3.4.2, you can use Topological coloring Tool, which is in the Processing Toolbox | Cartography.



          Start this tool and give 6 (any number of colors you want to have) in the Minimum number of colors and hit Run. It will return a new layer Colored with an additional integer field color_id.



          So the last step is to open the Layer Property of this layer and set Categorized color scheme on the color_id column (field). You then change each of these 6 random colors to your rainbow palette.



          enter image description here






          share|improve this answer




















          • The new color id are random, I need then to be from the bottom up like the flag.
            – Nitzan Matan
            Dec 9 at 8:41











          • Sorry @NitzanMatan I honestly do not understand your comment. Could you expound it a little bit more?
            – Kazuhito
            Dec 9 at 8:58










          • Sure, in your answer you made 6 colored id, They are scattered randomly. In group 1 there are row both in Africa and the U.S. I need that Russia and Canada will be one color, U.S and Europe and so on. Thanks!
            – Nitzan Matan
            Dec 9 at 9:10






          • 1




            Aah, color bands like the flag? Gotcha! Thanks @NitzanMatan for clarification.
            – Kazuhito
            Dec 9 at 9:15










          • Great, thanks a lot
            – Nitzan Matan
            Dec 9 at 9:17










          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
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f305455%2fa-fast-way-to-color-polygon-with-200-row-with-six-selected-color-in-qgis-3-4-2%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








          up vote
          6
          down vote



          accepted










          Following further clarification by Nitzan Matan, this is another map representation.



          enter image description here



          This categorization was made by round((y(centroid($geometry))+80)/30) .



          To divide latitude range (-90 ~ +80) in this sample data from Natural Earth into 6 zones (bands), I first added 80 and divided by 30. You will need to modify these numbers according to your dataset.



          enter image description here



          Now change the color to fit with your rainbow palette.



          NB One caveat - you will notice Alaska is green. If you want it to be like Russia and Canada, consider breaking US into parts.






          share|improve this answer




















          • Very smart!, Can you explained more about the latitude range?
            – Nitzan Matan
            Dec 9 at 9:36






          • 2




            @NitzanMatan Yes, more specifically the latitude ranges (-90.00000 ~ 83.64513) and found as part of Extent in the Layer Properties | Information. But I need to know only the y-coord of centroid so it does not have to be such precise.
            – Kazuhito
            Dec 9 at 9:48















          up vote
          6
          down vote



          accepted










          Following further clarification by Nitzan Matan, this is another map representation.



          enter image description here



          This categorization was made by round((y(centroid($geometry))+80)/30) .



          To divide latitude range (-90 ~ +80) in this sample data from Natural Earth into 6 zones (bands), I first added 80 and divided by 30. You will need to modify these numbers according to your dataset.



          enter image description here



          Now change the color to fit with your rainbow palette.



          NB One caveat - you will notice Alaska is green. If you want it to be like Russia and Canada, consider breaking US into parts.






          share|improve this answer




















          • Very smart!, Can you explained more about the latitude range?
            – Nitzan Matan
            Dec 9 at 9:36






          • 2




            @NitzanMatan Yes, more specifically the latitude ranges (-90.00000 ~ 83.64513) and found as part of Extent in the Layer Properties | Information. But I need to know only the y-coord of centroid so it does not have to be such precise.
            – Kazuhito
            Dec 9 at 9:48













          up vote
          6
          down vote



          accepted







          up vote
          6
          down vote



          accepted






          Following further clarification by Nitzan Matan, this is another map representation.



          enter image description here



          This categorization was made by round((y(centroid($geometry))+80)/30) .



          To divide latitude range (-90 ~ +80) in this sample data from Natural Earth into 6 zones (bands), I first added 80 and divided by 30. You will need to modify these numbers according to your dataset.



          enter image description here



          Now change the color to fit with your rainbow palette.



          NB One caveat - you will notice Alaska is green. If you want it to be like Russia and Canada, consider breaking US into parts.






          share|improve this answer












          Following further clarification by Nitzan Matan, this is another map representation.



          enter image description here



          This categorization was made by round((y(centroid($geometry))+80)/30) .



          To divide latitude range (-90 ~ +80) in this sample data from Natural Earth into 6 zones (bands), I first added 80 and divided by 30. You will need to modify these numbers according to your dataset.



          enter image description here



          Now change the color to fit with your rainbow palette.



          NB One caveat - you will notice Alaska is green. If you want it to be like Russia and Canada, consider breaking US into parts.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 9 at 9:28









          Kazuhito

          14.3k31576




          14.3k31576











          • Very smart!, Can you explained more about the latitude range?
            – Nitzan Matan
            Dec 9 at 9:36






          • 2




            @NitzanMatan Yes, more specifically the latitude ranges (-90.00000 ~ 83.64513) and found as part of Extent in the Layer Properties | Information. But I need to know only the y-coord of centroid so it does not have to be such precise.
            – Kazuhito
            Dec 9 at 9:48

















          • Very smart!, Can you explained more about the latitude range?
            – Nitzan Matan
            Dec 9 at 9:36






          • 2




            @NitzanMatan Yes, more specifically the latitude ranges (-90.00000 ~ 83.64513) and found as part of Extent in the Layer Properties | Information. But I need to know only the y-coord of centroid so it does not have to be such precise.
            – Kazuhito
            Dec 9 at 9:48
















          Very smart!, Can you explained more about the latitude range?
          – Nitzan Matan
          Dec 9 at 9:36




          Very smart!, Can you explained more about the latitude range?
          – Nitzan Matan
          Dec 9 at 9:36




          2




          2




          @NitzanMatan Yes, more specifically the latitude ranges (-90.00000 ~ 83.64513) and found as part of Extent in the Layer Properties | Information. But I need to know only the y-coord of centroid so it does not have to be such precise.
          – Kazuhito
          Dec 9 at 9:48





          @NitzanMatan Yes, more specifically the latitude ranges (-90.00000 ~ 83.64513) and found as part of Extent in the Layer Properties | Information. But I need to know only the y-coord of centroid so it does not have to be such precise.
          – Kazuhito
          Dec 9 at 9:48













          up vote
          3
          down vote













          As you are using QGIS 3.4.2, you can use Topological coloring Tool, which is in the Processing Toolbox | Cartography.



          Start this tool and give 6 (any number of colors you want to have) in the Minimum number of colors and hit Run. It will return a new layer Colored with an additional integer field color_id.



          So the last step is to open the Layer Property of this layer and set Categorized color scheme on the color_id column (field). You then change each of these 6 random colors to your rainbow palette.



          enter image description here






          share|improve this answer




















          • The new color id are random, I need then to be from the bottom up like the flag.
            – Nitzan Matan
            Dec 9 at 8:41











          • Sorry @NitzanMatan I honestly do not understand your comment. Could you expound it a little bit more?
            – Kazuhito
            Dec 9 at 8:58










          • Sure, in your answer you made 6 colored id, They are scattered randomly. In group 1 there are row both in Africa and the U.S. I need that Russia and Canada will be one color, U.S and Europe and so on. Thanks!
            – Nitzan Matan
            Dec 9 at 9:10






          • 1




            Aah, color bands like the flag? Gotcha! Thanks @NitzanMatan for clarification.
            – Kazuhito
            Dec 9 at 9:15










          • Great, thanks a lot
            – Nitzan Matan
            Dec 9 at 9:17














          up vote
          3
          down vote













          As you are using QGIS 3.4.2, you can use Topological coloring Tool, which is in the Processing Toolbox | Cartography.



          Start this tool and give 6 (any number of colors you want to have) in the Minimum number of colors and hit Run. It will return a new layer Colored with an additional integer field color_id.



          So the last step is to open the Layer Property of this layer and set Categorized color scheme on the color_id column (field). You then change each of these 6 random colors to your rainbow palette.



          enter image description here






          share|improve this answer




















          • The new color id are random, I need then to be from the bottom up like the flag.
            – Nitzan Matan
            Dec 9 at 8:41











          • Sorry @NitzanMatan I honestly do not understand your comment. Could you expound it a little bit more?
            – Kazuhito
            Dec 9 at 8:58










          • Sure, in your answer you made 6 colored id, They are scattered randomly. In group 1 there are row both in Africa and the U.S. I need that Russia and Canada will be one color, U.S and Europe and so on. Thanks!
            – Nitzan Matan
            Dec 9 at 9:10






          • 1




            Aah, color bands like the flag? Gotcha! Thanks @NitzanMatan for clarification.
            – Kazuhito
            Dec 9 at 9:15










          • Great, thanks a lot
            – Nitzan Matan
            Dec 9 at 9:17












          up vote
          3
          down vote










          up vote
          3
          down vote









          As you are using QGIS 3.4.2, you can use Topological coloring Tool, which is in the Processing Toolbox | Cartography.



          Start this tool and give 6 (any number of colors you want to have) in the Minimum number of colors and hit Run. It will return a new layer Colored with an additional integer field color_id.



          So the last step is to open the Layer Property of this layer and set Categorized color scheme on the color_id column (field). You then change each of these 6 random colors to your rainbow palette.



          enter image description here






          share|improve this answer












          As you are using QGIS 3.4.2, you can use Topological coloring Tool, which is in the Processing Toolbox | Cartography.



          Start this tool and give 6 (any number of colors you want to have) in the Minimum number of colors and hit Run. It will return a new layer Colored with an additional integer field color_id.



          So the last step is to open the Layer Property of this layer and set Categorized color scheme on the color_id column (field). You then change each of these 6 random colors to your rainbow palette.



          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 9 at 8:20









          Kazuhito

          14.3k31576




          14.3k31576











          • The new color id are random, I need then to be from the bottom up like the flag.
            – Nitzan Matan
            Dec 9 at 8:41











          • Sorry @NitzanMatan I honestly do not understand your comment. Could you expound it a little bit more?
            – Kazuhito
            Dec 9 at 8:58










          • Sure, in your answer you made 6 colored id, They are scattered randomly. In group 1 there are row both in Africa and the U.S. I need that Russia and Canada will be one color, U.S and Europe and so on. Thanks!
            – Nitzan Matan
            Dec 9 at 9:10






          • 1




            Aah, color bands like the flag? Gotcha! Thanks @NitzanMatan for clarification.
            – Kazuhito
            Dec 9 at 9:15










          • Great, thanks a lot
            – Nitzan Matan
            Dec 9 at 9:17
















          • The new color id are random, I need then to be from the bottom up like the flag.
            – Nitzan Matan
            Dec 9 at 8:41











          • Sorry @NitzanMatan I honestly do not understand your comment. Could you expound it a little bit more?
            – Kazuhito
            Dec 9 at 8:58










          • Sure, in your answer you made 6 colored id, They are scattered randomly. In group 1 there are row both in Africa and the U.S. I need that Russia and Canada will be one color, U.S and Europe and so on. Thanks!
            – Nitzan Matan
            Dec 9 at 9:10






          • 1




            Aah, color bands like the flag? Gotcha! Thanks @NitzanMatan for clarification.
            – Kazuhito
            Dec 9 at 9:15










          • Great, thanks a lot
            – Nitzan Matan
            Dec 9 at 9:17















          The new color id are random, I need then to be from the bottom up like the flag.
          – Nitzan Matan
          Dec 9 at 8:41





          The new color id are random, I need then to be from the bottom up like the flag.
          – Nitzan Matan
          Dec 9 at 8:41













          Sorry @NitzanMatan I honestly do not understand your comment. Could you expound it a little bit more?
          – Kazuhito
          Dec 9 at 8:58




          Sorry @NitzanMatan I honestly do not understand your comment. Could you expound it a little bit more?
          – Kazuhito
          Dec 9 at 8:58












          Sure, in your answer you made 6 colored id, They are scattered randomly. In group 1 there are row both in Africa and the U.S. I need that Russia and Canada will be one color, U.S and Europe and so on. Thanks!
          – Nitzan Matan
          Dec 9 at 9:10




          Sure, in your answer you made 6 colored id, They are scattered randomly. In group 1 there are row both in Africa and the U.S. I need that Russia and Canada will be one color, U.S and Europe and so on. Thanks!
          – Nitzan Matan
          Dec 9 at 9:10




          1




          1




          Aah, color bands like the flag? Gotcha! Thanks @NitzanMatan for clarification.
          – Kazuhito
          Dec 9 at 9:15




          Aah, color bands like the flag? Gotcha! Thanks @NitzanMatan for clarification.
          – Kazuhito
          Dec 9 at 9:15












          Great, thanks a lot
          – Nitzan Matan
          Dec 9 at 9:17




          Great, thanks a lot
          – Nitzan Matan
          Dec 9 at 9:17

















          draft saved

          draft discarded
















































          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%2f305455%2fa-fast-way-to-color-polygon-with-200-row-with-six-selected-color-in-qgis-3-4-2%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






          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay