Announcement

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

  • Problem with SPMAP Basemap

    Hello!

    I've been having a problem with SPMAP's basemap for quite a while now. It seems that, while using the same file for the basemap, the map is drawn differently for various datasets I put on top. I cannot figure out why one draws the complete basemap whereas the other only draws some of the provinces. I have attached my files, which are described as follows:
    • graph2.dta - the data file for my first graph which does not draw the complete basemap
    • graph3.dta - the data file for my second graph which does draw the complete basemap
    • drc_coord.dta - the basemap file

    Code:

    use graph2, clear
    spmap using drc_coord.dta, id(vid) point(xcoord(longitude) ycoord(latitude) by(cert) fcolor(BuPu) size(small small) legenda(on))

    use graph3, clear
    spmap using drc_coord.dta, id(villageid) point(xcoord(longitude) ycoord(latitude) size(small small small small))


    Thanks!
    Samuel
    Attached Files

  • #2
    Hello again! Does anyone happen to have some insight about this problem? Thanks in advance for the help!

    Comment


    • #3
      Hey Samuel,

      it seems that there are not the same coordinates/villages in both datasets and that in the first one some villages are missing. Thus, the basemap is incomplete. The following code is a work-around but better carefully examine why some villages are missing in the first place.


      Code:
      * Use dataset 2
      use graph2.dta, clear
      
      * Merge with dataset 3 to have all possible villages
      rename vid villageid
      merge 1:1 villageid using graph3.dta
      
      * Create the map
      spmap using drc_coord.dta, id(villageid) point(xcoord(longitude) ycoord(latitude) by(cert) fcolor(BuPu) size(small small) legenda(on))
      Best,
      Sebastian

      Comment


      • #4
        Hi Sebastian,

        Thanks for getting back to me. However, I am aware that graph2 and graph3 have different coordinates. I was hoping to graph the two different sets of coordinates on the same basemap (DRC provinces). When I run it, I do get the correct data points, but somehow the DRC map in the background is complete for graph3, but is missing several provinces for graph2. I have pasted the two images below. The first one is graph2 and the second is graph3. Do you have any idea why this could be happening? Thanks again!

        Best,
        Samuel

        Comment


        • #5
          Sorry, the images did not come through. Here are the images as attachments.
          Attached Files

          Comment

          Working...
          X