Re: [GRASS-user] v.dissolve for lines?

2010-10-20 Thread Markus Metz
Micha Silver wrote:
 Bryan Keith wrote:

 Hello,

 I have a vector line file that has lots of two-vertex lines.  Many of
 these two-vertex lines share endpoints and really just make parts of one
 longer line.  I'd like to dissolve these lines into one line when they
 have the same end point.  It looks like v.dissolve only works for areas.
 Is there somewhere else I should be looking?  Thank you.



 Did you have a look at v.build.polylines ?
 Additional note: line vectors have a direction. Two line segments with an
 equivalent node (end point) will *not* connect if they are in opposite
 directions.

Each line has two nodes, one at the start and one at the end. If at
the end of one line any other line is starting or ending, this other
line is added to the first line, reversing the direction if necessary.
IOW, two lines with a common node will indeed connect, and the
direction of one line may need to be reversed (done automatically).
Very simple to test by digitizing a simple test vector.

In this case you can try the v.edit tool=flip option (on those
 segments only)

Should not be needed as pre-processing step for v.build.polylines.


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


[GRASS-user] Using r.reclass

2010-10-20 Thread katrin eggert
Hi

I have a raster image that ranges from 1-300 and I want to apply reclass in
order to reclass this image. But I only want to change 10 values
(1,10,12,15, 100, 130, 200, 230, 250,290) and the rest I want them to be
Null. in the rules file, shall I include the rest of the values and
attribute them the null() value or what shall I do?

THanks
Kat
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.dissolve for lines?

2010-10-20 Thread Micha Silver

 On 20/10/2010 08:36, Markus Metz wrote:

Micha Silver wrote:

Bryan Keith wrote:

Hello,

I have a vector line file that has lots of two-vertex lines.  Many of
these two-vertex lines share endpoints and really just make parts of one
longer line.  I'd like to dissolve these lines into one line when they
have the same end point.  It looks like v.dissolve only works for areas.
Is there somewhere else I should be looking?  Thank you.



Did you have a look at v.build.polylines ?
Additional note: line vectors have a direction. Two line segments with an
equivalent node (end point) will *not* connect if they are in opposite
directions.

Each line has two nodes, one at the start and one at the end. If at
the end of one line any other line is starting or ending, this other
line is added to the first line, reversing the direction if necessary.
IOW, two lines with a common node will indeed connect, and the
direction of one line may need to be reversed (done automatically).
Very simple to test by digitizing a simple test vector.


Heh, thanks for the correction!
Was this always the case? I seem to remember not be able to 
merge lines unless they were connected in the same direction.
How does the line reversal work? That is, Which of the two 
line segments is chosen be get reversed?

Regards,
Micha


In this case you can try the v.edit tool=flip option (on those

segments only)

Should not be needed as pre-processing step for v.build.polylines.


Markus M

This mail was received via Mail-SeCure System.





--
Micha Silver
http://www.surfaces.co.il/
Arava Development Co.  +972-52-3665918

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


Re: [GRASS-user] v.dissolve for lines?

2010-10-20 Thread Maris Nartiss
If You have lines with wrong direction or segment order, You can try
to run my v.reorder_line_segments tool.[1] It will try to reorder
same CAT line segments to be in increasing order. It also reverses
line segments to be in order from start to end. It will work only for
simple, stright lines and will go nuts on circular featrues etc, still
sometimes it's faster than doing manual work.

Current version will stop if line contains crossection, still that
check can be removed. I introduced it only because module entered an
endless loop if multiline looped back to itself. Code is unfinished,
as I was not able to figure out how to solve non-trivial cases and
thus cleaned my data by hand.

It's tested on GRASS 7. It requires ctypes.

If You need aditional help, drop a note.
Maris.

1. 
http://www.gisnet.lv/trac/gisnet/browser/gisnettools/v.reorder_line_segments.py


