[GRASS-dev] v.clean tool=break fails

2013-11-30 Thread Martin Landa
Hi all,

recently I found problem when breaking lines using `v.clean`.

I have a patched map that contains boundaries and centroids.

$ v.info x3 -t
nodes=8219
points=0
lines=0
boundaries=11807
centroids=4876
areas=4875
islands=1222
primitives=16683
map3d=0

When I try to break lines on intersections `v.clean` fails because it
tries to read nodes from centroids (which obviously fails).

$ v.clean in=x3 out=x4 tool=break --o
...
Tool: Break lines at intersections
0..ERROR: Nodes not available for line 11725

Defining `type` explicitly helps

$ v.clean in=x3 out=x4 tool=break --o type=boundary

In the attachment you can find a patch which seems to fix this issue.
I am just not sure about possible side-efects.

Martin

-- 
Martin Landa landa.martin gmail.com * http://geo.fsv.cvut.cz/~landa
Index: lib/vector/Vlib/break_lines.c
===
--- lib/vector/Vlib/break_lines.c   (revision 58335)
+++ lib/vector/Vlib/break_lines.c   (working copy)
@@ -245,7 +245,7 @@
}
 
atype = Vect_read_line(Map, APoints, ACats, aline);
-   if (!(atype  type))
+   if (atype  GV_POINTS || !(atype  type))
continue;
 
Vect_line_prune(APoints);
@@ -281,7 +281,7 @@
touch2_s, touch2_e, touch2_w);
}
 
-   Vect_select_lines_by_box(Map, ABox, type, List);
+   Vect_select_lines_by_box(Map, ABox, type = ~GV_POINTS, List);
G_debug(3,   %d lines selected by box, List-n_values);
 
for (j = -1; j  List-n_values; j++) {
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] [GRASS GIS] #2139: g.parser does not allow newline character in option value for Python scripts

2013-11-30 Thread GRASS GIS
#2139: g.parser does not allow newline character in option value for Python
scripts
+---
 Reporter:  wenzeslaus  |   Owner:  grass-dev@… 
 
 Type:  defect  |  Status:  new 
 
 Priority:  normal  |   Milestone:  7.0.0   
 
Component:  Parser  | Version:  svn-trunk   
 
 Keywords:  g.parser, scripts, newline, line break  |Platform:  All 
 
  Cpu:  Unspecified |  
+---

Comment(by glynn):

 Replying to [ticket:2139 wenzeslaus]:

  Are there other suggestions, e.g. for some fast (in any sense)
 implementation?

 r58339 adds a -n switch to g.parser to separate options with a null
 character rather an newline, and modifies grass.script.parser() to use
 that option.

 This needs to be tested on Windows.

-- 
Ticket URL: https://trac.osgeo.org/grass/ticket/2139#comment:1
GRASS GIS http://grass.osgeo.org

___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

[GRASS-dev] Survey LAST CALL [part of a MSc thesis]

2013-11-30 Thread Marco Foi
Dear GRASS Developer,

my survey is about to close.. ..so if you missed it this is your last
chance!

Follow the link to get more details and complete the survey:
http://www.mcfoi.it/msccs/thesis/survey/intro.php?fw=506


Many, many thanks for your kind cooperation!
Marco Foi
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] v.clean tool=break fails

2013-11-30 Thread Markus Metz
On Sat, Nov 30, 2013 at 12:26 PM, Martin Landa landa.mar...@gmail.com wrote:
 Hi all,

 recently I found problem when breaking lines using `v.clean`.

 I have a patched map that contains boundaries and centroids.

 $ v.info x3 -t
 nodes=8219
 points=0
 lines=0
 boundaries=11807
 centroids=4876
 areas=4875
 islands=1222
 primitives=16683
 map3d=0

 When I try to break lines on intersections `v.clean` fails because it
 tries to read nodes from centroids (which obviously fails).

 $ v.clean in=x3 out=x4 tool=break --o
 ...
 Tool: Break lines at intersections
 0..ERROR: Nodes not available for line 11725

 Defining `type` explicitly helps

 $ v.clean in=x3 out=x4 tool=break --o type=boundary

Fixed in r58340, please test.

Markus M
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev


Re: [GRASS-dev] v.clean tool=break fails

2013-11-30 Thread Martin Landa
Hi Markus,

2013/11/30 Markus Metz markus.metz.gisw...@gmail.com:

[...]

 Tool: Break lines at intersections
 0..ERROR: Nodes not available for line 11725

 Defining `type` explicitly helps

 $ v.clean in=x3 out=x4 tool=break --o type=boundary

 Fixed in r58340, please test.

thanks for super-quick fix! It seems to be OK, I found similar problem
in `merge_lines.c` (see the attached patch).

Martin

-- 
Martin Landa landa.martin gmail.com * http://geo.fsv.cvut.cz/~landa
Index: lib/vector/Vlib/merge_lines.c
===
--- lib/vector/Vlib/merge_lines.c   (revision 58340)
+++ lib/vector/Vlib/merge_lines.c   (working copy)
@@ -111,7 +111,7 @@
Line = Plus-Line[line];
ltype = Line-type;
 
-   if (!(ltype  type))
+   if (ltype  GV_POINTS || !(ltype  type))
continue;

Vect_read_line(Map, NULL, MCats, line);
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Re: [GRASS-dev] v.clean tool=break fails

2013-11-30 Thread Markus Metz
On Sat, Nov 30, 2013 at 6:02 PM, Martin Landa landa.mar...@gmail.com wrote:
 Hi Markus,

 2013/11/30 Markus Metz markus.metz.gisw...@gmail.com:

 [...]

 Tool: Break lines at intersections
 0..ERROR: Nodes not available for line 11725

 Defining `type` explicitly helps

 $ v.clean in=x3 out=x4 tool=break --o type=boundary

 Fixed in r58340, please test.

 thanks for super-quick fix! It seems to be OK, I found similar problem
 in `merge_lines.c` (see the attached patch).

How did you discover that bug in Vect_merge_lines()? To my knowledge
all modules calling Vect_merge_lines() set the correct type (lines
and/or boundaries).

Markus M
___
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev