Re: [GRASS-user] r.stream.order export to shapefile

2012-08-28 Thread Markus Metz
On Tue, Aug 28, 2012 at 9:05 PM, Micha Silver  wrote:
> A few more details regarding v.out.ogr when layer=2
> I see this ticket, possibly similar: http://trac.osgeo.org/grass/ticket/991
>
> I tried to export to PostGIS, and again, all attribute fields are created
> but all values are NULL. I also tried with the layer 2 database as a dbf
> file, instead of sqlite. Same result.
>
> This was all with GRASS 6.4.2 on scientific linux 6

What does v.category op=report say? Are there any categories in layer
2? If not, there is nothing to export.

Markus M

>
> Thanks,
> Micha
>
>
> On 08/28/2012 02:57 PM, Micha Silver wrote:
>
> I'm having two problems when exporting the output of r.stream.order to a
> shapefile.
> I have attached the created table (saved in my setup in sqlite) to the
> 'streams' map thru layer 2. Then
> v.db.select streams layer=2
> shows all the details of strahler order, prev_str, etc.
>
>
> First problem: When I try to do v.out.ogr, the column header named
> "next_stream" fails because it's 10 characters long, too long for a
> shapefile dbf. As a result all attributes are missing.  Here's a patch to
> io.c in r.stream.order I put in place to correct this:
>
>  [micha@SL6 r.stream.order]$ diff -u io.c.orig io.c
> --- io.c.orig2012-08-28 12:21:46.020275045 +0300
> +++ io.c2012-08-28 12:22:17.951382882 +0300
> @@ -292,7 +292,7 @@
>  /* table definition */
>  char *tab_cat_col_name = "cat integer";
>  char *tab_stream = "stream integer";
> -char *tab_next_stream = "next_stream integer";
> +char *tab_next_stream = "next_str integer";
>  char *tab_prev_streams;
>  char *tab_strahler = "strahler integer";
>  char *tab_horton = "horton integer";
> @@ -300,7 +300,7 @@
>  char *tab_hack = "hack integer";
>  char *tab_length = "length double precision";
>  char *tab_cumlength = "cum_length double precision";
> -char *tab_stright = "stright double precision";
> +char *tab_stright = "straight double precision";
>  char *tab_fractal = "fractal double precision";
>  char *tab_distance = "out_dist double precision";
>  char *tab_topo_dim = "topo_dim integer";
>
> (Also corrects a small typo in the column name "stright")
>
> After recompiling, then rerunning the r.stream.order addon, the sqlite table
> now has all column headers <= 10 characters suitable to shapefile.
>
>
> Problem 2, where I'm stuck. I export the vector map using :
> v.out.ogr streams layer=2 dsn=streams.shp
> The process finishes OK, and the shape is created with all attrib columns,
> but *all* values are NULL (including the cat). Any ideas what I've done
> wrong?
>
> Thanks,
> Micha
>
>
> This mail was received via Mail-SeCure System.
>
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
> This mail was received via Mail-SeCure System.
>
>
>
>
> --
> Micha Silver
> GIS Consultant, Arava Development Co.
> http://www.surfaces.co.il
>
>
> ___
> 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.stream.order export to shapefile

2012-08-28 Thread Micha Silver

  
  
A few more details regarding v.out.ogr when layer=2
I see this ticket, possibly similar:
http://trac.osgeo.org/grass/ticket/991

I tried to export to PostGIS, and again, all attribute fields are
created but all values are NULL. I also tried with the layer 2
database as a dbf file, instead of sqlite. Same result. 

This was all with GRASS 6.4.2 on scientific linux 6

Thanks,
Micha
 
