[R-sig-Geo] densify geometries

Michael Sumner mdsumner at gmail.com
Fri Aug 7 15:30:38 CEST 2015

This is a nice idea with gBuffer, but testing on a simple case shows you
need explicit curvature to get any extra verts.

library(raster) ## just for the "cheat's" polygon creator
 x <- as(extent(0, 1, 0, 1), "SpatialPolygons")
plot(as(as(gBuffer(x, width = 0.1, quadsegs = 55), "SpatialLines"),

I want the extra vertices for curvature that's in the space traversed, not
defined by the segment.

Ultimately we need it to be driven by the right curve (great circle,
loxodrome, etc.) so geosphere is a good start - but still the simplest case
of inserting explicitly seems like an obvious gap here (pardon the pun),
even for GEOS?

Cheers, Mike.

On Fri, 7 Aug 2015 at 15:23 chris english <englishchristophera at gmail.com>

> Mike,
> I use rgeos::gBuffer for polygons akin to what you're seeking. Looking at
> the implementation of the
> quadsegs argument might aid you.  Don't know what to suggest for lines
> though I'm thinking the
> aggregation process in Trajectories might be of use.  I realize that
> aggregation suggests reducing
> rather than densifying but there many be an opportunity to inject
> arbitrary 'between' points to densify
> to lines.
> HTH. Chris
> On Thu, Aug 6, 2015 at 11:10 PM, Michael Sumner <mdsumner at gmail.com>
> wrote:
>> Hello, is there any existing function in the Spatial family in R to
>> "densify geometries"?
>> I'd like to be able specify the insertion of redundant vertices for all
>> individual segments within a Line* or Polygon*. I've done a bit myself but
>> wondering if this already exists somewhere.  This is a pretty standard
>> task
>> for reprojection in traditional GIS. Ultimately I would implement a
>> "minimum distance" option as well, just wondering if this is already out
>> there somewhere.
>> I know there are partial pieces of this, for instance in
>> raster::rasterToPolygons and rgeos::gDistance - are there others? - but I
>> want more control.
>> Cheers, Mike.
>>         [[alternative HTML version deleted]]
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

	[[alternative HTML version deleted]]

More information about the R-sig-Geo mailing list