Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: spmap & water


From   "Carolina Herrera" <[email protected]>
To   <[email protected]>
Subject   st: spmap & water
Date   Thu, 1 Jul 2010 15:06:35 -0700

Hi everyone, 
 
I'm trying to produce a heat map of the state of California using -spmap- and -shp2data-.  However, when I use the options as described on http://www.stata.com/support/faqs/graphics/spmap.html <http://www.stata.com/support/faqs/graphics/spmap.html>   I have problems producing the county level polygons for the Bay Area.  San Francisco Bay doesn't appear and half the city of San Francisco appears to be floating off the coast. I've checked for missing counties and I don't believe that is the problem.  My GIS savvy colleagues tell me that water is often not in the *.shp and *.dbf files but I'm not sure how to integrate other mapping files into my Stata code. Has anyone else encountered this problem?
 
There are the relevant bits of code. 
* create my databases from the shapefile
shp2dta using CA_county, database(cacounty2db) coordinates(cacounty2coord) genid(id)
*rename county identifier in order to produce merge
gen fipscd=CNTY_FIPS
sort fipscd
save cacounty2db.dta, replace
 
*merge onto my main dataset
merge fipscd using cacounty2db.dta, sort uniqusing
 
*Heat Maps
foreach x of local yrsthree {
 foreach y of local sets{
  spmap u_`y' using cacountycoord if year==`x', id(id) fcolor(Blues2) 
graph export u`y'`x'.tif,replace
  spmap p_`y' using cacountycoord if year==`x', id(id) fcolor(Blues2) 
graph export p`y'`x'.tif,replace
}
} 
 
many thanks in advance,
Carolina
 
Carolina Herrera, MA
The Center for the Health Professions
University of California, San Francisco

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index