search for: spatialpolygons

Displaying 20 results from an estimated 34 matches for "spatialpolygons".

2009 Mar 21
3
Retrieving Vertices Coordinates from SpatialPolygons
Dear List, I'm trying to use different R packages for my Teaching Assistantship classes. And I cam out to an (apparently) very simple problem. I would like to retrieve the vertices coordinate of a SpatialPolygon data. I know this is stored in the "coords" slot, but I can't get access to it! I tried to coerce the SpatialPolygon into a data.frame but it doesn't work.
2018 Jun 01
1
rasterize SpatialPolygon object using a RasterBrick object
...ygon(10*cbind(c(5,4,2,5),10*c(2,3,2,2))) Sr3 = Polygon(10*cbind(c(4,4,5,10,4),c(5,3,2,5,5))) Sr4 = Polygon(10*cbind(c(5,6,6,5,5),c(4,4,3,3,4)), hole = TRUE) Srs1 = Polygons(list(Sr1), "s1") Srs2 = Polygons(list(Sr2), "s2") Srs3 = Polygons(list(Sr3, Sr4), "s3/4") SpP = SpatialPolygons(list(Srs1,Srs2,Srs3), 1:3) plot(b[[1]]) plot(SpP, add = T) # crop clip1 = crop(b, extent(SpP)) # rasterize returns an error, but documentation says it should return a RasterBrick object clip2 = rasterize(SpP, b, mask = T) Error in v[, r] <- rrv : number of items to replace is not a multipl...
2005 Dec 30
1
How extract the names of ID in SpatialPolygons object
Hi dear user, Anybody can tell me how extract the names of ID in SpatialPolygons object, I am try to link a data frame attributes with spatial polygons, but the row names of data frame is not the same that ID poligons. Thank for all Fernando [[alternative HTML version deleted]]
2006 Dec 30
1
plot methods in sp
Dear listers, I am working since a while with the sp package and still wonder how the plot methods are managed with sp spatial objects. For instance, SpatialPolygonsDataFrame objects have obviously a plot method. However it cannot be found in the list provided by methods(plot) . Furthermore ?plot.SpatialPolygonsDataFrame, nor ?plot.SpatialPolygons, etc.. provide a help, though the lattice function spplot is adequately documented. On the other hand, plot(myo...
2011 Feb 11
1
Extract a slot value from a 'SpatialPolygons' class object
Dear R-users, I’m currently trying to extract the value of a slot (area) but can’t find out how to do that. >str(overlperc) List of 1 $ :Formal class 'SpatialPolygons' [package "sp"] with 4 slots .. ..@ polygons :List of 1 .. .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots .. .. .. .. ..@ Polygons :List of 1 .. .. .. .. .. ..$ :Formal class 'Polygon' [package "sp"] with 5 slots .. .. .. .....
2017 Jun 01
3
[spatstat] Convert shapefile to pixel image
...ly working with the spatstat package, using windows and pixel images. First: My aim is to transform a shapefile (see attached) into a pixel image. My idea is to start transforming the shapefile into a Spatial Polygon file: x <- readShapeSpatial("200001441.shp") y <- as(x, "SpatialPolygons") z <- as.owin(y) Given z, I want to identify each polygon with a single constant value. This is like adding marks to the SpatialPolygons file. Then I want to convert these polygons into an image, such that the value of each pixel corresponds to the value associated to the polygon where th...
2013 Jan 04
1
SpatialPolygon with the max value gets no color assigned in spplot function when using "at" parameter
...Polygon(p1)), ID="ps1") ps2=Polygons(list(Polygon(p2)), ID="ps2") ps3=Polygons(list(Polygon(p3)), ID="ps3") ps4=Polygons(list(Polygon(p4)), ID="ps4") ps5=Polygons(list(Polygon(p5)), ID="ps5") ps6=Polygons(list(Polygon(p6)), ID="ps6") sps = SpatialPolygons(list(ps1,ps2,ps3, ps4, ps5, ps6)) spdf= SpatialPolygonsDataFrame(sps,data.frame(weight=c(0.1,0.1,0.3,0.4,0.45,0.6),row.names=c("ps1","ps2","ps3","ps4", "ps5","ps6"))) sp.theme(set = TRUE, regions = list(col = brewer.pal(4,"RdYlGn&quo...
2017 Jun 01
0
[spatstat] Convert shapefile to pixel image
...windows and pixel images. > > First: > > My aim is to transform a shapefile (see attached) into a pixel image. > > My idea is to start transforming the shapefile into a Spatial Polygon file: > > x <- readShapeSpatial("200001441.shp") > y <- as(x, "SpatialPolygons") > z <- as.owin(y) > > Given z, I want to identify each polygon with a single constant value. This is like adding marks to the SpatialPolygons file. Then I want to convert these polygons into an image, such that the value of each pixel corresponds to the value associated to the p...
2008 Feb 04
1
how to get points from SpatialPolygonsDataFrame
Um texto embutido e sem conjunto de caracteres especificado associado... Nome: n?o dispon?vel Url: https://stat.ethz.ch/pipermail/r-help/attachments/20080203/5ea1e3ad/attachment.pl
2017 Jun 01
0
[spatstat] Convert shapefile to pixel image
...ly working with the spatstat package, using windows and pixel images. First: My aim is to transform a shapefile (see attached) into a pixel image. My idea is to start transforming the shapefile into a Spatial Polygon file: x <- readShapeSpatial("200001441.shp") y <- as(x, "SpatialPolygons") z <- as.owin(y) Given z, I want to identify each polygon with a single constant value. This is like adding marks to the SpatialPolygons file. Then I want to convert these polygons into an image, such that the value of each pixel corresponds to the value associated to the polygon where th...
2009 Jul 16
2
Problems generating image from tiff file
...t rather than being able to see the geographic features, it is just a monocolor blob. My suspicion is that since it is a list of coordinates and another column that contains attributes, I need to turn it into a polygon. I've tried the following codes but none work: > rasterprojection2<-SpatialPolygons(rasterprojection) Error in is.vector(X) : trying to get slot "Polygons" from an object of a basic class ("integer") with no slots rasterprojection2<- Polygons(rasterprojection) Error in as.vector(x, "list") : cannot coerce type 'S4' to vector of type &...
2006 Feb 23
0
adehabitat version 1.4
...ass "traj" is now deprecated. Note that the data set "puechcirc" is now of the class ltraj. - The functions making the interface with the package "sp" have been updated: 'area2spol' converts an object of class 'area' into an object of class 'SpatialPolygons'. 'spol2area' converts an object of class 'SpatialPolygons' or 'SpatialPolygonsDataFrame' into an object of class 'area'. 'attpol2area' gets the data attribute of an object of class 'SpatialPolygonsDataFrame' and stores is into a data f...
2006 Feb 23
0
adehabitat version 1.4
...ass "traj" is now deprecated. Note that the data set "puechcirc" is now of the class ltraj. - The functions making the interface with the package "sp" have been updated: 'area2spol' converts an object of class 'area' into an object of class 'SpatialPolygons'. 'spol2area' converts an object of class 'SpatialPolygons' or 'SpatialPolygonsDataFrame' into an object of class 'area'. 'attpol2area' gets the data attribute of an object of class 'SpatialPolygonsDataFrame' and stores is into a data f...
2006 Jan 07
1
maptools, write.polylistShape
Dear Roger, I am trying to use the write.polylistShape() function of maptools for the first time and realize that it handles list of polygons of class 'polylist'. However, it seems that no as.polylist() function exist in the package. The question behind that is: in your opinion, which would be the best way to convert a list of matrix of polygon nodes coordinates into an object of
2014 Oct 17
1
Holding a large number of SEXPs in C++
...ck().push_back(Polygon(b, e)); } private: Regions regions; }; where the reference_type of Iter is convertible to Point. In practice I use pointers in a couple of places to avoid resizing in push_back becoming too expensive. To construct the corresponding sp::Polygon, sp::Polygons and sp::SpatialPolygons at the end of the algorithm, I iterate over the result turning each Polygon into a two column matrix and calling the C functions corresponding to the 'constructors' for these objects. This is all working fine, but I could cut my memory consumption in half if I could construct the sp::Polyg...
2012 Aug 15
1
shade overlapping portions of circles (or other shapes)
I'm making some illustrations and it would be convenient to automatically shade the overlapping portions of circles. These illustrations are for Social Choice theory, a field in political science and economics. I've wrestled together some examples so you can see what I mean, but have not mastered the "color overlapping sections" problem (as you will see):
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
4
Pregunta sobre manipulación de shapefile
...oscar.perpinan en upm.es > To: fjroar en hotmail.com > CC: r-help-es en r-project.org > Subject: Re: [R-es] Pregunta sobre manipulación de shapefile > Date: Wed, 8 Oct 2014 19:01:29 +0200 > > > Hola, > > Cuando usas readShapPoly obtienes un 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("...
2010 Jan 13
0
New sp release
The sp package provides class definitions for spatial data, and utilities for spatial data handling and manipulation. The release of sp version 0.9-56 introduces changes in the ways in which Polygon, Polygons, and SpatialPolygons objects are created, moving from R code to compiled C code. Because of these changes, it is possible that users will see changed output. The package maintainers have tested as far as possible, and a beta release has been checked by some users, without any problems coming to light. Further deta...
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