search for: polygons

Displaying 20 results from an estimated 900 matches for "polygons".

Did you mean: polygon
2009 Mar 02
2
Need help extracting info from XML file using XML package
I have an XML file that has within it the coordinates of some polygons that I would like to extract and use in R. The polygons are nested rather deeply. For example, I found by trial and error that I can extract the coordinates of one of them using functions from the XML package: doc <- xmlInternalTreeParse('doc.kml') docroot <- xmlRoot(doc)...
2015 Apr 02
2
Mapas con spplot
Hola He hecho el típico mapa con gadm y spplot: library(sp) ES <- local(get(load(url("http://biogeo.ucdavis.edu/data/gadm2/R/ESP_adm2.RData ")))) acerco las canarias: A <- which(ES en data$NAME_1 == "Islas Canarias") L <- length(ES en polygons[[A]]@Polygons) L <- length(ES en polygons[[A]]@Polygons) for (i in 1:L){ ES en polygons[[A]]@Polygons[[i]]@coords <- cbind(ES en polygons [[A]]@Polygons[[i]]@coords[,1]+6,ES en polygons [[A]]@Polygons[[i]]@coords[,2]+5) } El tema es q quiero añadirle un recuadro a las islas usando spplot...
2016 Apr 27
1
Determine if a set of x and y-latitude points are inside of a polygon using R
Objective: Determine if a set of x and y-latitude points are inside of a polygon using R. Lets say I have 9 polygons. Where I have labeled the polygons to be checked from 1-9. The problem I?m running into is running the point.in.polygon to check if those points are in one of several polygons, as my code overwrites the result. To accomplish this I am using the R-built in function called point.in.polygon. Point.in...
2013 Sep 19
3
How do I ensure that the polygon in spatstat::owin(poly=<polygon>) does not have “negative area”
...K_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, "owin") Checking 1006 polygons...1, Polygon 1 contains duplicated vertices [Checking polygon with 91844 edges...] 2, 3, .. [etd 1:21:52] ....10 [etd 36:12] ..... [etd 23:10] ....20 [etd 16:59] ..... [etd 13:22] ....30 [etd 11:01] ..... [etd 9:21] ....40 [etd 8:06] ..... [etd 7:09] ....50 [etd 6:23] ..... [etd 5:46] ....60 [etd 5...
2016 Apr 27
4
polygon angle option perpendicular to axis
I am trying to use the angle option in polygon to create polygons filled with horizontal and vertical lines. The polygons I am crating are irregular and it the angle function appears to set the angle of the shading perpendicular to the polygon sides rather than perpendicular to the axes. Is there any way to set the angle relative to the axes rather than relativ...
2003 Aug 13
6
placing labels in polygon center ?
Dear all, is there any function to calculate the center of a polygon mass in R? Actually I need to find the best location within polygons to place labels. Thanks for any hint Jens Oehlschl?gel -- COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test\ --------...{{dropped}}
2008 May 19
2
Draw Polygon with a Circular Side
Hello Friends!!! I would want draw a circular histogram, and I would like draw a polygon with a circular side. This is easy if I use the functions polygon and arc, but I want that the polygon with a circular side have background colour. The polygon created with function polygon can have background colour, but the surface created with function arc can?t have background colour. How I could create a
2017 Jun 01
3
[spatstat] Convert shapefile to pixel image
...ing 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...
2015 Apr 03
0
Mapas con spplot
...pico mapa con gadm y spplot: > > > library(sp) > ES <- > local(get(load(url("http://biogeo.ucdavis.edu/data/gadm2/R/ESP_adm2.RData > ")))) > > acerco las canarias: > > A <- which(ES en data$NAME_1 == "Islas Canarias") > L <- length(ES en polygons[[A]]@Polygons) > > L <- length(ES en polygons[[A]]@Polygons) > for (i in 1:L){ > ES en polygons[[A]]@Polygons[[i]]@coords <- cbind(ES en polygons > [[A]]@Polygons[[i]]@coords[,1]+6,ES en polygons > [[A]]@Polygons[[i]]@coords[,2]+5) > } > > El tema es q quiero añad...
2014 Oct 17
1
Holding a large number of SEXPs in C++
Background: I have an algorithm which produces a large number of small polygons (of the spatial kind) which I would like to use within R using objects from sp. I can't predict the exact number of polygons a-priori, the polygons will be grouped into regions, and each region will be filled sequentially, so an appropriate C++ 'framework' (for the point of illustration...
2010 Apr 29
1
Request - adding recycled "lwd" parameter to polygon
...<- col if (is.logical(border)) { if (!is.na(border) && border) border <- col else border <- NA } start <- 1 ends <- c(seq_along(xy$x)[is.na(xy$x) | is.na(xy$y)], length(xy$x) + 1) num.polygons <- length(ends) col <- rep(col, length.out = num.polygons) border <- rep(border, length.out = num.polygons) lty <- rep(lty, length.out = num.polygons) lwd <- rep(lwd, length.out = num.polygons) density <- rep(density, length.out = num.polygo...
2010 Apr 29
1
Request - adding recycled "lwd" parameter to polygon
...<- col if (is.logical(border)) { if (!is.na(border) && border) border <- col else border <- NA } start <- 1 ends <- c(seq_along(xy$x)[is.na(xy$x) | is.na(xy$y)], length(xy$x) + 1) num.polygons <- length(ends) col <- rep(col, length.out = num.polygons) border <- rep(border, length.out = num.polygons) lty <- rep(lty, length.out = num.polygons) lwd <- rep(lwd, length.out = num.polygons) density <- rep(density, length.out = num.polygo...
2016 Apr 28
1
polygon angle option perpendicular to axis
...iversity College Station, TX 77840-4352 -----Original Message----- From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Greg Snow Sent: Thursday, April 28, 2016 9:50 AM To: Simon, Heather Cc: r-help at r-project.org Subject: Re: [R] polygon angle option perpendicular to axis Filling polygons with lines is a throwback to the time when the height of quality graphics was the mechanical pen plotter (a device that used a pen in a mechanical arm to draw the plot on a piece of paper). Computing and printing technology has advanced quite a bit from that day, so you may want to reconsider why y...
2007 Feb 15
4
integrate over polygon
Hi there, I want to integrate a function over an irregular polygon. Is there any function which can implement this easily? Otherwise, I am thinking of divide the polygon into very small rectangles and use "adapt" to approximate it. Do you have any suggestions to get the fine division? Any advice is appreciated. Haiyong
2010 May 14
1
point.in.polygon() in sp package: accuracy problems?
Dear list: I encountered some problems using the function point.in.polygon() of the sp package, when trying to determine whether some points lye inside, outside, on the border or on a vertice of a polygon. I have a list of point I know should lye right on the border of a polygon, but some of them are not classified as such by point.in.polygon() (see the example code below). To make a long story
2008 Aug 15
6
continuous coloring of a polygon
R2.7.1, WinXP Hi, I have a polygon inside a circle as follows: radius <- 3 x <- seq(-radius,radius,length=2000) y <- sqrt(radius^2-x^2) xx <- c(x,-x) yy <- c(y,-y) plot(xx,yy, xlim=c(-radius,radius),ylim=c(-radius,radius), type="l", ylab="", xlab="", axes=F) radius <- 2.7 x1 <- seq(-radius,radius,length=2000) y1 <- sqrt(radius^2-x1^2)
2016 Apr 28
0
polygon angle option perpendicular to axis
...Alspach -----Original Message----- From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Simon, Heather Sent: Thursday, 28 April 2016 8:17 a.m. To: r-help at r-project.org Subject: [R] polygon angle option perpendicular to axis I am trying to use the angle option in polygon to create polygons filled with horizontal and vertical lines. The polygons I am crating are irregular and it the angle function appears to set the angle of the shading perpendicular to the polygon sides rather than perpendicular to the axes. Is there any way to set the angle relative to the axes rather than relativ...
2016 Apr 28
0
polygon angle option perpendicular to axis
Filling polygons with lines is a throwback to the time when the height of quality graphics was the mechanical pen plotter (a device that used a pen in a mechanical arm to draw the plot on a piece of paper). Computing and printing technology has advanced quite a bit from that day, so you may want to reconsider why y...
2008 Feb 17
1
random location in polygons sp spsample splancs csr
Dear all, I had to place points at random, one in each of larger number of polygons (actually in objects of class 'SpatialPolygonsDataFrame' , see sp library), and tried first to do it using spsample (from sp). Surprisingly, every 5-15 trials, the output was a NULL value. The doc says that ' this may occur when trying to hit a small and awkwardly shaped polygon i...
2012 Feb 16
2
Defining a viewport scale in {Grid}
Am just feeling my way into the grid library, and cannot figure out how to define the plot limits. 3/5 of the example polygons below plot in the default 0-1 range viewport. But when I try to redefine the viewport the polygons plot in the same places. I also get the same result without employing push/pop. (As you can see from the scale I'm trying to introduce, I want to plot map polygons.) Grateful for an idea where...