On 08/28/2012 02:57 PM, Micha Silver wrote:

  
  
  I'm having two problems when exporting the output of
  r.stream.order to a shapefile.
  I have attached the created table (saved in my setup in sqlite) to
  the 'streams' map thru layer 2. Then 
  v.db.select streams layer=2 
  shows all the details of strahler order, prev_str, etc. 
  
  
  First problem: When I try to do v.out.ogr, the column header named
  "next_stream" fails because it's 10 characters long, too long for
  a shapefile dbf. As a result all attributes are missing.  Here's a
  patch to io.c in r.stream.order I put in place to correct this:
  
   [micha@SL6 r.stream.order]$ diff -u io.c.orig io.c
  --- io.c.orig    2012-08-28 12:21:46.020275045 +0300
  +++ io.c    2012-08-28 12:22:17.951382882 +0300
  @@ -292,7 +292,7 @@
   /* table definition */
   char *tab_cat_col_name = "cat integer";
   char *tab_stream = "stream integer";
  -    char *tab_next_stream = "next_stream integer";
  +    char *tab_next_stream = "next_str integer";
   char *tab_prev_streams;
   char *tab_strahler = "strahler integer";
   char *tab_horton = "horton integer";
  @@ -300,7 +300,7 @@
   char *tab_hack = "hack integer";
   char *tab_length = "length double precision";
   char *tab_cumlength = "cum_length double precision";
  -    char *tab_stright = "stright double precision";
  +    char *tab_stright = "straight double precision";
   char *tab_fractal = "fractal double precision";
   char *tab_distance = "out_dist double precision";
   char *tab_topo_dim = "topo_dim integer";
  
  (Also corrects a small typo in the column name "stright")
  
  After recompiling, then rerunning the r.stream.order addon, the
  sqlite table now has all column headers <= 10 characters
  suitable to shapefile.
  
  
  Problem 2, where I'm stuck. I export the vector map using :
  v.out.ogr streams layer=2 dsn=streams.shp
  The process finishes OK, and the shape is created with all attrib
  columns, but *all* values are NULL (including the cat). Any ideas
  what I've done wrong? 
  
  Thanks,
  Micha 
  
  
  This mail was received via Mail-SeCure System.
  
  
  
  ___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

This mail was received via Mail-SeCure System.






-- 
Micha Silver
GIS Consultant, Arava Development Co.
http://www.surfaces.co.il
  

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


[GRASS-user] r.sun - was Re: Importing ASCII file

2012-08-28 Thread Markus Neteler
On Fri, Aug 24, 2012 at 10:16 PM, sotototo  wrote:
> Hi,
>
> Is there a way to calculate automatically the annual radiation in r.sun
> because the algorithm calculates one day at a time.

Yes, see (minimal modifications will be needed to cover the full year):
 http://www.grassbook.org/examples_menu2nd.php
--> rsun_crop.sh (GRASS 5) - Version for GRASS 6: rsun_crop_grass6.sh

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


Re: [GRASS-user] Adjust opacity in command line

2012-08-28 Thread Markus Neteler
On Tue, Aug 28, 2012 at 4:19 PM, Glynn Clements
 wrote:
>
> Andy Wickert wrote:
>
>> I have been trying to find a way to adjust the opacity (or
>> transparency, to throw another key word in there) of raster and vector
>> layers using the command line. This is possible in the wxPython GUI,
>> but I have a large number of maps to produce, and would like to script
>> it. So if anyone knows if this is possible with the standard d.*
>> commands, ps.map, or something else I don't know about - thanks in
>> advance!
>
> It isn't possible to directly generate images with partial opacity.
> wxGUI (via g.pnmcomp) uses the opacity values when compositing the
> layers to form the displayed image.
>
> You'll need to use general-purpose image-processing tools such as
> ImageMagick, netpbm or Python+PIL. Blending between an empty
> (fully-transparent) image and the source image is probably the easiest
> approach.

Perhaps "r.blend" could be of interest to some extent.

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


Re: [GRASS-user] can't start from a BARRIER / Wildfire suite

2012-08-28 Thread Margherita Di Leo
OK solved. I figured out that it was actually a problem in the units i used
in the input maps.



On Tue, Aug 28, 2012 at 2:58 PM, Margherita Di Leo wrote:

> Hi All,
>
> I have some troubles running the Wildfire suite in grass. In particular,
> when i run r.spread I get the following error message:
>
> [...]
> WARNING: can't start from a BARRIER at cell (416,305), request ignored
> WARNING: can't start from a BARRIER at cell (417,305), request ignored
> WARNING: can't start from a BARRIER at cell (418,305), request ignored
> [...]
>
> I checked the input and this is due to the fact that r.ros produces a
> r.ros.base map which is all 0 and null.
>
> r.info map=r_ros0.base
>
>  
> ++
>  | Layer:r_ros0.baseDate: Tue Aug 28 13:58:37 2012
>|
>  | Mapset:   PERMANENT  Login of Creator: leomarg
> |
>  | Location: Europe
> |
>  | DataBase: /home/leomarg/grassdata
>|
>  | Title: ( r_ros0.base )
> |
>  | Timestamp: none
>|
>
>  
> ||
>  |
>|
>  |   Type of Map:  raster   Number of Categories: 0
> |
>  |   Data Type:CELL
> |
>  |   Rows: 744
>|
>  |   Columns:  889
>|
>  |   Total Cells:  661416
> |
>  |Projection: Lambert Azimuthal Equal Area
>|
>  |N:1903000S:1828600   Res:   100
> |
>  |E:3433100W:3344200   Res:   100
> |
>  |   Range of data:min = 0  max = 0
> |
>  |
>|
>  |   Data Description:
>|
>  |generated by r.ros
>|
>  |
>|
>  |
>|
>
>  
> ++
>
> So I checked the input of r.ros but i'm puzzled because everything looks
> good to me, I can't see any obvious error. In the manual I read:
>
> 3. The output units for the base and maximum ROSes are in cm/minute rather
> than ft/minute, which is due to that a possible zero ft/minute base ROS
> value and a positive integer ft/minute maximum ROS would result in
> calculation failure in the r.spread program.
>
> So if I understand correctly, this can be due to a possible unit mismatch.
> I give the velocity of wind in feet/minute and the direction in degrees, as
> required by the manual.
> Where am I wrong?
>
> Thanks.
>
> madi
>
>
>
> --
> Dr. Margherita Di Leo
>



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


Re: [GRASS-user] FW: r.lake issues

2012-08-28 Thread Maris Nartiss
Hello,
please check following things:
1) water level at seed point/area is above terrain (provided DEM);
2) seed point/area is located within current computational region
(just run g.region rast=my_dem before r.lake);
3) seed point/area has values > 0 (quirk of current implementation).

Good luck!
Maris.

PS. 3rd check probably could be eliminated by slight alteration of
r.lake code. Just a note to myself ;)

2012/8/28 ambrish dhaka :
>
>
> 
> From: ambi...@hotmail.com
> To: qgis-u...@lists.osgeo.org
> Subject: r.lake issues
> Date: Tue, 28 Aug 2012 04:55:59 +
>
> HI! ALL
> I have been trying to generate a lake feature from dem and seed raster files
> using r.lake, this is information below.
>
> The areas are not created as values can be seen below.
>
> r.lake dem=e15234@user1 seed=seed@user1 wl=50 lake=seed50
>
>
> Lake depth from 0.00 to 0.00
>
>
> Lake area 0.00 square meters
>
>
> Lake volume 0.00 cubic meters
>
>
> Volume is correct only if lake depth (terrain raster map) is in meters
>
> Successfully finished
>
>
> What could be the reason.
>
>
> AMBRISH DHAKA
>
>
> THANKS! IN ADVANCE
>
>
>
> ___
> 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] Adjust opacity in command line

2012-08-28 Thread Glynn Clements

Andy Wickert wrote:

> I have been trying to find a way to adjust the opacity (or
> transparency, to throw another key word in there) of raster and vector
> layers using the command line. This is possible in the wxPython GUI,
> but I have a large number of maps to produce, and would like to script
> it. So if anyone knows if this is possible with the standard d.*
> commands, ps.map, or something else I don't know about - thanks in
> advance!

It isn't possible to directly generate images with partial opacity. 
wxGUI (via g.pnmcomp) uses the opacity values when compositing the
layers to form the displayed image.

You'll need to use general-purpose image-processing tools such as
ImageMagick, netpbm or Python+PIL. Blending between an empty
(fully-transparent) image and the source image is probably the easiest
approach.

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


[GRASS-user] can't start from a BARRIER / Wildfire suite

2012-08-28 Thread Margherita Di Leo
Hi All,

I have some troubles running the Wildfire suite in grass. In particular,
when i run r.spread I get the following error message:

[...]
WARNING: can't start from a BARRIER at cell (416,305), request ignored
WARNING: can't start from a BARRIER at cell (417,305), request ignored
WARNING: can't start from a BARRIER at cell (418,305), request ignored
[...]

I checked the input and this is due to the fact that r.ros produces a
r.ros.base map which is all 0 and null.

r.info map=r_ros0.base
 ++
 | Layer:r_ros0.baseDate: Tue Aug 28 13:58:37 2012
   |
 | Mapset:   PERMANENT  Login of Creator: leomarg
  |
 | Location: Europe
  |
 | DataBase: /home/leomarg/grassdata
   |
 | Title: ( r_ros0.base )
  |
 | Timestamp: none
   |
 ||
 |
   |
 |   Type of Map:  raster   Number of Categories: 0
  |
 |   Data Type:CELL
  |
 |   Rows: 744
   |
 |   Columns:  889
   |
 |   Total Cells:  661416
  |
 |Projection: Lambert Azimuthal Equal Area
   |
 |N:1903000S:1828600   Res:   100
  |
 |E:3433100W:3344200   Res:   100
  |
 |   Range of data:min = 0  max = 0
  |
 |
   |
 |   Data Description:
   |
 |generated by r.ros
   |
 |
   |
 |
   |
 ++

So I checked the input of r.ros but i'm puzzled because everything looks
good to me, I can't see any obvious error. In the manual I read:

