Re: [R-sig-Geo] densify geometries
geosphere functions makeLine and makePoly do this, but only for lon/lat, not for planar coordinates. Robert On Fri, Aug 7, 2015 at 6:30 AM, Michael Sumner mdsum...@gmail.com wrote: This is a nice idea with gBuffer, but testing on a simple case shows you need explicit curvature to get any extra verts. library(rgeos) 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), SpatialPoints)) 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 englishchristoph...@gmail.com wrote: 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 mdsum...@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@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Re: [R-sig-Geo] densify geometries
This is a nice idea with gBuffer, but testing on a simple case shows you need explicit curvature to get any extra verts. library(rgeos) 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), SpatialPoints)) 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 englishchristoph...@gmail.com wrote: 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 mdsum...@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@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[R-sig-Geo] densify geometries
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@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Re: [R-sig-Geo] densify geometries
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 mdsum...@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@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo