search for: readshapepoly

Displaying 20 results from an estimated 35 matches for "readshapepoly".

2012 Oct 10
2
mapa municipios Andalucía con R
Hola a todos. Estoy utilizando R , más concretamente los paquetes maptools y sp, para realizar mapas de España por comunidades y provincias y de Andalucía por provincias y municipios. El caso es que para el mapa de municipios en Andalucía, una vez leído el fichero shp con readShapePoly , si luego por ejemplo , quiero poner todos los polígonos de un color utilizando library(maps) library(maptools) library(sp) and_muni <- readShapePoly(fn="ccaa00c01.shp") plot(and_muni,col="red") Obtengo casi todos los polígonos en rojo excepto 2. El más llamativo es un po...
2013 Sep 19
3
How do I ensure that the polygon in spatstat::owin(poly=<polygon>) does not have “negative area”
...x = rev(mass.map$x), y = rev(mass.map$y))) : Polygon data contain duplicated vertices and self-intersection Then I figured that maybe the polygon returned by map() is not meant to be fed to owin(). So I tried loading a massachusetts shape file (I am totally taking guesses at this point).: x <- readShapePoly("../Geog/OUTLINE25K_POLY") ## The shape file for MASS, loaded from MassGIS website mass.poly <- x <- readShapePoly("../Geog/OUTLINE25K_POLY", force_ring=T, delete_null_obj=T) ## I got following error whether or not I used force_ring mass.owin <- as(mass.poly, "ow...
2010 May 06
1
extracting coordinates from SpatialPolygonsDataFrame using slot functions
...$Shapes[[1]]$verts[1:(nrow(bdry$Shapes[[1]]$verts)-1),1], y=bdry$Shapes[[1]]$verts[1:(nrow(bdry$Shapes[[1]]$verts)-1),2] ) bdry.owin <- owin( poly=bdry.poly ) grid <- gridcentres( bdry.owin, 200, 200 ) I've run across the following problem where I now need to use the readShapePoly function in the sp package: bdry2 <- readShapePoly( "../../data/boundary.shp" ) which requires the elements be accessed using the slot function? My question, after trying to find the answer on-line and in some docs, is how? Help? Also, I'm not sure I get the r-help digests, s...
2009 Nov 06
4
map of a country and its different geographical levels
Hi R users I need the map of France?s ? communes ? (towns) to build a map Is there a way to get it? More generally: How to do to get the map of a country and its different geographical levels? Best regards -- View this message in context: http://old.nabble.com/map-of-a-country-and-its-different-geographical-levels-tp26225645p26225645.html Sent from the R help mailing list archive at
2010 Jun 09
1
[R-sig-Geo] How to extract coordinates values from a shapefile?
...> > > > nikhil.list@gmail.com > > > > On Jun 9, 2010, at 2:45 PM, Thiago Veloso wrote: > > > > > Dear R colleagues, > > > Does anyone know if it's possible to create a vector with > > coordinate values extracted from a shape loaded with readShapePoly > > command of "maptools" package? > > > For example, the following code loads the shapefile containing > > Brazilian states division: > > > library(maptools)br<-readShapePoly("BR-map/3.shp") > > > What I need to do is create a vecto...
2012 Jul 03
1
Questions about imports to a namespace
...the answer to some of these is 'it depends', but I'm interested in what others think and 'best practices' when this is the case. 1) If I use an import or importFrom declaration in a NAMESPACE, should I also qualify the package in calls to the imported function (e.g. maptools::readShapePoly)? 2) If the 'best practice' is to qualify the calls, when does one stop; e.g. is it good/bad to say base::sapply? 3) If one is calling a (S3) generic, should one qualify the namespace? Can this cause problems? 4) Is it better to check for arguments that are missing, or use a default valu...
2009 Feb 06
1
Introduction to maps (of Denmark)?
Dear R-listers, I am using R for Windows Vista 64-bit. I have no experience working with maps, but now I have to plot a map of Denmark in which each Danish county is color-coded according to its incidence rate of a particular disease. My problem is that I don't know where to start. I have read the help files to packages like 'mapplot', and their examples indicate that I am on the
2013 Jan 29
1
points rejected as lying outside the specified window
Hello, I am using the following code to create ppp files from csv data and map shape files, but I am getting some errors which I have been unable to fix by searching them online: library(spatstat) library(maps) library(maptools) NYC2<-readShapePoly("nybb.shp") # this is a map of the NYC boroughs without waterways and no census tract divisions (but it does include lines separating the 5 boroughs) plot(NYC2) NYBorough<-readShapePoly("NYBoroughsShapeMerge.shp") # this is a map of the NYC boroughs with census tract divisio...
2007 Dec 09
1
spatstat questions
Um texto embutido e sem conjunto de caracteres especificado associado... Nome: n?o dispon?vel Url: https://stat.ethz.ch/pipermail/r-help/attachments/20071209/130cf9d6/attachment.pl
2012 Dec 29
1
Problem to load a shape file
...m a connection. Does anyone here can give a reasonable answer? When I try the following script I got this error: Error in getinfo.shape(fn) : Error opening SHP file #Reproduction temp <- tempfile() download.file("http://metodologiapolitica.com/download/Brasil.zip",temp) shp.br <- readShapePoly(unzip(temp, "Brasil.shp")) unlink(temp) Just for acknowledgement, I successful can load the file whenever I open it from the disk.
2007 Jan 17
1
sp: proj4string has no impact
Hi all, I'm faced with a problem applying the sp package: The projection argument in readShapePoly(Shapefile,proj4string="CRS class argument") e.g.: CRS("+proj=aea +lat_1=46 +lat_2=73 +lat_0=60 +lon_0=84 +x_0=0 +y_0=0 +ellps=clrk66 +units=m +no_defs") doesn't have any impact on the plotted object. I also tested the simple example: xy = cbind(x = 2 * runif(100) - 1, y...
2013 Jun 06
1
Error invalid graphics state using text()
...shortest way to the finishing line, but I'm a starter and happy about every finish. ;) I'm really hoping for some helpful comments! library(maptools) library(fields) library(raster) library(rgdal) library(RColorBrewer) library(rgeos) library(pixmap) library(classInt) library(sp) NUTS2<-readShapePoly("xxx.shp") shareub2012 <- read.csv("xxx.csv", header=TRUE, sep = ";", dec = ",",stringsAsFactors=F) mergeshareub2012 <- merge(shareub2012, NUTS2, by.x = "Bundesland", by.y = "NAME" ) sortmergeshare2012 <- mergeshareub2012[order(me...
2010 Jun 05
1
Issues with unionSpatialPolygons on Ubuntu
...may be an issue for linux (never had this problem on my windows machine...) I recently made the switch to Ubuntu 10.04 (lucid), and found that unionSpatialPolygons() gives me the following error when trying to combine polygons within a shapefile: # Read in shapefile and merge polygons foo <- readShapePoly("foo.shp", proj4string = CRS("+init=epsg:2272")) IDs <- as.character(foo$ID) SP_out <- unionSpatialPolygons(foo, IDs) Error: isTRUE(gpclibPermitStatus()) is not TRUE I've seen some posts about a package "rgeos" which may have something to do with this error...
2006 Oct 18
1
conversion of LL coordenates to UTM problems (ED50-WGS84 format)
Hi R-Users, I have plotted a region whose polygon coordinates are given in shp format ED50 UTM (zone=30) ) using "readShapePoly" in library(maptools). Now I need to plot a set of points in that region (my.dataframe, with X and Y geographic coordinates), which have been read using GPS in Longitud-Latitud form (using WGS84 system), so I first need to convert these Longitud-Latitud data into UTM data. To do so, I use pac...
2014 Oct 08
4
Pregunta sobre manipulación de shapefile
...o de clase > SpatialPolygonsDataFrame. Si lo que necesitas es añadir nuevas columnas, > puedes hacerlo como harías con cualquier data.frame. Usando el ejemplo > que viene en su página de ayuda, añado una nueva variable llamada test: > > library(maptools) > xx <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1], > IDvar="FIPSNO", proj4string=CRS("+proj=longlat +ellps=clrk66")) > xx$test <- rnorm(nrow(xx)) > > También te puede interesar la función spCbind, que te permite unir un >...
2014 Oct 08
2
Pregunta sobre manipulación de shapefile
...objeto de clase > SpatialPolygonsDataFrame. Si lo que necesitas es añadir nuevas columnas, > puedes hacerlo como harías con cualquier data.frame. Usando el ejemplo > que viene en su página de ayuda, añado una nueva variable llamada test: > > library(maptools) > xx <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1], > IDvar="FIPSNO", proj4string=CRS("+proj=longlat +ellps=clrk66")) > xx$test <- rnorm(nrow(xx)) > > También te puede interesar la función spCbind, que te permite unir un > Spa...
2011 Jul 14
1
plotting x y z data from an irregular grid
...43157 -3.543378 perc_per_year_upper sig 1 0.4786508 -999.000000 2 -0.8588293 -3.181006 3 -1.5251377 -3.226076 4 11.0957982 -999.000000 5 0.3431518 -999.000000 6 -0.7966338 -2.144316 #read in the shapefile england<-readShapePoly('D:/arcGIS/england boundary/england.shp') class(england) #define the projection proj4string(england)<-CRS('+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.999601271625 +x_0=400000 +y_0=-100000 +ellps=airy +units=m +no_defs') # transform the map into the WGS84 projection (epsg:4326): england...
2006 Oct 07
3
merge and polylist
Greetings: I would like to kindly ask for a little help. The rough code is: #________________________________________________________ dat=data.frame(read.delim(file="all.txt", header = TRUE, sep = "\t", quote="\"", dec=".",na.strings = "NA")) nc=read.shape("astae.shp", dbf.data=TRUE, verbose=TRUE) mappolys=Map2poly(nc) submap
2014 Oct 08
3
Pregunta sobre manipulación de shapefile
Hola buenos días: Hace algún tiempo mandé una duda que sobre fichero tipo shapefile que publica el Instituto Geográfico Nacional de España y que detallo en el word Duda_sobre_shp. El tema es que al final no obtuve respuesta (es cierto que lo mandé en Agosto y en esa fechas entiendo que sea normal, por tanto por recomendación de un conocido vuelvo de nuevo a remitir la cuestión) Como no podía
2005 Sep 26
1
merge maps from shapefile to lattice
Hi everybody: Could anybody help how I solve the next problem?. I'm doing interpolation maps of tropospheric ozone of my region, and after create it using IDW, and kriging methods, I want from shapefiles (*.shx, *.shp, *.dbf, *.sbx & *.sbn ) create contour over the interpolation maps. Could anybody tell me how do it?. Thanks in advance. ###################################### Antonio