Re: [R-sig-Geo] Fwd: dissolve tiny polygons to others with unionSpatialPolygons{maptools}

2016-06-06 Thread Matt Strimas-Mackey
Hi Kumar, Based on the exchange in the thread Roger referenced I wrote a blog post summarizing my understanding of these issue of scale and numerical precision when performing topological operations with rgeos. It doesn't address your issue directly, however, I think it will be of some value.

Re: [R-sig-Geo] Excessive whitespace in saved images from sp::plot()

2015-12-16 Thread Matt Strimas-Mackey
o idea why this is the case, but it works! M On Tue, Dec 15, 2015 at 2:22 PM, Matt Strimas-Mackey <stri...@zoology.ubc.ca > wrote: > Thanks for the suggestions. > > Here's what I tried based on what you said: > par(mar=c(0, 0, 0, 0)) > png('plot.png') > plot(square, axes = F, lwd

[R-sig-Geo] Excessive whitespace in saved images from sp::plot()

2015-12-15 Thread Matt Strimas-Mackey
I'm trying to plot simple SpatialPolygons objects using the basic plot() command from sp and save these as png or svg. For context, this is part of a rmarkdown report that will eventually go on the web, so the saving of images will be done automatically via knitr. Since this involves images, I've

Re: [R-sig-Geo] Excessive whitespace in saved images from sp::plot()

2015-12-15 Thread Matt Strimas-Mackey
be corrected on that point(?) > > Cheers, Mike > > > On Wednesday, December 16, 2015, Matt Strimas-Mackey < > stri...@zoology.ubc.ca> wrote: > > I'm trying to plot simple SpatialPolygons objects using the basic > > plot() command from sp and save these as

Re: [R-sig-Geo] gUnaryUnion Not Dissolving Correctly

2015-11-06 Thread Matt Strimas-Mackey
.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f > > Best wishes, > > Roger > > > On Fri, 6 Nov 2015, Matt Strimas-Mackey wrote: > >> Thanks for explaining this in such detail! I have a greater >> appreciation for the importanc

Re: [R-sig-Geo] gUnaryUnion Not Dissolving Correctly

2015-11-05 Thread Matt Strimas-Mackey
on(pp)) # finally, set_RGEOS_dropSlivers can be used to remove these slivers # and fix the topology set_RGEOS_dropSlivers(TRUE) pp <- rbind(p1, p3, p4, shift_poly(p2, 1e-4, 0)) plot(gUnaryUnion(pp)) set_RGEOS_dropSlivers(FALSE) On Thu, Nov 5, 2015 at 2:49 AM, Roger Bivand <roger.biv...@nhh.no> wr

Re: [R-sig-Geo] gUnaryUnion Not Dissolving Correctly

2015-11-04 Thread Matt Strimas-Mackey
rather than have many elements at parallels. The > Triangle library does not consider these hexagon coordinates to be > duplicates, so there are two vertical segments between the two bottom polys > at > > points(coordinates(as(as(spoly, "SpatialLines"), "SpatialPoints&q

Re: [R-sig-Geo] gUnaryUnion Not Dissolving Correctly

2015-11-04 Thread Matt Strimas-Mackey
(hex_union, border='orange', lwd=3, add=T) On Wed, Nov 4, 2015 at 8:57 AM, Roger Bivand <roger.biv...@nhh.no> wrote: > On Wed, 4 Nov 2015, Matt Strimas-Mackey wrote: > >> Thanks, lots of useful info here. I've never seen the setScale() >> function; I don't think

[R-sig-Geo] gUnaryUnion Not Dissolving Correctly

2015-11-03 Thread Matt Strimas-Mackey
I'm working with a regular hexagonal grid stored as SPDF. At some point I subset this SPDF, then want to combine all adjacent hexagons together so that each contiguous set of hexagons is a single polygon. I'm doing this last step using gUnaryUnion (or gUnionCascaded, not clear what the different

Re: [R-sig-Geo] using 'mask' versus 'crop' in raster

2015-08-10 Thread Matt Strimas-Mackey
Seems like you may have some other function called mask either defined by you or in another package loaded after raster. A couple things you could check: -just type mask (without quotes) in the console. The first line should say something like: standardGeneric for mask defined from package raster

Re: [R-sig-Geo] Distance from point to specified raster cell value

2015-07-06 Thread Matt Strimas-Mackey
Perhaps the rasterToPoints function is what you're after: http://www.inside-r.org/packages/cran/raster/docs/rasterToPoints gDistance(spatialpoints, rasterToPoints(r, fun=function(x) {x == 15})) On Mon, Jul 6, 2015 at 10:38 AM, Alexandre Lafontaine a_lafonta...@hotmail.com wrote: Dear members,

[R-sig-Geo] Include multiple SpatialPolygons objects in legend of spplot

2015-03-31 Thread Matt Strimas-Mackey
Hi, I have two shapefiles: one with polygons of plantations and another with polygons of protected areas. There are multiple types of plantations and multiple types of parks. I am able to plot both of these shapefiles on one map with spplot by including the second SPDF object in the sp.layout