[GRASS-user] Crop/limit a shapefile

Hi,

is it possible to crop a shapefile at some coordinates inside grass? I have a bigger area than what i want and i must limit the boundaries of this in some coordinates. If it isn’t possible, any other program (open source of course) to do this job and then import the limited file in grass?

Hi,

is it possible to crop a shapefile at some coordinates inside grass? I have a bigger area than what i want and i must limit the boundaries of this in some coordinates. If it isn’t possible, any other program (open source of course) to do this job and then import the limited file in grass?

In GRASS it can be done with 2 steps:
First set the current region to the boundaries of the smaller region with g.region:
g.region -p e- w= n= s=
Now create a polygon of the region extents:
v.in.region out=small_region
and finally with v.overlay you can clip the original to the smaller region:
v.overlay ain= bin=small_region out=clipped_shape

There are tools in the QGIS Vector (fTools) plugin to do the same…

On Tue, Sep 27, 2011 at 1:08 PM, Micha Silver <micha@arava.co.il> wrote:

On 27/09/2011 13:31, giannis Nj wrote:

Hi,

is it possible to crop a shapefile at some coordinates inside grass? I have
a bigger area than what i want and i must limit the boundaries of this in
some coordinates. If it isn't possible, any other program (open source of
course) to do this job and then import the limited file in grass?

In GRASS it can be done with 2 steps:
First set the current region to the boundaries of the smaller region with
g.region:
g.region -p e-<east bound> w=<west bound> n=<north> s=<south>
Now create a polygon of the region extents:
v.in.region out=small_region
and finally with v.overlay you can clip the original to the smaller region:
v.overlay ain=<original shape> bin=small_region out=clipped_shape

Or easier, set the cimputational region with e.g.:
g.region -p e-<east bound> w=<west bound> n=<north> s=<south>

then limit shapefile import to the current region:

v.in.ogr -r ...

Markus M

On Tue, Sep 27, 2011 at 1:12 PM, Markus Metz
<markus.metz.giswork@googlemail.com> wrote:

On Tue, Sep 27, 2011 at 1:08 PM, Micha Silver <micha@arava.co.il> wrote:

On 27/09/2011 13:31, giannis Nj wrote:

Hi,

is it possible to crop a shapefile at some coordinates inside grass?

...

Or easier, set the cimputational region with e.g.:
g.region -p e-<east bound> w=<west bound> n=<north> s=<south>

then limit shapefile import to the current region:

v.in.ogr -r ...

Added as new FAQ:
http://grass.osgeo.org/wiki/Crop_a_shapefile_during_import

Markus

It worked, thank you.

From: neteler@osgeo.org
Date: Tue, 27 Sep 2011 23:02:39 +0200
Subject: Re: [GRASS-user] Crop/limit a shapefile
To: markus.metz.giswork@googlemail.com
CC: grass-user@lists.osgeo.org

On Tue, Sep 27, 2011 at 1:12 PM, Markus Metz
markus.metz.giswork@googlemail.com wrote:

On Tue, Sep 27, 2011 at 1:08 PM, Micha Silver micha@arava.co.il wrote:

On 27/09/2011 13:31, giannis Nj wrote:

Hi,

is it possible to crop a shapefile at some coordinates inside grass?

Or easier, set the cimputational region with e.g.:
g.region -p e- w= n= s=

then limit shapefile import to the current region:

v.in.ogr -r …

Added as new FAQ:
http://grass.osgeo.org/wiki/Crop_a_shapefile_during_import

Markus


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user