[GRASS-user] help exporting complex vector files

Dear List,

I am looking for some advice on the best way to polygonise large raster layers into shapefile format
The context for this question is the need to creating a slope-class vector layer for land-use classification.

The following steps are what I am currently doing

  1. import SRTM data for the area I am interested in and then run r.fillnulls to fill the gaps
  2. run r.slope.aspect to generate a raster of slope (in percent)
  3. run r.reclass to classify the slope classes into 0-10%, 11-20%, 21-30% … 81-90%, 90-100% 100+%
  4. then run a r.neighbour with type=mode on a 3 by 3 window to smooth some of the salt and pepper effect away.
  5. then run r.to vect with the area flag to create a vector representation of slope
  6. This usually creates a vector with tens of thousands of polygons
  7. Then I run a v.out.ogr to create a shapefile

The last step is when I run into problems with 50 000 or more polygons. The shapefile tends to be corrupted with empty values in the dbf for slope and doesn’t reflect the vector file in the grass format.

The current work around is export the slope raster file as a tiff file. Import into arcgis then convert to shapefile. This approach im not happy with!! So any solutions would be greatly appreciated.

Kind regards

Andrew

andrew.haywood wrote:

I am looking for some advice on the best way to polygonise large
raster layers into shapefile format
The context for this question is the need to creating a slope-class
vector layer for land-use classification.

The following steps are what I am currently doing

import SRTM data for the area I am interested in and then run
r.fillnulls to fill the gaps
run r.slope.aspect to generate a raster of slope (in percent)
run r.reclass to classify the slope classes into 0-10%, 11-20%, 21-30%

.... 81-90%, 90-100% 100+%
then run a r.neighbour with type=mode on a 3 by 3 window to smooth
some of the salt and pepper effect away.
then run r.to vect with the area flag to create a vector
representation of slope
This usually creates a vector with tens of thousands of polygons
Then I run a v.out.ogr to create a shapefile

The last step is when I run into problems with 50 000 or more
polygons. The shapefile tends to be corrupted with empty values in
the dbf fo slope and doesn't reflect the vector file in the grass
format.

The current work around is export the slope raster file as a tiff
file. Import into arcgis then convert to shapefile. This approach im
not happy with!! So any solutions would be greatly appreciated.

I don't know about the v.out.ogr bug, but another trick instead of
r.neighbors would be "v.clean tool=rmarea" to remove areas with area
smaller than thresh=<>.

Hamish