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











up vote
4
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
    4
    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
      4
      down vote

      favorite
      1









      up vote
      4
      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 20 hours ago









      Nitzan Matan

      1,5671027




      1,5671027






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          5
          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
            17 hours ago






          • 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
            17 hours ago




















          up vote
          2
          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
            18 hours ago












          • Sorry @NitzanMatan I honestly do not understand your comment. Could you expound it a little bit more?
            – Kazuhito
            18 hours ago










          • 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
            18 hours ago






          • 1




            Aah, color bands like the flag? Gotcha! Thanks @NitzanMatan for clarification.
            – Kazuhito
            18 hours ago










          • Great, thanks a lot
            – Nitzan Matan
            18 hours ago











          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',
          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
          5
          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
            17 hours ago






          • 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
            17 hours ago

















          up vote
          5
          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
            17 hours ago






          • 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
            17 hours ago















          up vote
          5
          down vote



          accepted







          up vote
          5
          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 17 hours ago









          Kazuhito

          14.1k31576




          14.1k31576












          • Very smart!, Can you explained more about the latitude range?
            – Nitzan Matan
            17 hours ago






          • 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
            17 hours ago




















          • Very smart!, Can you explained more about the latitude range?
            – Nitzan Matan
            17 hours ago






          • 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
            17 hours ago


















          Very smart!, Can you explained more about the latitude range?
          – Nitzan Matan
          17 hours ago




          Very smart!, Can you explained more about the latitude range?
          – Nitzan Matan
          17 hours ago




          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
          17 hours ago






          @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
          17 hours ago














          up vote
          2
          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
            18 hours ago












          • Sorry @NitzanMatan I honestly do not understand your comment. Could you expound it a little bit more?
            – Kazuhito
            18 hours ago










          • 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
            18 hours ago






          • 1




            Aah, color bands like the flag? Gotcha! Thanks @NitzanMatan for clarification.
            – Kazuhito
            18 hours ago










          • Great, thanks a lot
            – Nitzan Matan
            18 hours ago















          up vote
          2
          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
            18 hours ago












          • Sorry @NitzanMatan I honestly do not understand your comment. Could you expound it a little bit more?
            – Kazuhito
            18 hours ago










          • 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
            18 hours ago






          • 1




            Aah, color bands like the flag? Gotcha! Thanks @NitzanMatan for clarification.
            – Kazuhito
            18 hours ago










          • Great, thanks a lot
            – Nitzan Matan
            18 hours ago













          up vote
          2
          down vote










          up vote
          2
          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 19 hours ago









          Kazuhito

          14.1k31576




          14.1k31576












          • The new color id are random, I need then to be from the bottom up like the flag.
            – Nitzan Matan
            18 hours ago












          • Sorry @NitzanMatan I honestly do not understand your comment. Could you expound it a little bit more?
            – Kazuhito
            18 hours ago










          • 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
            18 hours ago






          • 1




            Aah, color bands like the flag? Gotcha! Thanks @NitzanMatan for clarification.
            – Kazuhito
            18 hours ago










          • Great, thanks a lot
            – Nitzan Matan
            18 hours ago


















          • The new color id are random, I need then to be from the bottom up like the flag.
            – Nitzan Matan
            18 hours ago












          • Sorry @NitzanMatan I honestly do not understand your comment. Could you expound it a little bit more?
            – Kazuhito
            18 hours ago










          • 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
            18 hours ago






          • 1




            Aah, color bands like the flag? Gotcha! Thanks @NitzanMatan for clarification.
            – Kazuhito
            18 hours ago










          • Great, thanks a lot
            – Nitzan Matan
            18 hours ago
















          The new color id are random, I need then to be from the bottom up like the flag.
          – Nitzan Matan
          18 hours ago






          The new color id are random, I need then to be from the bottom up like the flag.
          – Nitzan Matan
          18 hours ago














          Sorry @NitzanMatan I honestly do not understand your comment. Could you expound it a little bit more?
          – Kazuhito
          18 hours ago




          Sorry @NitzanMatan I honestly do not understand your comment. Could you expound it a little bit more?
          – Kazuhito
          18 hours ago












          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
          18 hours ago




          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
          18 hours ago




          1




          1




          Aah, color bands like the flag? Gotcha! Thanks @NitzanMatan for clarification.
          – Kazuhito
          18 hours ago




          Aah, color bands like the flag? Gotcha! Thanks @NitzanMatan for clarification.
          – Kazuhito
          18 hours ago












          Great, thanks a lot
          – Nitzan Matan
          18 hours ago




          Great, thanks a lot
          – Nitzan Matan
          18 hours ago


















          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

          Ellipse (mathématiques)

          Quarter-circle Tiles

          Mont Emei