[GRASS-dev] v.centroid: on boundaries only?

Hi all.
The current command for v.centroid in the grass qgis plugin is:

<qgisgrassmodule label="Add missing centroids to closed boundaries" module="v.centroids">
        <option key="input" layermask="0" typemask="area"/>
        <option key="output"/>
        <option key="option" answer="add" hidden="yes"/>
        <option key="cat" answer="1"/>
        <option key="step" answer="1"/>
</qgisgrassmodule>

Am I right saying that it should be
typemask="boundary"
?

Thanks for the advice.
--
Paolo Cavallini - Faunalia
www.faunalia.eu
Full contact details at www.faunalia.eu/pc

On 27/01/12 13:14, Paolo Cavallini wrote:

Hi all.
The current command for v.centroid in the grass qgis plugin is:

<qgisgrassmodule label="Add missing centroids to closed boundaries" module="v.centroids">
         <option key="input" layermask="0" typemask="area"/>
         <option key="output"/>
         <option key="option" answer="add" hidden="yes"/>
         <option key="cat" answer="1"/>
         <option key="step" answer="1"/>
</qgisgrassmodule>

Am I right saying that it should be
typemask="boundary"
?

typemask is not an option for v.centroid, but a grass-plugin specific parameter. What does it do ?

If you give v.centroid a map with some areas (i.e. boundaries + centroids) and some boundaries (i.e. without centroids), it will just add centroids to the boundaries without centroids.

Moritz

Paolo wrote:

The current command for v.centroid in the grass
qgis plugin is:

<qgisgrassmodule label="Add missing centroids to closed
boundaries" module="v.centroids">
<option key="input" layermask="0" typemask="area"/>
<option key="output"/>
<option key="option" answer="add" hidden="yes"/>
<option key="cat" answer="1"/>
<option key="step" answer="1"/>
</qgisgrassmodule>

Am I right saying that it should be
typemask="boundary"
?

I'm not exactly sure what typemask= does, but by
looking at qgis/src/plugins/grass/qgsgrassmodule.cpp
it seems that it can only be one of point,line,area.

note the boundaries themselves are not acted upon,
and v.centroids is a simple wrapper around
v.category option=add type=area

label="Add missing centroids to closed
boundaries"

might be expanded with "... to create areas"

Hamish

Hi,

2012/1/27 Moritz Lennert <mlennert@club.worldonline.be>:

<qgisgrassmodule label="Add missing centroids to closed boundaries"
module="v.centroids">
<option key="input" layermask="0" typemask="area"/>
<option key="output"/>
<option key="option" answer="add" hidden="yes"/>
<option key="cat" answer="1"/>
<option key="step" answer="1"/>
</qgisgrassmodule>
Am I right saying that it should be
typemask="boundary"

no, `v.centroids` goes through all areas and adds centroid if area has
no centroid assigned.

typemask is not an option for v.centroid, but a grass-plugin specific
parameter. What does it do ?

AFAIU, it's related to `type` parameter. `typemask` filters vector
maps which contains given type, ie. in this case only vector maps
which contains at least one area (closed set of boundaries) are shown
in combo box.

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

Il 27/01/2012 13:37, Moritz Lennert ha scritto:

typemask is not an option for v.centroid, but a grass-plugin specific parameter. What
does it do ?

it filters out the type of maps that appears on the list.

--
Paolo Cavallini - Faunalia
www.faunalia.eu
Full contact details at www.faunalia.eu/pc

Il 27/01/2012 13:42, Martin Landa ha scritto:

AFAIU, it's related to `type` parameter. `typemask` filters vector
maps which contains given type, ie. in this case only vector maps
which contains at least one area (closed set of boundaries) are shown
in combo box.

ok, so the current set of options seem right.
thanks a lot.

--
Paolo Cavallini - Faunalia
www.faunalia.eu
Full contact details at www.faunalia.eu/pc

Moritz ha scritto:

typemask is not an option for v.centroid, but a grass-plugin
specific parameter. What does it do ?

Paolo:

it filters out the type of maps that appears on the list.

Martin:

AFAIU, it's related to `type` parameter. `typemask` filters vector
maps which contains given type, ie. in this case only vector maps
which contains at least one area (closed set of boundaries) are shown
in combo box.

Paolo:

ok, so the current set of options seem right.

but v.centroids is important for cases when there are no valid areas.

e.g. a dxf line map deliniating land parcels converted to boundaries
with v.type.

Hamish

On Fri, Jan 27, 2012 at 9:57 PM, Hamish <hamish_b@yahoo.com> wrote:

Moritz ha scritto:

typemask is not an option for v.centroid, but a grass-plugin
specific parameter. What does it do ?

Paolo:

it filters out the type of maps that appears on the list.

Martin:

AFAIU, it's related to `type` parameter. `typemask` filters vector
maps which contains given type, ie. in this case only vector maps
which contains at least one area (closed set of boundaries) are shown
in combo box.

Paolo:

ok, so the current set of options seem right.

but v.centroids is important for cases when there are no valid areas.

e.g. a dxf line map deliniating land parcels converted to boundaries
with v.type.

Areas without a centroid are valid areas. If the dxf lines converted
to boundaries do not form closed areas, there are no areas. Martin and
Paolo are right.

Markus M