[GRASS-dev] how to use v.clean()?

Markus Metz markus.metz.giswork at googlemail.com
Mon Nov 22 11:24:16 EST 2010


Olivier Tournaire wrote:
> Hi all,
> I am currently developping a plugin for QGis. My input data are shapefiles,
> and I would like to clean their geometries before doing some processing.
> v.clean() seems to do the job.
> However, I really have no idea on how to:
> 1) fill a grass vector layer with geometries readed in a qgis vector layer
> 2) call in my (c++) code v.clean()

Just for clarification, there is no v.clean() in case you are looking
for some function by this name. I can imagine two ways to achieve your
goal.
The easy way is to simply call the grass modules v.in.ogr (which does
topological polygon cleaning), v.clean for more cleaning, v.out.ogr.
The hard way would be to take the source code of these three modules,
translate it to C++ and adapt it to your needs, if this is possible
from within qgis.

Markus M


More information about the grass-dev mailing list