Re: [GRASS-user] v.hull ignoring 'where' argument

2018-02-22 Thread Markus Metz
On Thu, Feb 22, 2018 at 9:10 PM, Martin Landa 
wrote:
>
> Hi,
>
> 2018-02-22 21:02 GMT+01:00 Markus Neteler :
> > I have added a related note to the v.hull manual page (maybe others
> > should be extended as well?).
>
> probably. The module could print a warning instead of silent ignoring
options.

+1
applies to other modules as well where the default layer is -1 and cats and
where options are available

Markus M
>
> Ma
>
> --
> Martin Landa
> http://geo.fsv.cvut.cz/gwiki/Landa
> http://gismentors.cz/mentors/landa
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] v.hull ignoring 'where' argument

2018-02-22 Thread Martin Landa
Hi,

2018-02-22 21:02 GMT+01:00 Markus Neteler :
> I have added a related note to the v.hull manual page (maybe others
> should be extended as well?).

probably. The module could print a warning instead of silent ignoring options.

Ma

-- 
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] v.hull ignoring 'where' argument

2018-02-22 Thread Markus Neteler
On Thu, Feb 22, 2018 at 12:39 PM, Markus Metz
 wrote:
> On Thu, Feb 22, 2018 at 10:05 AM, Helmut Kudrnovsky  wrote:
>> Vilem Ded wrote
...
>> > My questions:
>> > Is there a way how to effectively apply function(command) by group?
>> > Is the v.hull function supposed to work like this (ingnoring where and
>> > cat arguments)?

...

> From the manual:
> layer=string
> Layer number or name ('-1' for all layers)
> Default: -1
>
> You need to set the layer option to some positive number, otherwise all
> points from all layers will be used and the cats and where options are
> ignored.

I have added a related note to the v.hull manual page (maybe others
should be extended as well?).

markusN
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] v.hull ignoring 'where' argument

2018-02-22 Thread Markus Metz
On Thu, Feb 22, 2018 at 10:05 AM, Helmut Kudrnovsky  wrote:
>
> Vilem Ded wrote
> > Hi,
> > I have set of points with attribute table (let just say with column "A"
> > containing 1s and 2s).
> > I would love to use function v.hull in order to get two convex hulls
> > (their
> > faces). Basically apply function "by group". Unfortunatelly, I was not
> > able
> > to find simple way to do that.
> >
> > First solution I came up with was scripting with for cycle using
> > "category"
> > - picking ids of points and then run:
> > v.hull input=mypoints output=myhulls1 cat="1,3,40,etc"
> > v.hull input=mypoints output=myhulls2 cat="2,4,41,etc"
> >
> > Than I tried where clause:
> > v.hull input=mypoints output=myhulls1 where="A<2"
> > v.hull input=mypoints output=myhulls2 where="A>1"
> >
> > Unfortunatelly, this clumsy solution (I have hounderds thousands of
point
> > sets) does not work. All four lines gave me the same result (convex hull
> > created from all points).
> > The only even more clumsy solution I succeded with was first use
> > 'v.extract'
> > and than apply 'v.hull' on newly created maps.
> >
> > My questions:
> > Is there a way how to effectively apply function(command) by group?
> > Is the v.hull function supposed to work like this (ingnoring where and
cat
> > arguments)?
>
> confirmed that where or cat seems not to work. please open a ticket for
> this.

>From the manual:
layer=string
Layer number or name ('-1' for all layers)
Default: -1

You need to set the layer option to some positive number, otherwise all
points from all layers will be used and the cats and where options are
ignored.

HTH,

Markus M

>
>
>
>
> -
> best regards
> Helmut
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] problems with r.neighborhoodmatrix

2018-02-22 Thread Moritz Lennert

Hello Gra,

On 21/02/18 16:49, Gra wrote:

I have this error with r.neighborhoodmatrix
could you help?
thanks


Traceback (most recent call last):
   File
"/home/zuliagr/.grass7/addons/scripts/r.neighborhoodmatrix",
line 190, in 
     main()
   File
"/home/zuliagr/.grass7/addons/scripts/r.neighborhoodmatrix",
line 150, in main
     for line in heapq.merge(*[decorated_file(f, keyfunc) for
f in files]):
   File "/usr/lib/python2.7/heapq.py", line 376, in merge
     h_append([next(), itnum, next])
   File
"/home/zuliagr/.grass7/addons/scripts/r.neighborhoodmatrix",
line 96, in decorated_file
     yield (key(line), line)
   File
"/home/zuliagr/.grass7/addons/scripts/r.neighborhoodmatrix",
line 92, in keyfunc
     return [int(x) for x in s.split(separator)[:2]]
ValueError: invalid literal for int() with base 10:
'0-0.003922'