2010/10/20, Micha Silver mi...@arava.co.il:
   On 20/10/2010 08:36, Markus Metz wrote:
 Micha Silver wrote:
 Bryan Keith wrote:
 Hello,

 I have a vector line file that has lots of two-vertex lines.  Many of
 these two-vertex lines share endpoints and really just make parts of one
 longer line.  I'd like to dissolve these lines into one line when they
 have the same end point.  It looks like v.dissolve only works for areas.
 Is there somewhere else I should be looking?  Thank you.


 Did you have a look at v.build.polylines ?
 Additional note: line vectors have a direction. Two line segments with an
 equivalent node (end point) will *not* connect if they are in opposite
 directions.
 Each line has two nodes, one at the start and one at the end. If at
 the end of one line any other line is starting or ending, this other
 line is added to the first line, reversing the direction if necessary.
 IOW, two lines with a common node will indeed connect, and the
 direction of one line may need to be reversed (done automatically).
 Very simple to test by digitizing a simple test vector.

 Heh, thanks for the correction!
 Was this always the case? I seem to remember not be able to
 merge lines unless they were connected in the same direction.
 How does the line reversal work? That is, Which of the two
 line segments is chosen be get reversed?
 Regards,
 Micha

 In this case you can try the v.edit tool=flip option (on those
 segments only)
 Should not be needed as pre-processing step for v.build.polylines.


 Markus M

 This mail was received via Mail-SeCure System.




 --
 Micha Silver
 http://www.surfaces.co.il/
 Arava Development Co.  +972-52-3665918

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

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


Re: [GRASS-user] v.dissolve for lines?

2010-10-20 Thread Markus Metz
Micha Silver wrote:
  On 20/10/2010 08:36, Markus Metz wrote:

 Micha Silver wrote:

 Bryan Keith wrote:

 Hello,

 I have a vector line file that has lots of two-vertex lines.  Many of
 these two-vertex lines share endpoints and really just make parts of one
 longer line.  I'd like to dissolve these lines into one line when they
 have the same end point.  It looks like v.dissolve only works for areas.
 Is there somewhere else I should be looking?  Thank you.


 Did you have a look at v.build.polylines ?
 Additional note: line vectors have a direction. Two line segments with an
 equivalent node (end point) will *not* connect if they are in opposite
 directions.

 Each line has two nodes, one at the start and one at the end. If at
 the end of one line any other line is starting or ending, this other
 line is added to the first line, reversing the direction if necessary.
 IOW, two lines with a common node will indeed connect, and the
 direction of one line may need to be reversed (done automatically).
 Very simple to test by digitizing a simple test vector.

 Heh, thanks for the correction!
 Was this always the case? I seem to remember not be able to merge lines
 unless they were connected in the same direction.
 How does the line reversal work? That is, Which of the two line segments is
 chosen be get reversed?

v.build.polyline works as follows:
it picks a line and from its start node, walks back as long as exactly
one other line is connected to this node. Line directions are reversed
as required, i.e. it does not matter if the next line is connected to
the current node by its start or end node.

Once the start line of a polyline is identified, it walks forward and
adds all vertices (in reverse order if needed) of connected lines to
the start line, i.e. the start line and connecting lines are reversed
as needed. That is, if a line is reversed depends on what node is
initially picked for building polylines.

If the direction of lines is important (it's not for boundaries to
build areas), you have to manually change line directions with either
v.edit or the wxdigitizer or the tool by Maris.

Markus M

 Regards,
 Micha

 In this case you can try the v.edit tool=flip option (on those

 segments only)

 Should not be needed as pre-processing step for v.build.polylines.


 Markus M

 This mail was received via Mail-SeCure System.




 --
 Micha Silver
 http://www.surfaces.co.il/
 Arava Development Co.  +972-52-3665918


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


Re: [GRASS-user] Use of r.mode

2010-10-20 Thread Monica Buescu
Hello


 About 20,000,000 cells. That should be OK.
 Do you know how many different values are actually in the data?

Yes... In this case is 6608. In other examples it can be 3000 or 2000. Why?


I'd try two things here. First can you change to a smaller region and rerun
 r.mode and try to display the results?

Yes. It worked with a much smaller image.


 Second: the result of r.mode is a reclass of the original values. So I
 suppose it has to be recalculated each time you want to display. You can
 make that reclass map into a permanent raster by running:
 r.mapcalc output2 = output1


