Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Drawing an n class map using merged data and spmap command and options and agriculture data

    Hi Statalist users;

    I have this data in hand:
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input int ID float(x_centroid y_centroid) str21 delegation int(forage silage greenfodder fodderseeds) byte _merge
    103 645740.1   4054447 "BENI KHALLED"     150 120   67  15 3
     86 658415.8   4043640 "BENI KHIAR"         .   .    .   . 1
    101 641337.9 4043444.5 "BOU ARGOUB"       500   0   75   0 3
     87 652314.5   4042953 "DAR CHAABANE"       .   .    .   . 1
     89 670731.5   4091291 "EL HAOUARIA"     2620   0 2250  65 3
     83 665135.9   4065032 "EL MIDA"          555   5  408  40 3
    102 629273.3 4049610.5 "GROMBALIA"        550  80  206  40 3
     81 684200.4   4088900 "HAMMAM GHEZAZE"   275   0  522  15 3
    100 633880.6   4032543 "HAMMAMET"         820   0  330   0 3
     82 680216.3   4082860 "KELIBIA"         1050   0  660  10 3
     85 661669.3   4053786 "KORBA"            790   0  310  25 3
    104 649132.5   4062233 "MENZEL BOUZELFA" 1000   0  458 120 3
     84 670452.8   4074543 "MENZEL TEMIME"   1350  40 1670  40 3
     88 650455.3   4037900 "NABEUL"           320   0  114   0 3
     79 636384.9   4065126 "SOLIMAN"          280   0   80  20 3
     80 650102.3   4074666 "TAKELSA"         1070 100  160 100 3
    end
    label values _merge _merge
    label def _merge 1 "master only (1)", modify
    label def _merge 3 "matched (3)", modify
    What I wanna do is draw a map for each of the agriculture types (forrage, silage, greenfodder and fodderseeds) of the region I'am working on (those geographical data and names are for its delegations) showing, for each agriculture type, its concentration through the whole region map using color degradation, I'm just wondering how many data classes I should use for each indicator (3 classes or 4 classes or even less or more?), just So I could know which delegation has an advantage in which agriculture type.

    Is it possible to get some help please?

  • #2
    You can generate color polygons by categories using the
    Code:
    polygon( ... by())
    option (see the helpfile of spmap).

    BUT, if you want to also color grade within categories, then you need to generate the map manually from scratch since this goes beyond spmap's current capabilities. I have a written a guide on this:

    Reprogramming Maps

    Comment


    • #3
      Asjad Naqvi Thanks Although, I was thinking more of classifying each type of agriculture into like 3 of 4 or even 5 classes (depending on the data) and then using the:
      spmap map using dcoord, name(del_col2) id(ID) fcolor(Blues2) clmethod(unique) label(x(x_centroid) y(y_centroid) l(classe)) Smething like that, I don't know if it is the right solution tho, but it seems to me likely that it could work.

      Comment

      Working...
      X