[GRASS-dev] v.out.ascii features without category

Hi all,

`v.out.ascii` (G7) doesn't export features without categories.

v.random out=n n=10 --o
v.category in=n out=n1 opt=del cat=-1 --o
v.out.ascii n1
WARNING: No points found, nothing to be exported

Is there any reason why `v.out.ascii` ignores features without
category? I would suggest to export also features without categories.
Probably also to add new flag "Export only features with category".

What do you think?

Martin

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

Hi,

On 04/10/2013 11:44 AM, Martin Landa wrote:

Hi all,

`v.out.ascii` (G7) doesn't export features without categories.

v.random out=n n=10 --o
v.category in=n out=n1 opt=del cat=-1 --o
v.out.ascii n1
WARNING: No points found, nothing to be exported

Is there any reason why `v.out.ascii` ignores features without
category? I would suggest to export also features without categories.
Probably also to add new flag "Export only features with category".

What do you think?

Hmmm, difficult:
In GRASS 6.4.x, v.out.ogr also exports all features by
default, so making the suggested change would improve
consistency there.

But: in GRASS 7 the default behaviour of v.out.ogr
was reversed in this respect ...

Maybe v.out.ascii should follow the convention
of v.out.ogr in each respective GRASS version?

Cheers,

Ben

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

--
Dr. Benjamin Ducke, M.A.
{*} Geospatial Consultant
{*} GIS Developer

   benducke@fastmail.fm

On Wed, Apr 10, 2013 at 11:44 AM, Martin Landa <landa.martin@gmail.com> wrote:

Hi all,

`v.out.ascii` (G7) doesn't export features without categories.

v.random out=n n=10 --o
v.category in=n out=n1 opt=del cat=-1 --o
v.out.ascii n1
WARNING: No points found, nothing to be exported

Is there any reason why `v.out.ascii` ignores features without
category? I would suggest to export also features without categories.
Probably also to add new flag "Export only features with category".

Try v.out.ascii n1 layer=-1

Default is layer=1 which means only features with a category in layer
1 are exported.

Markus M

What do you think?

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Hi,

2013/4/10 Markus Metz <markus.metz.giswork@gmail.com>:

Is there any reason why `v.out.ascii` ignores features without
category? I would suggest to export also features without categories.
Probably also to add new flag "Export only features with category".

Try v.out.ascii n1 layer=-1

Default is layer=1 which means only features with a category in layer
1 are exported.

it will not help.

v.random out=n n=9 --o
v.category in=n out=n1 opt=del cat=1 --o
v.category in=n1 out=n2 opt=del cat=2 --o
v.category in=n2 out=n3 opt=add cat=1 layer=2 id=2 --o

v.category in=n out=n4 opt=del cat=-1 --o

v.category n3 opt=report -g
2 point 1 1 1
2 all 1 1 1
1 point 7 3 9
1 all 7 3 9

v.category n4 opt=report -g
-

v.out.ascii n4
WARNING: No points found, nothing to be exported

v.out.ascii n4 layer=-1
WARNING: No points found, nothing to be exported

with the attached patch

v.out.ascii n4
WARNING: 9 features without category skipped
WARNING: No points found, nothing to be exported

v.out.ascii n4 -n
670755.23990231|227618.61631252
620883.1020781|226045.94127863
638523.42465594|215548.98640595
631947.37828546|233349.16461906
666867.49326076|222508.09307827
658560.98004952|215292.28603514
677636.85184101|217348.6624036
660936.63949697|196528.06251007
625663.81562346|242921.76110523

v.out.ascii n3
638523.42465594|215548.98640595|3
631947.37828546|233349.16461906|4
666867.49326076|222508.09307827|5
658560.98004952|215292.28603514|6
677636.85184101|217348.6624036|7
660936.63949697|196528.06251007|8
625663.81562346|242921.76110523|9
WARNING: 2 features without category skipped <- id=1,2

v.out.ascii n3 -n
670755.23990231|227618.61631252
638523.42465594|215548.98640595|3
631947.37828546|233349.16461906|4
666867.49326076|222508.09307827|5
658560.98004952|215292.28603514|6
677636.85184101|217348.6624036|7
660936.63949697|196528.06251007|8
625663.81562346|242921.76110523|9
WARNING: 1 features without category skipped <- id=2

v.out.ascii n3 layer=2
620883.1020781|226045.94127863|1
WARNING: 8 features without category skipped <- id=1,3-9

670755.23990231|227618.61631252
620883.1020781|226045.94127863|1
WARNING: 7 features without category skipped <- id=3-9

Btw, is there a way how to delete more categories in one step?

v.category in=n out=n1 opt=del cat=1 --o

works, but how to delete in one step more cats, eg.

v.category in=n out=n1 opt=del cat=1-2 --o

will not work because `cat` accepts only one value and not the range.

Martin

(attachments)

v-category-no-cats.diff (6.92 KB)

Hi,

2013/4/10 Benjamin Ducke <benducke@fastmail.fm>:

let's focus on GRASS 7 only.

But: in GRASS 7 the default behaviour of v.out.ogr
was reversed in this respect ...

(btw, what is the reason why `v.out.ogr`'s behaviour was changed).

Maybe v.out.ascii should follow the convention
of v.out.ogr in each respective GRASS version?

Could be, in v.in.ogr the flag is named 'c'. In v.out.ascii there is
already 'c' flag.

  -c Include column names in output (points mode)

So the flag would need to have different name then 'c' (confusing for the user).

Martin

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

On Wed, Apr 10, 2013 at 9:17 PM, Martin Landa <landa.martin@gmail.com> wrote:

Hi,

2013/4/10 Markus Metz <markus.metz.giswork@gmail.com>:

Is there any reason why `v.out.ascii` ignores features without
category? I would suggest to export also features without categories.
Probably also to add new flag "Export only features with category".

Try v.out.ascii n1 layer=-1

Default is layer=1 which means only features with a category in layer
1 are exported.

it will not help.

v.random out=n n=9 --o
v.category in=n out=n1 opt=del cat=1 --o
v.category in=n1 out=n2 opt=del cat=2 --o
v.category in=n2 out=n3 opt=add cat=1 layer=2 id=2 --o

v.category in=n out=n4 opt=del cat=-1 --o

v.category n3 opt=report -g
2 point 1 1 1
2 all 1 1 1
1 point 7 3 9
1 all 7 3 9

v.category n4 opt=report -g
-

v.out.ascii n4
WARNING: No points found, nothing to be exported

v.out.ascii n4 layer=-1
WARNING: No points found, nothing to be exported

with the attached patch

The patch is too complicated, try r55697 with v.out.ascii n4 layer=-1.

v.out.ascii n4
WARNING: 9 features without category skipped
WARNING: No points found, nothing to be exported

v.out.ascii n4 -n
670755.23990231|227618.61631252
620883.1020781|226045.94127863
638523.42465594|215548.98640595
631947.37828546|233349.16461906
666867.49326076|222508.09307827
658560.98004952|215292.28603514
677636.85184101|217348.6624036
660936.63949697|196528.06251007
625663.81562346|242921.76110523

v.out.ascii n3
638523.42465594|215548.98640595|3
631947.37828546|233349.16461906|4
666867.49326076|222508.09307827|5
658560.98004952|215292.28603514|6
677636.85184101|217348.6624036|7
660936.63949697|196528.06251007|8
625663.81562346|242921.76110523|9
WARNING: 2 features without category skipped <- id=1,2

v.out.ascii n3 -n
670755.23990231|227618.61631252
638523.42465594|215548.98640595|3
631947.37828546|233349.16461906|4
666867.49326076|222508.09307827|5
658560.98004952|215292.28603514|6
677636.85184101|217348.6624036|7
660936.63949697|196528.06251007|8
625663.81562346|242921.76110523|9
WARNING: 1 features without category skipped <- id=2

v.out.ascii n3 layer=2
620883.1020781|226045.94127863|1
WARNING: 8 features without category skipped <- id=1,3-9

670755.23990231|227618.61631252
620883.1020781|226045.94127863|1
WARNING: 7 features without category skipped <- id=3-9

Btw, is there a way how to delete more categories in one step?

v.category in=n out=n1 opt=del cat=1 --o

works, but how to delete in one step more cats, eg.

v.category in=n out=n1 opt=del cat=1-2 --o

will not work because `cat` accepts only one value and not the range.

Martin

Hi,

2013/4/11 Markus Metz <markus.metz.giswork@gmail.com>:

2013/4/10 Markus Metz <markus.metz.giswork@gmail.com>:

Is there any reason why `v.out.ascii` ignores features without
category? I would suggest to export also features without categories.
Probably also to add new flag "Export only features with category".

Try v.out.ascii n1 layer=-1

OK, I just added message to warn user that some features were skipped.

v.out.ascii n4
9 features without category skipped. To export also features without
category use 'layer=-1'.
WARNING: No points found, nothing to be exported

Martin