[R-sig-Geo] How to crop a shapefile ?
renaud.lancelot at cirad.fr
Thu Dec 17 18:47:05 CET 2009
I recently met a similar issue, and ended to the solution described here
(unfortunately, it's in French :-)):
It uses point.in.polygon (package sp), and it is adapted to the special
case of the shapefile containing polygons. Perhaps you can adapt it for
polylines, possibly reversing the test (points of the lines falling into
the area of interest for you).
I would be interested to hear about any alternative / better solution.
All the best,
Baptiste Coulmont a écrit :
> I'm working with R and various shapefiles created by the OpenStreetMap
> project. Those shapefiles (the roads in particular) are quite big.
> How can I crop (or "trim", or "prune" those objects -- once in a
> SpatialLineDataFrame -- if I need to work not on a national level but
> on a municipal level ?
> Is it possible to create a subset of a smaller zone ?
> min max
> r1 2.560776 6.403847
> r2 49.493613 51.505419
> B. Coulmont
EDEN Project, coordinator
<< EDEN International Conference, Montpellier, 10-12 May 2010 >>
<< http://international-conference2010.eden-fp6project.net/ >>
UMR CIRAD-INRA "Contrôle des maladies animales exotiques et émergentes"
Joint research unit "Control of emerging and exotic animal diseases"
CIRAD, Campus International de Baillarguet TA A-DIR / B
Tel. +33 4 67 59 37 17 - Fax +33 4 67 59 37 95
Secr. +33 4 67 59 37 37 - Cell. +33 6 77 52 08 69
More information about the R-sig-Geo