The value 0-0.003922 seems to indicate that you are not using an integer 
map. Calculating a neighborhood matrix only makes sense for clearly 
defined objects and this implies an identification with integer ids 
(such as the ones coming out of r.clump or i.segment).


To make sure this is the problem, please send us the r.info output on 
your input map.


I just committed a revised version of the addon which checks the map 
type and gives a fatal error if it is not the expected integer type. 
Reinstall the extension and tell us what you get.


BTW, you sent me a private mail [please don't do that: mails should 
always go to the list] concerning an error in r.object.spatialautocor 
where you also have an error in r.neighborhoodmatrix, using the 
following command:


r.object.spatialautocor ob=maskAT001L2_50 var=RPnAT001L2@in_data method=moran   


maskAT001L2_50 = raster map value 1
RPnAT001L2 = my variable



I suspect the reason for the error is similar, but to make sure, please 
send the output of


r.info maskAT001L2_50

Moritz
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Fwd: ASC files - Contours lines on elevation map on GRASS 7.4/Ubuntu 16.04

2018-02-22 Thread Moritz Lennert

On 22/02/18 02:18, Kevin Labre wrote:

HI Daniel, Moritz,

Thanks a lot for your quick replies.

I did not set the region to the extent of my maps, because I didn't know 
what values to use


g.region 
rast=MNT_Kourou_50cm_000517,MNT_Kourou_50cm_000518,MNT_Kourou_50cm_000551,MNT_Kourou_50cm_000552


and then running r.contour on each MNT should do the trick.



Following Moritz's advice, I've attached a .txt file with the output 
g-region -p, r-info on each of the raster files and v.info 
 on the 4 contour vector files.


g.region -p shows that the region is set to encompass only the two 
southern MNT's. However, I don't understand the output of v.info 
Contours517@K which shows that there are 22 lines in a bounding box with 
0 E-W extension ( E: 322072.25, W: 322072.25), while the region is 
defined with


west:   322072
east:   322572.5

i.e. it goes to the western edge of MNT_517. Maybe the region that was 
set when r.contour was run was not the same as the one you see now ?




Daniel I'll try the r.patch command as soon as I have a moment.


This is probably the easiest for you:

r.patch 
in=MNT_Kourou_50cm_000517,MNT_Kourou_50cm_000518,MNT_Kourou_50cm_000551,MNT_Kourou_50cm_000552 
out=myMNT


g.region rast=myMNT

r.contour in=myMnt

Moritz
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] v.hull ignoring 'where' argument

2018-02-22 Thread Helmut Kudrnovsky
Vilem Ded wrote
> Hi,
> I have set of points with attribute table (let just say with column "A" 
> containing 1s and 2s).
> I would love to use function v.hull in order to get two convex hulls
> (their
> faces). Basically apply function "by group". Unfortunatelly, I was not
> able
> to find simple way to do that.
> 
> First solution I came up with was scripting with for cycle using
> "category"
> - picking ids of points and then run:
> v.hull input=mypoints output=myhulls1 cat="1,3,40,etc"
> v.hull input=mypoints output=myhulls2 cat="2,4,41,etc"
> 
> Than I tried where clause:
> v.hull input=mypoints output=myhulls1 where="A<2"
> v.hull input=mypoints output=myhulls2 where="A>1"
> 
> Unfortunatelly, this clumsy solution (I have hounderds thousands of point 
> sets) does not work. All four lines gave me the same result (convex hull 
> created from all points).
> The only even more clumsy solution I succeded with was first use
> 'v.extract'
> and than apply 'v.hull' on newly created maps.
> 
> My questions:
> Is there a way how to effectively apply function(command) by group?
> Is the v.hull function supposed to work like this (ingnoring where and cat
> arguments)?

confirmed that where or cat seems not to work. please open a ticket for
this.




-
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] v.hull ignoring 'where' argument

2018-02-22 Thread Vilem Ded
Hi,
I have set of points with attribute table (let just say with column "A" 
containing 1s and 2s).
I would love to use function v.hull in order to get two convex hulls (their
faces). Basically apply function "by group". Unfortunatelly, I was not able
to find simple way to do that.

First solution I came up with was scripting with for cycle using "category"
- picking ids of points and then run:
v.hull input=mypoints output=myhulls1 cat="1,3,40,etc"
v.hull input=mypoints output=myhulls2 cat="2,4,41,etc"

Than I tried where clause:
v.hull input=mypoints output=myhulls1 where="A<2"
v.hull input=mypoints output=myhulls2 where="A>1"

Unfortunatelly, this clumsy solution (I have hounderds thousands of point 
sets) does not work. All four lines gave me the same result (convex hull 
created from all points).
The only even more clumsy solution I succeded with was first use 'v.extract'
and than apply 'v.hull' on newly created maps.

My questions:
Is there a way how to effectively apply function(command) by group?
Is the v.hull function supposed to work like this (ingnoring where and cat
arguments)?

Thank you
Vil___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user