I tried this and after 15 minutes running I gave up. Can this be related
with memory restrictions?

Thanks Micha for your help
Micha
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Using r.reclass

2010-10-20 Thread Glynn Clements

katrin eggert wrote:

 I have a raster image that ranges from 1-300 and I want to apply reclass in
 order to reclass this image. But I only want to change 10 values
 (1,10,12,15, 100, 130, 200, 230, 250,290) and the rest I want them to be
 Null. in the rules file, shall I include the rest of the values and
 attribute them the null() value or what shall I do?

Add the rule:

* = NULL

-- 
Glynn Clements gl...@gclements.plus.com
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] error compiling grass65svn and addons for grass64

2010-10-20 Thread Laura Poggio
Dear all,
I installed grass6.4 on a machine with Suse11.2 64 bit from the official
repository. Then I tried to install  some addons with g.extension and using
the usual configure/make/make install.
In both cases I get the following error:

make: *** [OBJ.x86_64-unknown-linux-gnu/[...]] Error 1
ERROR: Compilation failed, sorry. Please check above error messages.

I also tried to compile grass65 from svn and I am getting the same error.

Please let me know and I can provide more details. Sorry but I do not know
what would be useful for better understanding the problem.


Thank you very much in advance

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


Re: [GRASS-user] Use of r.mode

2010-10-20 Thread Micha Silver


  
  
On 20/10/2010 12:18, Monica Buescu wrote:
Hello
  
  
  

  

  
  
  About 20,000,000 cells. That should be OK.
  Do you know how many different values are actually in the
  data?
  
  Yes... In this case is 6608. In other examples it can be
3000 or 2000. Why?

  

Just to understand how complex the calculation of r.mode has to be.

  

  
  
  
  

  I'd try two things here. First can you change to a smaller
  region and
  rerun r.mode and try to display the results?

  
  Yes. It worked with a much smaller image.

  

Ah, good.

  

  
  

  Second: the result of r.mode is a "reclass" of the
  original values. So
  I suppose it has to be recalculated each time you want to
  display. You
  can make that reclass map into a permanent raster by
  running:
  r.mapcalc "output2 = output1"

  
  
  
  I tried this and after 15 minutes running I gave up. Can
this be related with memory restrictions?

  

Well, that's not good. Yes, maybe a problem with disk space or
memory? l'll have to leave to someone more knowledgeable to answer
here. 
If you just let it run for longer will it finish?

  

  

  

  

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


Re: [GRASS-user] error compiling grass65svn and addons for grass64

2010-10-20 Thread Maris Nartiss
Hello,
You have to provide whole error message. Without exact error text,
it's impossible to tell what kind of problem You have.

WBR,
Maris.


2010/10/20, Laura Poggio laura.pog...@gmail.com:
 Dear all,
 I installed grass6.4 on a machine with Suse11.2 64 bit from the official
 repository. Then I tried to install  some addons with g.extension and using
 the usual configure/make/make install.
 In both cases I get the following error:

 make: *** [OBJ.x86_64-unknown-linux-gnu/[...]] Error 1
 ERROR: Compilation failed, sorry. Please check above error messages.

 I also tried to compile grass65 from svn and I am getting the same error.

 Please let me know and I can provide more details. Sorry but I do not know
 what would be useful for better understanding the problem.


 Thank you very much in advance

 Laura

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


Re: [GRASS-user] error compiling grass65svn and addons for grass64

2010-10-20 Thread razmjooeis
Have you got the following packges installed?
gcc
g++
make


Cheers
Sab

 Hello,
 You have to provide whole error message. Without exact error text,
 it's impossible to tell what kind of problem You have.

 WBR,
 Maris.


 2010/10/20, Laura Poggio laura.pog...@gmail.com:
 Dear all,
 I installed grass6.4 on a machine with Suse11.2 64 bit from the official
 repository. Then I tried to install  some addons with g.extension and
 using
 the usual configure/make/make install.
 In both cases I get the following error:

 make: *** [OBJ.x86_64-unknown-linux-gnu/[...]] Error 1
 ERROR: Compilation failed, sorry. Please check above error messages.

 I also tried to compile grass65 from svn and I am getting the same
 error.

 Please let me know and I can provide more details. Sorry but I do not
 know
 what would be useful for better understanding the problem.


 Thank you very much in advance

 Laura

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



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


Re: [GRASS-user] error compiling grass65svn and addons for grass64

2010-10-20 Thread Laura Poggio
Yes I have gcc, g++, make.
The full error message for one extension is pasted below (for one extension
as example).

Thank you very much

Laura

===
Checked out revision 43978.
Compiling r.stream.basins...
In file included from catchment.c:1:
global.h:5:23: error: grass/gis.h: No such file or directory
global.h:6:24: error: grass/Vect.h: No such file or
directory
global.h:7:27: error: grass/glocale.h: No such file or
directory
In file included from catchment.c:1:
global.h:64: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or ‘__attribute__’ before ‘*’ token
catchment.c: In function ‘find_outlets’:
catchment.c:29: warning: cast to pointer from integer of
different size
catchment.c:36: error: ‘streams’ undeclared (first use
in this function)
catchment.c:36: error: (Each undeclared identifier is
reported only once
catchment.c:36: error: for each function it appears in.)
catchment.c:45: warning: cast to pointer from integer of
different size
catchment.c:48: error: ‘dirs’ undeclared (first use in
this function)
catchment.c: In function ‘reset_catchments’:
catchment.c:115: error: ‘streams’ undeclared (first use
in this function)
catchment.c: In function ‘fill_catchments’:
catchment.c:147: error: ‘streams’ undeclared (first use
in this function)
catchment.c:159: error: ‘dirs’ undeclared (first use in
this function)
make: *** [OBJ.x86_64-unknown-linux-gnu/catchment.o] Error 1
ERROR: Compilation failed, sorry. Please check above error messages.
test -d OBJ.x86_64-unknown-linux-gnu || mkdir -p
OBJ.x86_64-unknown-linux-gnu
gcc
-I/usr/src/packages/BUILD/grass-6.4.0/dist.x86_64-unknown-linux-gnu/include
-O2-I/usr/include/gdal/ -DPACKAGE=\grassmods\
-I/usr/src/packages/BUILD/grass-6.4.0/dist.x86_64-unknown-linux-gnu/include
-o OBJ.x86_64-unknown-linux-gnu/catchment.o -c catchment.c
(Wed Oct 20 11:56:21 2010) Command finished (6
sec)


On 20 October 2010 14:38, razmjoo...@faunalia.co.uk wrote:

 Have you got the following packges installed?
 gcc
 g++
 make


 Cheers
 Sab

  Hello,
  You have to provide whole error message. Without exact error text,
  it's impossible to tell what kind of problem You have.
 
  WBR,
  Maris.
 
 
  2010/10/20, Laura Poggio laura.pog...@gmail.com:
  Dear all,
  I installed grass6.4 on a machine with Suse11.2 64 bit from the official
  repository. Then I tried to install  some addons with g.extension and
  using
  the usual configure/make/make install.
  In both cases I get the following error:
 
  make: *** [OBJ.x86_64-unknown-linux-gnu/[...]] Error 1
  ERROR: Compilation failed, sorry. Please check above error messages.
 
  I also tried to compile grass65 from svn and I am getting the same
  error.
 
  Please let me know and I can provide more details. Sorry but I do not
  know
  what would be useful for better understanding the problem.
 
 
  Thank you very much in advance
 
  Laura
 
  ___
  grass-user mailing list
  grass-user@lists.osgeo.org
  http://lists.osgeo.org/mailman/listinfo/grass-user
 



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


Re: [GRASS-user] error compiling grass65svn and addons for grass64

2010-10-20 Thread Maris Nartiss
Hello,
if SUSE provides separate -dev packages, install grass-dev package.
Then You have to run Your make commands with
MODULE_TOPDIR=/path/to/grass.

See this issue for details: http://trac.osgeo.org/grass/ticket/620

Still error You had when compiling 6.5 from source must be a different
one, as provided error message makes sense only to addons and not
compilation of whole GRASS.

Maris.


2010/10/20, Laura Poggio laura.pog...@gmail.com:
 Yes I have gcc, g++, make.
 The full error message for one extension is pasted below (for one extension
 as example).

 Thank you very much

 Laura

 ===
 Checked out revision 43978.
 Compiling r.stream.basins...
 In file included from catchment.c:1:
 global.h:5:23: error: grass/gis.h: No such file or directory
 global.h:6:24: error: grass/Vect.h: No such file or
 directory
 global.h:7:27: error: grass/glocale.h: No such file or
 directory
 In file included from catchment.c:1:
 global.h:64: error: expected ‘=’, ‘,’, ‘;’,
 ‘asm’ or ‘__attribute__’ before ‘*’ token
 catchment.c: In function ‘find_outlets’:
 catchment.c:29: warning: cast to pointer from integer of
 different size
 catchment.c:36: error: ‘streams’ undeclared (first use
 in this function)
 catchment.c:36: error: (Each undeclared identifier is
 reported only once
 catchment.c:36: error: for each function it appears in.)
 catchment.c:45: warning: cast to pointer from integer of
 different size
 catchment.c:48: error: ‘dirs’ undeclared (first use in
 this function)
 catchment.c: In function ‘reset_catchments’:
 catchment.c:115: error: ‘streams’ undeclared (first use
 in this function)
 catchment.c: In function ‘fill_catchments’:
 catchment.c:147: error: ‘streams’ undeclared (first use
 in this function)
 catchment.c:159: error: ‘dirs’ undeclared (first use in
 this function)
 make: *** [OBJ.x86_64-unknown-linux-gnu/catchment.o] Error 1
 ERROR: Compilation failed, sorry. Please check above error messages.
 test -d OBJ.x86_64-unknown-linux-gnu || mkdir -p
 OBJ.x86_64-unknown-linux-gnu
 gcc
 -I/usr/src/packages/BUILD/grass-6.4.0/dist.x86_64-unknown-linux-gnu/include
 -O2-I/usr/include/gdal/ -DPACKAGE=\grassmods\
 -I/usr/src/packages/BUILD/grass-6.4.0/dist.x86_64-unknown-linux-gnu/include
 -o OBJ.x86_64-unknown-linux-gnu/catchment.o -c catchment.c
 (Wed Oct 20 11:56:21 2010) Command finished (6
 sec)


 On 20 October 2010 14:38, razmjoo...@faunalia.co.uk wrote:

 Have you got the following packges installed?
 gcc
 g++
 make


 Cheers
 Sab

  Hello,
  You have to provide whole error message. Without exact error text,
  it's impossible to tell what kind of problem You have.
 
  WBR,
  Maris.
 
 
  2010/10/20, Laura Poggio laura.pog...@gmail.com:
  Dear all,
  I installed grass6.4 on a machine with Suse11.2 64 bit from the
  official
  repository. Then I tried to install  some addons with g.extension and
  using
  the usual configure/make/make install.
  In both cases I get the following error:
 
  make: *** [OBJ.x86_64-unknown-linux-gnu/[...]] Error 1
  ERROR: Compilation failed, sorry. Please check above error messages.
 
  I also tried to compile grass65 from svn and I am getting the same
  error.
 
  Please let me know and I can provide more details. Sorry but I do not
  know
  what would be useful for better understanding the problem.
 
 
  Thank you very much in advance
 
  Laura
 
  ___
  grass-user mailing list
  grass-user@lists.osgeo.org
  http://lists.osgeo.org/mailman/listinfo/grass-user
 




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


Re: [GRASS-user] r.reclass with floating point result

2010-10-20 Thread Hanlie Pretorius
2010/10/19, Glynn Clements gl...@gclements.plus.com:

 Hanlie Pretorius wrote:

 So, I have two problems here: 1) I can't get r.reclass to output an
 FCELL raster even though its help file suggest that only the input
 file needs to be a CELL raster.

 A reclass table maps integers to integers. You cannot generate a
 floating-point map by reclassing.

Could you perhaps suggest a method to do so? I tried r.mapcalc, but I
also got a conversion to integers. Somehow the default raster is an
integer raster?


 --
 Glynn Clements gl...@gclements.plus.com

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