Statalist


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

Re: st: Tmap: "invalid file specification"


From   Scott Merryman <scott.merryman@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Tmap: "invalid file specification"
Date   Tue, 22 Dec 2009 15:12:34 -0600

This works for me:

cd "C:\Documents and Settings\Scott_2\Desktop\foo"
shp2dta using  s_01au07, database(usdb) coordinates(uscoord) genid(id) replace
use stats,clear
merge scode using trans, sort unique
tab _m
drop _merge
merge id using usdb, sort unique
drop if _merge!=3
tmap choropleth pop1990 if NAME!="Alaska" & NAME!="Hawaii",  id(id)
map(uscoord.dta) palette(Blues)


1.  Do you have version 2 of tmap.  The boundary file format changed
slightly from version 1 to 2.

2.  You will need to add the option -cmiss(n)- to where tmap calls
-twoway area- .  About line 540.

3.  -tmap- was replaced by -spmap-.

Scott


On Tue, Dec 22, 2009 at 2:18 PM, Dorothy Bridges <dbstata@gmail.com> wrote:
> Dear Statalist,
>
> When I run a program based on the "Working with tmap" instructions
> (http://www.stata.com/support/faqs/graphics/tmap.html), I get the
> error message "invalid file specification" following the "tmap"
> command.  In an attempt to figure out what was going on, I ran the
> exact code (using the same files) suggested in the "Working with tmap"
> instructions.  My exact code is copied below.  The files are the same
> files used in the Stata example (and are available online).  Still, I
> get "invalid file specification" after the tmap line.
>
> I'd very much appreciate any suggestions.
>
> Sincerely,
> Dorothy
>
> clear
> set mem 500m
> cd "\\data4\users10\DKronick\My Documents\Dorothy\Giovanni"
>
> *Create files from map shapefile
> shp2dta using s_01au07, database(usdbtrial) coordinates(uscoordtrial)
> genid(id) replace
> *Note: s_01au07 is available at
> http://www.nws.noaa.gov/geodata/catalog/national/html/us_state.htm
>
> *Merge id variable with population data file (data of interest)
> use stats, clear
> merge scode using trans, sort unique
> drop _merge
>
> *Merge data of interest with map data
> merge id using usdbtrial, sort unique
> tab _merge
> drop if _merge!=3
>
> *Draw map
> tmap choropleth pop1990, id(id) map(uscoordtrial.dta) palette(Blues)

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index