[GRASS-user] Export specific shapes from a vector file

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Mon Feb 16 16:31:11 EST 2009


On Mon, 2009-02-16 at 13:14 -0800, leonidas wrote:
> Thank you Niko,
> well I understand the first one (using v.extract).
> -Is it possible to do something like that using v.out.ogr and export to
> shapefile?

AFAIK, no. The way to do it is: v.extract + v.out.ogr


> -As far as concerns the second question using v.to.rast, how can I export
> only specific areas using sql where clause or list for specific categories?

Apologies, I overlooked the word "specific" before. Here (again) I think
you would need v.extract + v.to.rast. An example:

Let's say you have the CORINE map in whose attribute table you have a
column named "level3" of type integer (with a lentgh of 3) which
contains the CORINE land cover class codes (111,112,113, etc.).

And now you need to extract specific classes, that is areas with
specific "level3" codes (i.e. 111, 112, 122, 123, 141, 142). Then you
could do:

v.extract in=corine_ellas_v2 out=corine_ellas_v2_subset
where='"level3"="111" or "level3"="112" or "level3"="112" or
"level3"="122" or "level3"="123" or "level3"="141" or "level3"="142"'
--o

then

v.to.rast in=corine_ellas_v2_subset out=corine_ellas_v2_subset use=attr
column=level3

Hope that helps
Cheers, Nikos



More information about the grass-user mailing list