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

2015-11-06 Thread Matt Strimas-Mackey
I've rewritten the script as an RMarkdown document and posted it on github: https://github.com/mstrimas/rgeos-scale The rendered html is here: https://htmlpreview.github.io/?https://github.com/mstrimas/rgeos-scale/blob/master/rgeos-scale.html If you or Colin Rundel want to modify this or use it

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

2015-11-06 Thread Roger Bivand
Matt: Thanks very much for this. I think that it would make an excellent vignette for rgeos, maybe you could consider using Markdown on your existing script to explain to the reader what they might expect? I'd also bring in Colin Rundel, as it was his insight that uncovered the scale "can of

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

2015-11-05 Thread Roger Bivand
On Thu, 5 Nov 2015, Roger Bivand wrote: On Wed, 4 Nov 2015, Matt Strimas-Mackey wrote: The original study area shapefile is a boundary of the Indonesia half of New Guinea. The file as well as the code to construct the hexagonal grids are here:

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

2015-11-05 Thread Matt Strimas-Mackey
Thanks for explaining this in such detail! I have a greater appreciation for the importance of thinking about these topological issues and for the role machine precision plays. I constructed a series of simple examples to demonstrate to myself how these sorts of problems arise and how setScale,

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

2015-11-04 Thread Roger Bivand
On Wed, 4 Nov 2015, Matt Strimas-Mackey wrote: The original study area shapefile is a boundary of the Indonesia half of New Guinea. The file as well as the code to construct the hexagonal grids are here: https://www.dropbox.com/sh/ff8v08p3ambqcbs/AAAPBlGP4fthdmZhrto7oIuCa?dl=0 Since it's a

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

2015-11-04 Thread Roger Bivand
On Wed, 4 Nov 2015, Michael Sumner wrote: Thanks for all this detail Roger, is there a way to "re-build" a spatial object so that the given scale setting is applied? Are there any general rounding or "orthogonalize" functions in the Spatial suite? No, not really. In this case, the very

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

2015-11-04 Thread Michael Sumner
On Thu, 5 Nov 2015 at 01:10 Roger Bivand wrote: > On Wed, 4 Nov 2015, Michael Sumner wrote: > > > Thanks for all this detail Roger, is there a way to "re-build" a spatial > > object so that the given scale setting is applied? Are there any general > > rounding or

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

2015-11-04 Thread Michael Sumner
Thanks for all this detail Roger, is there a way to "re-build" a spatial object so that the given scale setting is applied? Are there any general rounding or "orthogonalize" functions in the Spatial suite? Cheers, Mike. On Wed, 4 Nov 2015 at 18:16 Roger Bivand wrote: > On

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

2015-11-04 Thread Matt Strimas-Mackey
Thanks, lots of useful info here. I've never seen the setScale() function; I don't think it's mentioned in the gUnaryUnion help. This saves me a lot of headache! For what it's worth, the invalid geometry is an artifact of the reproducible example I created. The original hexagonal grid is produced

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

2015-11-04 Thread Roger Bivand
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 it's mentioned in the gUnaryUnion help. This saves me a lot of headache! For what it's worth, the invalid geometry is an artifact of the reproducible example

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

2015-11-04 Thread Matt Strimas-Mackey
The original study area shapefile is a boundary of the Indonesia half of New Guinea. The file as well as the code to construct the hexagonal grids are here: https://www.dropbox.com/sh/ff8v08p3ambqcbs/AAAPBlGP4fthdmZhrto7oIuCa?dl=0 Since it's a large area, generating the grid takes a long time, so

[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] gUnaryUnion Not Dissolving Correctly

2015-11-03 Thread Roger Bivand
On Tue, 3 Nov 2015, Matt Strimas-Mackey wrote: 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