Re: [GRASS-user] Hydrological grass question: main channel length for each subbasin

2014-02-17 Thread Michel Wortmann

Thanks Tom,
this is what I meant by looping over each subbasin, but that is exactly 
what I would like to avoid as it would take a lot of time for 1000+ 
subbasins and I dont really need all the other analysis.


Cheers,
Michel

On 02/16/2014 05:58 PM, Thomas Adams wrote:

Michel,

If you do what you suggest, but first apply a MASK using each 
subbasin; so, when you calculate the statistics, they will be for one 
subbasin at a time; with a very simple script you could loop through 
each subbasin.


I hope this helps.

Cheers!
Tom


On Sun, Feb 16, 2014 at 11:07 AM, Michel Wortmann 
wortm...@pik-potsdam.de mailto:wortm...@pik-potsdam.de wrote:


Hi list,
I'm looking for a way to calculate the main channel length and
width for a large number of subbasins within a river basin. I
understand that the r.stream.* addon / R.basin gives me the main
channel length along with a tone of other statistics but only for
one catchment. Of course, I could loop over all my subbasins and
calculate the statistics one by one, but I fear that will be time
consuming and I dont actually need all the other analysis.

I have got an efficient way to calculate the mainstream for each
subbasin as a vector, but I'm struggling to get from there to the
distance of the longest segment in each subbasin. Maybe someone
has an idea to complete this idea of a work flow:

raster=mainstreams (thinned raster with unique categories for each
subbasin)

r.to.vect to vectorise, this unfortunately gives me line segments
crossing over subbasin boundaries

somehow make stream segments from each subbasin

v.to.db to measure the distance of each line segment

choose the longest distance for each subbasin


Any suggestions/help would be much appreciated.
Regards,
Michel

___
grass-user mailing list
grass-user@lists.osgeo.org mailto: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] Hydrological grass question: main channel length for each subbasin

2014-02-17 Thread Rich Shepard

On Mon, 17 Feb 2014, Michel Wortmann wrote:


this is what I meant by looping over each subbasin, but that is exactly
what I would like to avoid as it would take a lot of time for 1000+
subbasins and I dont really need all the other analysis.


Michel,

  If you look at the code for that module you'll see that you cannot get
directly to the end without calculating all the intermediate values; one
attribute builds on those calculated before it. As long as the intermediates
are being calculated there's no reason to not put their results in the
overall table.

  If you want only main channel length for 1000+ subbasins you might figure
out a way to calculate that directly and modify the code (with a different
module name, of course) to do that. This is one of the advantages of open
source software licensed under the GPL.

Rich

--
Richard B. Shepard, Ph.D.  |  Have knowledge, will travel.
Applied Ecosystem Services, Inc.   |
http://www.appl-ecosys.com Voice: 503-667-4517  Fax: 503-667-8863

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


Re: [GRASS-user] r.in.gdal for importing categorical ArcGIS binary rasters

2014-02-17 Thread Markus Metz
On Fri, Feb 14, 2014 at 5:41 PM, manuel.martin
manuel.mar...@orleans.inra.fr wrote:
 On 02/14/2014 05:08 PM, Markus Metz wrote:

 On Wed, Feb 12, 2014 at 5:05 PM, manuel.martin
 manuel.mar...@orleans.inra.fr wrote:

 Hi all,

 I tried to import an ArcGIS binary raster (corine land cover for the
 French
 territory) with three fields on each pixels (VALUE, COUNT and CODE_06)
 using
 the r.in.gdal command. The import works just fine, except that in the
 resulting raster, in GRASS, I only get one field, which seems to be the
 VALUE field (and not the CODE_06 field, which I am interested in, and
 which
 is a categorical field, although coded with integers).

 r.in.gdal will soon support import of category labels such as those
 stored in the CODE_06 field. You can then inspect the labels with
 r.category. GDAL supports reading and writing of raster attribute
 tables, so far only the color rules stored in a raster attribute table
 are imported, but I plan to add import of labels to r.in.gdal. Note
 that this applies only to GRASS 7.

 Markus M


 Good to hear that ;-). I will wait for the next release of r.in.gdal

Done in r59073.

Markus M


 (meanwhile I did import clc vector layers with v.in.ogr and later managed
 the category labels with v.to.rast).

 All the best,   Manuel


 Is there a way to produce a resulting raster with all the fields of the
 initial ArcGIS layer, or alternatively to choose one unique field? Also,
 is
 there a limitation on categorical fields. For instance, what if instead
 of
 integer corine land cover codes I have literal labels, i.e. levels of my
 categorical field coded with strings?

 Cheers, Manuel

 --

 00--
 INRA - InfoSol
 Centre de recherche d'Orléans
 2163 Avenue de la Pomme de Pin
 CS 40001 ARDON
 45075 ORLEANS Cedex 2
 tel : (33) (0)2 38 41 48 21
 fax : (33) (0)2 38 41 78 69
 http://www.gissol.fr
 00--


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



 --

 00--
 INRA - InfoSol
 Centre de recherche d'Orléans
 2163 Avenue de la Pomme de Pin
 CS 40001 ARDON
 45075 ORLEANS Cedex 2
 tel : (33) (0)2 38 41 48 21
 fax : (33) (0)2 38 41 78 69
 http://www.gissol.fr
 00--

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


[GRASS-user] libgrass_gmath

2014-02-17 Thread Dave Roberts

Colleagues,

   I'm trying to do a simple dissolve on a vector map and getting a 
library error


v.dissolve inp=vmap out=dom_mid_60 column=dom_mid_60
 .  . .
 .  . .
v.extract: error while loading shared libraries: 
libgrass_gmath.6.4.2.so: cannot open shared object file: No such file or 
directory


However

ls -l /usr/local/grass-6.4.2/lib

shows

-rwxr-xr-x. 1 root root 77615 Dec 21  2012 libgrass_gmath.6.4.2.so
lrwxrwxrwx. 1 root root23 Dec 21  2012 libgrass_gmath.so -
libgrass_gmath.6.4.2.so

just as I would expect, with read and execute permissions.

Oddly, I'm running GRASS 6.4.3, but all the libraries are 6.4.2.  This 
is on Scientific Linux 6 (derived from RedHat Enterprise linux 6).


Thanks in advance for any help or suggestions, Dave
--

David W. Roberts office 406-994-4548
Professor and Head  FAX 406-994-3190
Department of Ecology email drobe...@montana.edu
Montana State University
Bozeman, MT 59717-3460
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Hydrological grass question: main channel length for each subbasin

2014-02-17 Thread Thomas Adams
Michel,

If it were me, I'd go ahead and take the hit with the brute force method.
However, I was involved with a project in calculating basin average
precipitation in real-time, over many basins (~700) for many time periods,
several times per day. Each second was critical; what we did was to convert
the real values to ints as cat values and associate them to basin IDs; then
convert back to reals -- this was very fast (I can provide shell
scripting). I understand this is not want you want, but you may be able to
do something analogously, by converting the stream main channel pixels to
the same cat value and count them (as they are associated with each basin),
then multiply by the pixel resolution -- if you follow what I'm
suggesting... Doing what we did, did not involve any looping -- which would
have been disasterously slow for our application.

Tom

On Monday, February 17, 2014, Rich Shepard rshep...@appl-ecosys.com wrote:

 On Mon, 17 Feb 2014, Michel Wortmann wrote:

  this is what I meant by looping over each subbasin, but that is exactly
 what I would like to avoid as it would take a lot of time for 1000+
 subbasins and I dont really need all the other analysis.


 Michel,

   If you look at the code for that module you'll see that you cannot get
 directly to the end without calculating all the intermediate values; one
 attribute builds on those calculated before it. As long as the
 intermediates
 are being calculated there's no reason to not put their results in the
 overall table.

   If you want only main channel length for 1000+ subbasins you might figure
 out a way to calculate that directly and modify the code (with a different
 module name, of course) to do that. This is one of the advantages of open
 source software licensed under the GPL.

 Rich

 --
 Richard B. Shepard, Ph.D.  |  Have knowledge, will travel.
 Applied Ecosystem Services, Inc.   |
 http://www.appl-ecosys.com Voice: 503-667-4517  Fax:
 503-667-8863

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



-- 
Thomas E Adams, III
718 McBurney Drive
Lebanon, OH 45036

1 (513) 739-9512 (cell)
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] libgrass_gmath

2014-02-17 Thread Hamish
Dave wrote:
    I'm trying to do a simple dissolve on a vector map and getting a
 library error

 v.dissolve inp=vmap out=dom_mid_60 column=dom_mid_60
   .  .    .
   .  .    .
 v.extract: error while loading shared libraries:
 libgrass_gmath.6.4.2.so: cannot open shared object file: No such file or
 directory

 However

 ls -l /usr/local/grass-6.4.2/lib

 shows

 -rwxr-xr-x. 1 root root 77615 Dec 21  2012 libgrass_gmath.6.4.2.so
 lrwxrwxrwx. 1 root root    23 Dec 21  2012 libgrass_gmath.so -
 libgrass_gmath.6.4.2.so

 just as I would expect, with read and execute permissions.

 Oddly, I'm running GRASS 6.4.3, but all the libraries are 6.4.2.  This
 is on Scientific Linux 6 (derived from RedHat Enterprise linux 6).

Hi,

try:

GRASS g.version -r

:)

GRASS echo $GISBASE
GRASS echo $GRASS_LD_LIBRARY_PATH 
GRASS ls $GISBASE/lib
GRASS echo $LD_LIBRARY_PATH

that should show you where the grass install is located.

It's usually fine to have many versions of GRASS installed
at the same time, they can all run self-contained.

-- you might check if the 6.4.2 install is listed in /etc/ld.so.conf
or /etc/ld.so.conf.d/*, if so change it to the location of the 6.4.3
libraries and re-run `ldconfig` (as root).


good luck,
Hamish

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