Dear all, I am interested in plotting maps visualizing spatial statistics in an aggregated fashion, according to administrative boundaries. More specifically, I have fitted a cross-section model on data regarding Italian "counties" (province, for Italian readers) and I would like to visualize residual behavior on a map, in order to have a first assessment of their spatial autocorrelation. I would also make some EDA on the spatial patterns (if any) of the regressors. I have found the maps package (and related) and would be able to do what I want, e.g., for the USA, essentially by>map("state",fill=T,col=color)where color is dependent on the statistic of interest, but I still lack a data file for counties' boundaries in Italy. Does anybody know where to find one? Is there any convenient tool for converting from other formats? I would like to do everything in R if possible. Thanks in advance Giovanni Millo R&D Dept. Assicurazioni Generali SpA Trieste, Italy Ai sensi del D.Lgs.196/2003 si precisa che le informazioni contenute in questo messaggio sono riservate ed a uso esclusivo del destinatario. Qualora il messaggio in parola Le fosse pervenuto per errore, La invitiamo ad eliminarlo senza copiarlo e a non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie.<BR><BR>Pursuant to Legislative Decree No. 196/2003, you are hereby informed that this message contains confidential information intended only for the use of the addressee. If you are not the addressee, and have received this message by mistake, please delete it and immediately notify us. You may not copy or disseminate this message to anyone. Thank you. [[alternative HTML version deleted]]
On Mon, 16 Feb 2004, Millo Giovanni wrote:> Dear all, > > I am interested in plotting maps visualizing spatial statistics in an > aggregated fashion, according to administrative boundaries. > More specifically, I have fitted a cross-section model on data regarding > Italian "counties" (province, for Italian readers) and I would like to > visualize residual behavior on a map, in order to have a first > assessment of their spatial autocorrelation. I would also make some EDA > on the spatial patterns (if any) of the regressors. > > I have found the maps package (and related) and would be able to do what > I want, e.g., for the USA, essentially by > >map("state",fill=T,col=color) > where color is dependent on the statistic of interest, but I still lack > a data file for counties' boundaries in Italy. Does anybody know where > to find one? Is there any convenient tool for converting from other > formats? I would like to do everything in R if possible. >Unfortunately, while the US government makes available a large amount of free map data - such as administrative boundaries, this is certainly not the case in Europe. Of course, administrative boundaries also change, so the map data source you use should match the data you are trying to map. At least two proprietary GIS programs distribute maps of Italian provinces for use in their programs (MapInfo and ArcGIS), but I believe you need a license to access the data - it is (unlike US data) not downloadable. It is possible that you can use the data referenced in the RArcInfo contributed package, which is downloaded from: http://www.grid.unep.ch/data/grid/gnv158.php but these are NUTS 2 regions dating at latest from the early 1990's, and do not seem to be the same as the CIA Italian provinces map. So there are three questions: 1) finding a free (or non-free) source of boundary data appropriate for the provinces that suit your attribute data; 2) getting that into R (and possibly projecting it); 3) plotting the map. On 2 and 3, you may find http://sal.agecon.uiuc.edu/csiss/Rgeo/index.html useful, especially the sections on maps. It may be that your organisation has purchased suitable non-free boundary data - in which case a "shapefile" is probably the easiest format to ask for.> Thanks in advance > > Giovanni Millo > R&D Dept. > Assicurazioni Generali SpA > Trieste, Italy-- Roger Bivand Econonic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Breiviksveien 40, N-5045 Bergen, Norway, voice: +47-55959355, fax: +47-55959393; Roger.Bivand at nhh.no
> I am interested in plotting maps visualizing spatial statistics in an > aggregated fashion, according to administrative boundaries. > More specifically, I have fitted a cross-section model on dataregarding> Italian "counties" (province, for Italian readers) and I would like to > visualize residual behavior on a map, in order to have a first > assessment of their spatial autocorrelation. I would also make someEDA> on the spatial patterns (if any) of the regressors. > > I have found the maps package (and related) and would be able to dowhat> I want, e.g., for the USA, essentially by > >map("state",fill=T,col=color) > where color is dependent on the statistic of interest, but I stilllack> a data file for counties' boundaries in Italy. Does anybody know where > to find one? Is there any convenient tool for converting from other > formats? I would like to do everything in R if possible. > > Thanks in advance > > Giovanni Millo > R&D Dept.Dear Millo Giovanni: Attached is a zip file containing three files. The file 'italy.prov.pol' is a R/Splus format polygon file of the provinces. In this file, there are NA records in the $y column where the polygons end. The corresponding $x column are polygon identifiers. The file 'italy.prov.pat' has three columns: the first are the polygon identifiers used in 'italy.prov.pol', the second are the NUTS3 identifiers, and the third are the names. The file 'italy.prov.crf' has commas separating the fields. The file italy.prov.e00 is an arc/info export file of a polygon coverage of the province boundaries. This was extracted from the European NUTS3 file of third level political boundaries available at: http://www.grid.unep.ch/data/grid/gnv159.php. The R/S format files above were made from this arc/info file. All location coordinates in the above files are geographic (longitude, latitude). In Becker and Wilks document "Constructing a Geographical Database" that accompanies the 'maps' package there is a description of how to make a database that can be used by the maps package. I am not aware that anyone has made this capability available in R, and I have not done this either. You can read the .pol file like this: prov <- read.table ("italy.prov.pol", header=TRUE) You can then use this function: plot.map <- function (x, y) { rx <- range (x[!is.na(y)], na.rm=TRUE) ry <- range (y[!is.na(x)], na.rm=TRUE) plot.new () plot.window (rx, ry, asp=1) } and say plot.map (prov$x, prov$y) polygon (prov) You can read the .pat file like this: pat <- read.table ("italy.prov.pat", sep=",", header=TRUE, quote="") With this file you can connect the polygon boundaries in the .pol file with names in .pat and with your statistics. There is a crude mapping facility available in contributed package "maptree". Best wishes, Denis White US EPA, 200 SW 35th St, Corvallis, Oregon, 97333 USA voice: 541.754.4476, email: white.denis at epa.gov web: www.epa.gov/wed/pages/staff/white/ < attachment deleted>
Reasonably Related Threads
- upgraded maps database for italy?
- (no subject)
- Coloring Canada provinces (package maps?)
- code works in R desktop but not iin RWeb - How do I modify to get it working in RWeb, please?
- Change state names to abbreviations in an irregular list of names, abbreviations, null values, and foreign provinces