Skip to content

How to crop a shapefile ?

3 messages · Dan Putler, Roger Bivand, Baptiste Coulmont

#
Hi all,

For this particular problem, Dylan Beaudette is probably exactly right.
However, I ran into problems using similar tools in OpenJump when we
wanted to create a shapefile of a region that we could postal address
geocode against (the way the boundary line segments were clipped was a
problem for the geocoder), which lead me to write tools in R to do it
(outlined in my earlier post). That code does not clip lines, rather it
enable the extraction of the original complete road segments. Since most
of the ways in OSM don't have the attribute information needed for
geocoding, the issue I was addressing won't be relevant here.

Besides GRASS (which can be a bit overwhelming at first), and OpenJump
(mentioned above), the Clip tool within the fTools plug-in for QGIS
should also work. Given the size of the OSM road network files, a
machine with a fair amount of memory will probably be needed to handle
the problem.

Dan
On Thu, 2009-12-17 at 10:27 -0800, Dylan Beaudette wrote:
#
On Thu, 17 Dec 2009, Dan Putler wrote:

            
It also looks as though the clipping capabilities of ogr2ogr will increase 
when GDAL 1.7.0 arrives - the beta is already available:

http://www.gdal.org/ogr2ogr.html
http://download.osgeo.org/gdal/gdal-1.7.0b1.tar.gz

In addition, something like this might be a candidate for rgeos (on 
R-Forge) but would involve C coding in the GEOS C API.

Roger

  
    
#
Many thanks to everyone !
On Thu, Dec 17, 2009 at 8:47 PM, Roger Bivand <Roger.Bivand at nhh.no> wrote: