Jean-Luc. It is as you say, intersect returns Spatial*DataFrame objects whereas gIntersect does not the DataFrame bits. This pattern is also true for raster functions aggregate, union, erase, cover and crop (see section XIV in ?'raster-package') which all have their analogues in rgeos that they build on. intersect uses gIntersection so it should not be faster.
Robert On Thu, May 14, 2015 at 2:48 PM, Jean-Luc Dupouey <dupo...@nancy.inra.fr> wrote: > For intersecting two polygon layers, is there any advantage of using > gIntersection (from the rgeos package) instead of intersect (from the raster > package)? After a few tests, it appears that intersect is a little bit > faster. Moreover, intersect automatically calculates the associated > dataframe, while gIntersection leaves the user making it. > > Thanks for your awer(s). > > Jean-Luc > > _______________________________________________ > 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