3. The output units for the base and maximum ROSes are in cm/minute rather
than ft/minute, which is due to that a possible zero ft/minute base ROS
value and a positive integer ft/minute maximum ROS would result in
calculation failure in the r.spread program.

So if I understand correctly, this can be due to a possible unit mismatch.
I give the velocity of wind in feet/minute and the direction in degrees, as
required by the manual.
Where am I wrong?

Thanks.

madi



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


[GRASS-user] r.stream.order export to shapefile

2012-08-28 Thread Micha Silver

  
  
I'm having two problems when exporting the output of r.stream.order
to a shapefile.
I have attached the created table (saved in my setup in sqlite) to
the 'streams' map thru layer 2. Then 
v.db.select streams layer=2 
shows all the details of strahler order, prev_str, etc. 


First problem: When I try to do v.out.ogr, the column header named
"next_stream" fails because it's 10 characters long, too long for a
shapefile dbf. As a result all attributes are missing.  Here's a
patch to io.c in r.stream.order I put in place to correct this:

 [micha@SL6 r.stream.order]$ diff -u io.c.orig io.c
--- io.c.orig    2012-08-28 12:21:46.020275045 +0300
+++ io.c    2012-08-28 12:22:17.951382882 +0300
@@ -292,7 +292,7 @@
 /* table definition */
 char *tab_cat_col_name = "cat integer";
 char *tab_stream = "stream integer";
-    char *tab_next_stream = "next_stream integer";
+    char *tab_next_stream = "next_str integer";
 char *tab_prev_streams;
 char *tab_strahler = "strahler integer";
 char *tab_horton = "horton integer";
@@ -300,7 +300,7 @@
 char *tab_hack = "hack integer";
 char *tab_length = "length double precision";
 char *tab_cumlength = "cum_length double precision";
-    char *tab_stright = "stright double precision";
+    char *tab_stright = "straight double precision";
 char *tab_fractal = "fractal double precision";
 char *tab_distance = "out_dist double precision";
 char *tab_topo_dim = "topo_dim integer";

(Also corrects a small typo in the column name "stright")

After recompiling, then rerunning the r.stream.order addon, the
sqlite table now has all column headers <= 10 characters suitable
to shapefile.


Problem 2, where I'm stuck. I export the vector map using :
v.out.ogr streams layer=2 dsn=streams.shp
The process finishes OK, and the shape is created with all attrib
columns, but *all* values are NULL (including the cat). Any ideas
what I've done wrong? 

Thanks,
Micha 
  

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


[GRASS-user] FW: r.lake issues

2012-08-28 Thread ambrish dhaka



From: ambi...@hotmail.com
To: qgis-u...@lists.osgeo.org
Subject: r.lake issues
Date: Tue, 28 Aug 2012 04:55:59 +





HI! ALL
I have been trying to generate a lake feature from dem and seed raster files 
using r.lake, this is information below.

The areas are not created as values can be seen below.



r.lake dem=e15234@user1 seed=seed@user1 wl=50 lake=seed50

Lake depth from 0.00 to 0.00


Lake area 0.00 square meters


Lake volume 0.00 cubic meters


Volume is correct only if lake depth (terrain raster map) is in meters
Successfully finished
What could be the reason.
AMBRISH DHAKA
THANKS! IN ADVANCE


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


Re: [GRASS-user] 0, null values and raster algebra

2012-08-28 Thread Patrick Giraudoux

Le 28/08/2012 08:17, Patrick Giraudoux a écrit :

Hi,

I have some troubles managing 0, null values and r.colors. I just want 
to extract a particular habitat category from a Global Land Cover 2000 
raster into a raster of presence/absence (and NULL value for ocean and 
waterbodies)


This makes the following:

r.mapcalc "V7_01=if(AsiaGLC2000==7,1,0)"

So far so good, I get a raster V7_01 with null values and 1 for pixel 
of category 7, 0 for the others and null values stay NULL


Now, I would like to transform V7_01 into a floating point map, and 
then use r. neighbors for a neigborhood analysis.


r.mapcalc "V7=1.0*V7_01"

I get a raster named V7 BUT strangely for any color table, 0 value is 
considered NULL (transparent). The original NULL values are well kept 
and distinct in  this raster (e.g. NULL pixels are informed as NULL 
and 0 pixels are 0, respectively)


Any suggestion welcome, I am stuck...

Patrick



Sorry to respond to myself, but it looks like I am on the wrong list. I 
was working in GRASS but using QGIS as interface. Using and displaying 
the rasters within GRASS gives results that are absolutely correct. This 
means that the real trouble comes from QGIS reading from GRASS. So will 
move the question to the relevant list.


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