Announcement

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

  • Drawing maps: command _fr_area_parse_and_log is unrecognized

    Hi all,

    This is the first time I'm trying to draw maps on stata using "india_st.shp" and "india_st.dbf". I'm using Stata 15.
    I used
    Code:
    spshape2dta india_st
    to create two .dta files
    Code:
    file india_st_shp.dta created
      file india_st.dta     created
    Following this guide I next did
    Code:
    clear
    
    . use india_st.dta
    encode STATE,gen (state)
    spmap  using  "india_st_shp.dta",  id(state)  ocolor(black)  osize(vthin)
    But this is giving me errors
    Code:
    command _fr_area_parse_and_log is unrecognized
    r(199);
    I'm also getting warning
    system limit exceeded - see manual
    I would greatly appreciate it if someone could help me out here. Thanks


  • #2
    One problem, I believe, is that you are not using the ID variable created by -spshape2dta-.

    Here is an example (using Ben Jann's -palettes package to generate the colors , https://github.com/benjann/palettes/)
    Code:
    clear
    copy https://biogeo.ucdavis.edu/data/diva/adm/IND_adm.zip ind_adm.zip ,replace
    unzipfile ind_adm.zip, replace
    spshape2dta  IND_adm1, replace
    colorpalette viridis, n(9) nograph
    local colors `r(p)'
    use IND_adm1
    spmap _ID using IND_adm1_shp, id(_ID) /// 
      fcolor("`colors'") osize(0.04 ..) cln(9) legend(off)
    Click image for larger version

Name:	india_state.png
Views:	1
Size:	191.7 KB
ID:	1651672

    Comment


    • #3
      Originally posted by Scott Merryman View Post
      One problem, I believe, is that you are not using the ID variable created by -spshape2dta-.

      Here is an example (using Ben Jann's -palettes package to generate the colors , https://github.com/benjann/palettes/)
      Code:
      clear
      copy https://biogeo.ucdavis.edu/data/diva/adm/IND_adm.zip ind_adm.zip ,replace
      unzipfile ind_adm.zip, replace
      spshape2dta IND_adm1, replace
      colorpalette viridis, n(9) nograph
      local colors `r(p)'
      use IND_adm1
      spmap _ID using IND_adm1_shp, id(_ID) ///
      fcolor("`colors'") osize(0.04 ..) cln(9) legend(off)
      [ATTACH=CONFIG]n1651672[/ATTACH]
      Thanks a lot Scott! You were right. I kept thinking state is the relevant id variable. I ran it with the ID generated by spshape2 and it worked perfectly.

      Also, thanks for the pallettes package. It would be extremely useful.

      Comment

      Working...
      X