Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

Re: st: spmap & water

From   Maurizio Pisati <>
Subject   Re: st: spmap & water
Date   Fri, 02 Jul 2010 09:43:09 +0200

If you have another shapefile defining the polygons that represent water, then you can (a) convert it to the -spmap- format using -shp2dta-, and (b) add these water polygons to your map using option -polygon- (and, possibly, option -polyfirst-).
Best wishes,
Maurizio Pisati

Il 02/07/10 00.06, Carolina Herrera ha scritto:
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<>    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 Herrera, MA
The Center for the Health Professions
University of California, San Francisco

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index