Re: [GRASS-user] loss of bash aliases

2008-03-06 Thread Philipp Steigenberger

Hamish schrieb:

Dylan:

I have the following line in my .bashrc:

alias l='ls -lh --color=auto'

After I start a GRASS session this alias seems to go away. Is
there anyway to respect user customization (i.e. .bashrc)
when initializing GRASS?
Or is this a user-related error?


GRASS's Init.sh does special tricks with $HOME and $bashrc so you can
save your command history, etc., for each mapset.

Then it tries to do:
  echo test -r ~/.alias  . ~/.alias  $bashrc

but at that point $HOME is already redefined so the real
/home/you/.alias is not the one it looks for there?
Fix with s/~/$USERHOME/ ??

(that bit of the code is a mess, I don't like to touch it)
(history file better handled with $HISTFILE ? see g.mapset warning)


Eric:

What happens if you copy your alias into ~/.grass.bashrc?


yes that works.


FWIW, my .grass.bashrc has:

.. /home/hamish/.alias
export HISTSIZE=3000

# first GRASS instance gets set a low priority (because we can)
NUMGRASSES=`pgrep -c Init.sh`
if [ $NUMGRASSES -le 1 ] ; then
   renice +17 -p $$
else
   NICENESS=`echo $NUMGRASSES | awk '{printf(%0.f, 20 / $1)}'`
   renice +$NICENESS -p $$
fi



Hamish


Hamish,
why does the test refer to .alias? As I wrote in the attached mail the 
bash-alias-file should be .bash_aliases


And what I don't understand either, not even if in the .grass.bashrc is 
defined


if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

the aliases work in grass.

... oh now I understand, do I? Do I have to change this entry in

if [ -f $USERHOME/.bash_aliases ]; then
. $USERHOME/.bash_aliases
fi

???

No... does not work ;o(

I have this solution to change the Init.sh (see below). But it isn't a 
good one. I hope for a better one with only one alias-definition-file.


Greets to the other side of the globe
cheers
Philipp


Philipp Steigenberger wrote at 03/04/08 11:10
Subject: [GRASS-user] .bash_aliases doesn't work in GRASS  Start 
without	g.gui

Hi

I noticed that my .bash_aliases is not affected when GRASS starts. I 
have a .grass.bashrc which is almost the same as the regular one. I want 
to have only one aliases-file, therefore I don't want to copy the aliases 
in the .grass.bashrc.


in the Init.sh in line 939 the test is

echo test -r ~/.alias  . ~/.alias  $bashrc

but the aliases files name which the .bashrc suggests to use is .bash_aliases

# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.

My solution to get all my aliases is to change the Init.sh every time I 
update my svn in line 948 where I insert the following lines:


 if [ -r $USERHOME/.bash_aliases ]
then
cat $USERHOME/.bash_aliases  $bashrc
fi

Is there another way?

Maybe somebody may change the Init.sh for better acting


[...]


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


[GRASS-user] (no subject)

2008-03-06 Thread Lukas Rohrer
Hello and thanks for your input

Is it possible to draw a Profile based on a digital hight model and a
selectet line?

Sincerely Lukas

--
--
Arbeit:
Tel: +41 44 632 55 98
ETH Zürich
Institut für terrestrische Ökosysteme
Professur Waldökologie
Universitätstrasse 22
CH-8092 Zürich
privat:
Lukas Rohrer
c/o Dietschi
Hohlstrasse 212
8004 Zürich
+41 43 322 03 26
+41 78 624 93 20
[EMAIL PROTECTED]
May the forest be with you!
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] (no subject)

2008-03-06 Thread Andrea Ricci

Lukas Rohrer wrote:

Hello and thanks for your input

Is it possible to draw a Profile based on a digital hight model and a
selectet line?

Sincerely Lukas

--
--
Arbeit:
Tel: +41 44 632 55 98
ETH Zürich
Institut für terrestrische Ökosysteme
Professur Waldökologie
Universitätstrasse 22
CH-8092 Zürich
privat:
Lukas Rohrer
c/o Dietschi
Hohlstrasse 212
8004 Zürich
+41 43 322 03 26
+41 78 624 93 20
[EMAIL PROTECTED]
May the forest be with you!
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


  

We made a script that draw a profile dem based tracking a line
The script export the profile in .dxf format with distances and level 
labels and write a text file with the profile metadata

There are some errors and bugs because it's in development.

Andrea Ricci, Pierpaolo Chiraz
gfosservices.it
#!/bin/bash
#
#
#
# MODULE:   r.section for GRASS 6.0 (GRASS Shell Script)
# AUTHOR(S):Andrea Ricci, Pierpaolo Chiraz
#
# PURPOSE:  Creates dxf territorial profile and dxf export; dem based
# COPYRIGHT:   (C) 2007 by the GFOSSERVICES
# REQUIREMENTS:
#
#   This program is free software under the GNU General Public
#   License (=v2). Read the file COPYING that comes with GRASS
#   for details.
#
###
#OUT=/tmp/out_$$
#set -m
#mkfifo $OUT

#%Module
#%  description: Create ascii_dxf profile from a raster dem.
#%End

#%option
#% key: cella
#% type: integer
#% answer: 10
#% description: (raster cells resolution)
#% required : yes
#%end

#%option
#% key: DEM
#% type: string
#% gisprompt: old,cell,raster
#% description: (input raster map)
#% required : yes
#%end

#%option
#% key: OUT2
#% type: string
#% answer: ascii
#% description: (Nome del file ascii di output)
#% required : yes
#%end

#%option
#% key: grass_vect
#% type: string
#% gisprompt: new,vector,vector
#% answer: sezione1
#% description: (Nome del file vettoriale di Grass)
#% required : yes
#%end

#%option
#% key: dxf_vect
#% type: string
#% answer: sezione1
#% description: (Nome del file .dxf)
#% required : yes
#%end

#%option
#% key: percorso_dxf
#% type: string
#% description: (Percorso di salvataggio del file dxf)
#% gisprompt: new_file,file,output
#% required : yes
#%end

#%option
#% key: fattore
#% type: integer
#% answer: 1
#% description: (fattore di esagerazione delle quote)
#% required : no
#%end

#%option
#% key: griglia
#% type: integer
#% answer: 100
#% description: (passo della griglia x,y)
#% required : no
#%end

#-Input testuale metadato-
#%option
#% key: meta
#% type: string
#% answer: 
#% description: (file con metadati della sezione)
#% gisprompt: new_file,file,input
#% required : no
#%end


if [ -z $GISBASE ] ; then
echo You must be in GRASS GIS to run this program.
exit 1
fi

if [ $1 != @ARGS_PARSED@ ] ; then
exec g.parser $0 $@
fi

DEM=$GIS_OPT_DEM
OUT2=$GIS_OPT_OUT2
grass_vect=$GIS_OPT_GRASS_VECT
dxf_vect=$GIS_OPT_DXF_VECT
percorso_dxf=$GIS_OPT_PERCORSO_DXF
cella=$GIS_OPT_CELLA
OUT=$GIS_OPT_OUT
meta=$GIS_OPT_META
fattore=$GIS_OPT_FATTORE
griglia=$GIS_OPT_GRIGLIA


if [ -z $cella ] ; then
cella=1;echo -n Risoluzione del raster (Dimensioni del lato della cella)= 
$cella metri  
fi

g.region res=$cella

#Punti della sezione (linea) tramite la quale si calcolano i valori di 
giacitura del piano
xmessage '  INSERISCI 2 PUNTI PER INDIVIDUARE LA TRACCIA DI SEZIONE  ' 
d.what.rast -t   punti_sezione

cat punti_sezione | grep -vpunti_sezione_corretti   
N_punti_corretti=` cat punti_sezione_corretti | wc -l`

z=$(($N_punti_corretti/2))
#--
#ciclo per ottenere la X e la Y dei due punti individuati
#--
for ((x=1; x=$z; x++)) do
#creazione di un file di estrapolazione dati corretto (cioe' senza 
linee vuote)
b=$(($x*2))  
cat punti_sezione_corretti | sed 's/:/ /g' | awk -F   '( NR == '$b' ) 
{ print $1, $2 }'  XY_PUNTI_FINALE
done
#--
#ciclo per ottenere la Z dei due punti individuati
#--
cat punti_sezione | grep  actual | sed 's/,/ /g' | sed 's/:/ /g'  
z_punti_sezione_corretti
NR_Z=` cat z_punti_sezione_corretti | wc -l`

for ((x=1; x=$NR_Z; x++)) do
cat z_punti_sezione_corretti | awk -F   '( NR == '$x' ) { print $3 }' 
 Z_PUNTI_FINALE
done
#--
#rimozione di alcuni files testuali
rm punti_sezione punti_sezione_corretti z_punti_sezione_corretti


[GRASS-user] Re: Ongoing r.in.wms issue

2008-03-06 Thread [EMAIL PROTECTED]

Hamish, if you're ever in Sydney, I owe you a beer/wine/spirits/coffee.

This worked. I can now hand off both the built-in scripts and the 
home-made WMS generic download script to my colleagues without the pangs 
of guilt! Thanks!


Richard

Hamish wrote:

Richard Chirgwin wrote:
  

here is all the debug information that popped out:

D1/1: -n

Everything else is as you have seen before...

/Applications/Grass-6.3.app/Contents/MacOS/etc/r.in.wms/wms.download:

line 118: eval: -n: invalid option
eval: usage: eval [arg ...]
(etc)




I found it- non-portable use of 'echo -n' in wms.request, line 223:

223   #reset the requestfile
224   echo -n   ${REQUESTFILE}


can you try just removing the -n on that line?
  http://trac.osgeo.org/grass/changeset/30479


that will result in an extra blank line at the top of the request file
(wms/downoad/*.curl), but I am pretty sure that won't make any
difference as the $CONTENTS for loop in wms.download will filter out
any extra whitespace.


Hamish



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 



  

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


[GRASS-user] Update - Check points in polygons

2008-03-06 Thread Corrado
Thanks a lot to all of you!

To keep you up to date:

METHOD1
1) v.in.ogr 
dsn=/home/ct529/Documents/Projects/UKBryophytes/Datasets/BRYOPHYTES/BRYOPHYTES/SSSI_vectors/ENGLAND.shp
 
output=England_SSSI layer=ENGLAND min_area=0.0001 snap=-1 
location=England_from_shapefile
2) v.clean input=England_SSSI output=England_SSSI_clean 
error=England_SSSI_error tool=bpol
3) v.in.ascii 
input=/home/ct529/Documents/Projects/UKBryophytes/Datasets/species_sites_100m.csv
 
output=species_100m format=point fs=, skip=0 x=4 y=5 z=0 cat=0
4) in postgresql: alter table species_100m add colum sssi_name varchar(120);
5) v.distance from=species_100m to=England_SSSI dmax=0 upload=to_attr 
to_column=sssi_name col=sssi_name
6) in postgresql: select species_name,sssi_name,count(species_id) from 
species_100m where sssi_name is not null group by species_name,sssi_name 
order by species_name;

What do you think? I may now run it on dmax=100 and dmax=500.


METHOD2
Today I am going to try Roger's method, combining GRASS and R ,so that I can 
compare.

METHOD3
I would like to develop a comparative method using only grass, and reading the 
shape file directly (without going through spgrass6) using readOGR and the 
rgdal library. Any clue?

I think when I wrote back to the project leader that the problem was solved, 
she as rather impressed by GRASS and by the GRASS community.

Best Regards
-- 
Corrado Topi

Global Climate Change and Biodiversity
Area 18,Department of Biology
University of York, York, YO10 5YW, UK
Phone: + 44 (0) 1904 328645, E-mail: [EMAIL PROTECTED]
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Re: Signature made by i.class not accessible?

2008-03-06 Thread Paula . Sankelo
Hi all,

"are the
signature files saved to the current directory, or in a folder off of
the current directory; then if you change directory before trying the
next module it won't be able to find them?"

Whichever
directory I'm working in, the signature files are always saved under
the image subgroup. If the raster maps I am analyzing are in group
"testi" and subgroup "alatesti", the signature files will be saved in a
directory called "sig" under my subgroup "alatesti". That is, they will
be in /paula/groups/testi/subgroups/alatesti/sig/ 

This is
always true, no matter if I create the signatures with i.cluster, or
r.digit  i.gensigset, or i.class. I've tried all these. And the
rights to the signature file are always the same. i.maxlik can access
the 
signature files created with i.cluster and i.gensigset, just not the ones created with i.class. And even if I work in that directory (groups/testi/subgroups/alatesti/sig), I still can't access the signature. 

"can you
recreate the error with the spearfish for new NC sample datasets? if so
can you post all commands and messages from that process?"

I strongly suspect I will have the same problem even with the Spearfish
data set, because it occurs no matter which data I am using. I will try
it next, however. Thanks for the tip! The commands I'm using are just: 

 i.class map=varikuva group=testi subgroup=alatesti outsig=signature

-Then there's the whole choosing and analyzing the test regions in the graphic window. When that's finished, I say:

 i.maxlik group=testi subgroup=alatesti sigfile=signature class=resultmap

And I get the error message:

ERROR: Can't read signature file [signature].

Still, the signature file IS created, and I can see it sitting and lurking there. I just can't use it.

"try removing the @mapset part from the group names in the GUI window."

I am calling i.class from the command line, and then I'm calling
i.maxlik from the command line as well. So, normally I don't open the
GUI for this. If I do open the GUI window for the i.maxlik, and try
from there, and make sure that the @mapset doesn't appear, I still get
the same error message.

Thanks for the messages and the suggestions!

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


[GRASS-user] Re: Using GRASS to solve the Checking if a point (X, Y) is inside the, polygons of a shape file using command line.

2008-03-06 Thread Hamish
Corrado wrote:
 Where do I find these files, like poly.c? I cannot find them on my 
 installation. I have 6.2.3 on Ubuntu 7.10, with the grass-dev package
 installed. 
 
 Do I have to use python?
 
 I thought I could use a bash script.


I was meaning fundamentally those functions are present in the C source
code if you want to have a peek under the bonnet:
  http://trac.osgeo.org/grass/browser/grass/trunk/lib/vector/Vlib/

If that's a bit dense you can check out what the Programmer's module:
  http://download.osgeo.org/grass/grass6_progman/


But typically you should be able to get at whatever functionality you
need from the modules (command line / GUI interfaces). There isn't much
you can't do with the modules, it may not be obvious which module
contains the functionality, but if you keep searching+asking eventually
a solution comes to light.

If you must have access to a function not covered by a module or e.g.
want to write a high performance custom model into a new module, you
can get access to those C library functions using the SWIG Python
interface without having to mess with knowing C.


Hamish



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


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


Re: [GRASS-user] (no subject)

2008-03-06 Thread Hamish
Lukas Rohrer wrote:
 Is it possible to draw a Profile based on a digital hight model and a
 selectet line?


sure, see r.profile and r.transect modules.

If your line is already a vector line and not just a collection of
coordinates, you could use 'v.out.ascii format=standard' first to get
the line's coordinates. r.profile will take input from stdin, so with a
little awk magic you could pipe v.out.ascii directly into r.profile. If
you figure that out, maybe post it back here so we could add it as an
example on the r.profile help page.


see also the profile tool in the GIS.m GUI menu for interactive profile
creation. (you could display the line and trace over it)


Hamish



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 


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


RE: [GRASS-user] loss of bash aliases

2008-03-06 Thread Patton, Eric
Hamish:
FWIW, my .grass.bashrc has:

.. /home/hamish/.alias
export HISTSIZE=3000

Thank you! I was trying to think of what that variable name was to extend
my mapset history beyond 500 records. 

# first GRASS instance gets set a low priority (because we can)
NUMGRASSES=`pgrep -c Init.sh`
if [ $NUMGRASSES -le 1 ] ; then
   renice +17 -p $$
else
   NICENESS=`echo $NUMGRASSES | awk '{printf(%0.f, 20 / $1)}'`
   renice +$NICENESS -p $$
fi

What is the result of this - that all Grass processes get a low priority
compared to the rest of the OS? 

~ Eric.



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


[GRASS-user] Starspan/GRASS question

2008-03-06 Thread Thomas Adams

List:

My apologies for the background info. leading-up to my question…

I've seen mention of starspan previously and now I think it's time for 
me to learn more. Let me pose a problem to you to see if starspan would 
be of help. I am working on a modeling project with a couple of other 
people that involves the following:


(1) downloading and decoding gridded fields of numerical weather 
prediction (NWP) model output
(2) ingesting the decoded data into GRASS to calculate basin average 
precipitation  temperature (separate grids) for each subbasin
(3) writing out all calculated basin average values for each grid to 
separate files (one file contains one time step of data for all 
subbasins) for both temperature  precipitation
(4) for data management reasons, the files from (3) are written to a 
PostgreSQL database
(5) once all time steps of gridded precipitation and temperature field 
data are written to the PostgreSQL database, another process collects 
the data and generates individual ascii time series files for each 
subbasin for both temperature  precipitation
(6) once (5) is completed a hydrologic model runs using the temperature 
 precipitation time series as input and hydrologic forecasts are 
generated.


This is suppose to be a *real-time* process. The problem I am having is 
a matter of scale. What I did not say is that there are 12 different 
sets of NWP output covering a period of 168 hours at 6-hour time steps 
for both temperature  precipitation. So, this means I must process 
12*2*(168/6) = 672 grids. Also, I need the mean areal values for 686 
subbasins within the domain for each of the grids.


Steps (2-4) take about 20 seconds total for each of the grids… which is 
~7.5 hours total
Step-5 also takes about 20 seconds for each time series file… which is 
~7.5 hours total


So, about 15 hours total. Now, I can cut this time in half by running 
the processing of the temperature  precipitation grids and generating 
their separate time series files in parallel, rather than sequentially. 
So, I can get to about 7 hours fairly easily — what I am shooting for is 
to get the processing time from 7 hours to about 3 hours (or less).


I need to more efficiently generate the many basin average time series 
files from the numerous grids. Can starspan help by reducing the time to 
calculate the the basin average values faster?


I would also appreciate any/all suggestions on how to efficiently go 
from 'starspan generated basin average values' to my time series files. 
Realize, of course, the the individual grids are only a slice in time, 
so I have to track the grids and their resulting individual basin values 
(in time) to generate the time series files.


To compound the problem, very soon, I need to add model grids from an 
additional 21 models, bringing the total from 12 to 33!


Regards,
Tom

--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  [EMAIL PROTECTED]

VOICE:  937-383-0528
FAX:937-383-0033

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


[GRASS-user] get x,y from gravity point of a centroid

2008-03-06 Thread christian Brandt

Dear list,

how can I get the x,y -coordinates from the gravity point of a centroid ?

Regards

Chris

_
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Re: Update - Check points in polygons

2008-03-06 Thread John C. Tull
That's great to hear. If there is to be a complaint about open source,  
it would be that there are many great ways to achieve the same result.  
Of course, this is actually a compliment.


You will find the environment that you are most comfortable working in  
and develop your own solutions. If you are comfortable with postgis,  
you can do all of it there as well. That is not something I have done,  
but I know it is possible. You might take a look at this post and  
ferret out the slides from the talk that are available online as well.


http://postgis.refractions.net/pipermail/postgis-users/2007-July/016358.html

Cheers,
John

On Mar 6, 2008, at 2:12 AM, Corrado wrote:

Thanks a lot to all of you!

To keep you up to date:

METHOD1
1) v.in.ogr
dsn=/home/ct529/Documents/Projects/UKBryophytes/Datasets/BRYOPHYTES/ 
BRYOPHYTES/SSSI_vectors/ENGLAND.shp

output=England_SSSI layer=ENGLAND min_area=0.0001 snap=-1
location=England_from_shapefile
2) v.clean input=England_SSSI output=England_SSSI_clean
error=England_SSSI_error tool=bpol
3) v.in.ascii
input=/home/ct529/Documents/Projects/UKBryophytes/Datasets/ 
species_sites_100m.csv

output=species_100m format=point fs=, skip=0 x=4 y=5 z=0 cat=0
4) in postgresql: alter table species_100m add colum sssi_name  
varchar(120);

5) v.distance from=species_100m to=England_SSSI dmax=0 upload=to_attr
to_column=sssi_name col=sssi_name
6) in postgresql: select species_name,sssi_name,count(species_id) from
species_100m where sssi_name is not null group by  
species_name,sssi_name

order by species_name;

What do you think? I may now run it on dmax=100 and dmax=500.


METHOD2
Today I am going to try Roger's method, combining GRASS and R ,so  
that I can

compare.

METHOD3
I would like to develop a comparative method using only grass, and  
reading the
shape file directly (without going through spgrass6) using readOGR  
and the

rgdal library. Any clue?

I think when I wrote back to the project leader that the problem was  
solved,

she as rather impressed by GRASS and by the GRASS community.

Best Regards
--
Corrado Topi

Global Climate Change and Biodiversity
Area 18,Department of Biology
University of York, York, YO10 5YW, UK
Phone: + 44 (0) 1904 328645, E-mail: [EMAIL PROTECTED]


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


Re: [GRASS-user] Starspan/GRASS question

2008-03-06 Thread Jonathan Greenberg
So if I understand this correctly, you have some polygon surface that 
defines the extent of your subbasin, which you want to use to query and 
summarize the raster values falling within it (e.g. precip and temp), 
correct?  How are you doing it currently?  The main speedup that 
starspan gets you is that the polygon - raster query should be 
significantly faster than a zonalstats type analysis.  With that said 
(and I'll need to talk to Carlos, the lead programmer of starspan, about 
this) there might be some tricks you can use if you are extracting using 
the same polygons and the same grids (in terms of size of raster, number 
of samples, lines, geographic extent, etc...)  The idea is basically 
there are two processing bottlenecks: 1) determining the polygon/raster 
intersection and 2) the i/o and actual extraction of the data.  #1 could 
be made faster if you are always using the same polys and grids, since 
you could (in theory) only determine the intersection once...


While we kick this around on our end, I'd recommend grabbing the latest 
and greatest version of starspan, and trying it out!


--j

Thomas Adams wrote:

List:

My apologies for the background info. leading-up to my question…

I've seen mention of starspan previously and now I think it's time for 
me to learn more. Let me pose a problem to you to see if starspan would 
be of help. I am working on a modeling project with a couple of other 
people that involves the following:


(1) downloading and decoding gridded fields of numerical weather 
prediction (NWP) model output
(2) ingesting the decoded data into GRASS to calculate basin average 
precipitation  temperature (separate grids) for each subbasin
(3) writing out all calculated basin average values for each grid to 
separate files (one file contains one time step of data for all 
subbasins) for both temperature  precipitation
(4) for data management reasons, the files from (3) are written to a 
PostgreSQL database
(5) once all time steps of gridded precipitation and temperature field 
data are written to the PostgreSQL database, another process collects 
the data and generates individual ascii time series files for each 
subbasin for both temperature  precipitation
(6) once (5) is completed a hydrologic model runs using the temperature 
 precipitation time series as input and hydrologic forecasts are 
generated.


This is suppose to be a *real-time* process. The problem I am having is 
a matter of scale. What I did not say is that there are 12 different 
sets of NWP output covering a period of 168 hours at 6-hour time steps 
for both temperature  precipitation. So, this means I must process 
12*2*(168/6) = 672 grids. Also, I need the mean areal values for 686 
subbasins within the domain for each of the grids.


Steps (2-4) take about 20 seconds total for each of the grids… which is 
~7.5 hours total
Step-5 also takes about 20 seconds for each time series file… which is 
~7.5 hours total


So, about 15 hours total. Now, I can cut this time in half by running 
the processing of the temperature  precipitation grids and generating 
their separate time series files in parallel, rather than sequentially. 
So, I can get to about 7 hours fairly easily — what I am shooting for is 
to get the processing time from 7 hours to about 3 hours (or less).


I need to more efficiently generate the many basin average time series 
files from the numerous grids. Can starspan help by reducing the time to 
calculate the the basin average values faster?


I would also appreciate any/all suggestions on how to efficiently go 
from 'starspan generated basin average values' to my time series files. 
Realize, of course, the the individual grids are only a slice in time, 
so I have to track the grids and their resulting individual basin values 
(in time) to generate the time series files.


To compound the problem, very soon, I need to add model grids from an 
additional 21 models, bringing the total from 12 to 33!


Regards,
Tom



--

Jonathan A. Greenberg, PhD
Postdoctoral Scholar
Center for Spatial Technologies and Remote Sensing (CSTARS)
University of California, Davis
One Shields Avenue
The Barn, Room 250N
Davis, CA 95616
Cell: 415-794-5043
AIM: jgrn307, MSN: [EMAIL PROTECTED], Gchat: jgrn307
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Starspan/GRASS question

2008-03-06 Thread Thomas Adams

Jonathan,

I think you have the problem correct. Attached is a gif image that shows 
my 686 subbasins (polygons) in green. I need to get average values of 
temperature  precipitation for each of the polygon areas for numerous 
rasters. From the values, I then generate the time series files for each 
subbasin area (i.e., each polygon).


Thanks very much for your reply!

Regards,
Tom

Jonathan Greenberg wrote:
So if I understand this correctly, you have some polygon surface that 
defines the extent of your subbasin, which you want to use to query 
and summarize the raster values falling within it (e.g. precip and 
temp), correct?  How are you doing it currently?  The main speedup 
that starspan gets you is that the polygon - raster query should be 
significantly faster than a zonalstats type analysis.  With that said 
(and I'll need to talk to Carlos, the lead programmer of starspan, 
about this) there might be some tricks you can use if you are 
extracting using the same polygons and the same grids (in terms of 
size of raster, number of samples, lines, geographic extent, etc...)  
The idea is basically there are two processing bottlenecks: 1) 
determining the polygon/raster intersection and 2) the i/o and actual 
extraction of the data.  #1 could be made faster if you are always 
using the same polys and grids, since you could (in theory) only 
determine the intersection once...


While we kick this around on our end, I'd recommend grabbing the 
latest and greatest version of starspan, and trying it out!


--j

Thomas Adams wrote:

List:

My apologies for the background info. leading-up to my question…

I've seen mention of starspan previously and now I think it's time 
for me to learn more. Let me pose a problem to you to see if starspan 
would be of help. I am working on a modeling project with a couple of 
other people that involves the following:


(1) downloading and decoding gridded fields of numerical weather 
prediction (NWP) model output
(2) ingesting the decoded data into GRASS to calculate basin average 
precipitation  temperature (separate grids) for each subbasin
(3) writing out all calculated basin average values for each grid to 
separate files (one file contains one time step of data for all 
subbasins) for both temperature  precipitation
(4) for data management reasons, the files from (3) are written to a 
PostgreSQL database
(5) once all time steps of gridded precipitation and temperature 
field data are written to the PostgreSQL database, another process 
collects the data and generates individual ascii time series files 
for each subbasin for both temperature  precipitation
(6) once (5) is completed a hydrologic model runs using the 
temperature  precipitation time series as input and hydrologic 
forecasts are generated.


This is suppose to be a *real-time* process. The problem I am having 
is a matter of scale. What I did not say is that there are 12 
different sets of NWP output covering a period of 168 hours at 6-hour 
time steps for both temperature  precipitation. So, this means I 
must process 12*2*(168/6) = 672 grids. Also, I need the mean areal 
values for 686 subbasins within the domain for each of the grids.


Steps (2-4) take about 20 seconds total for each of the grids… which 
is ~7.5 hours total
Step-5 also takes about 20 seconds for each time series file… which 
is ~7.5 hours total


So, about 15 hours total. Now, I can cut this time in half by running 
the processing of the temperature  precipitation grids and 
generating their separate time series files in parallel, rather than 
sequentially. So, I can get to about 7 hours fairly easily — what I 
am shooting for is to get the processing time from 7 hours to about 3 
hours (or less).


I need to more efficiently generate the many basin average time 
series files from the numerous grids. Can starspan help by reducing 
the time to calculate the the basin average values faster?


I would also appreciate any/all suggestions on how to efficiently go 
from 'starspan generated basin average values' to my time series 
files. Realize, of course, the the individual grids are only a slice 
in time, so I have to track the grids and their resulting individual 
basin values (in time) to generate the time series files.


To compound the problem, very soon, I need to add model grids from an 
additional 21 models, bringing the total from 12 to 33!


Regards,
Tom






--
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:  [EMAIL PROTECTED]

VOICE:  937-383-0528
FAX:937-383-0033

inline: ohrfc.subbasins.gif___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Re: Update - Check points in polygons

2008-03-06 Thread Corrado
Dear John,

I have used postgis to load a shapefile into the postgres database, by means 
of shp2pgsql.

When I then start grass, how could I can connect to the databse, but I do not 
understand how to generate a vector map from the postgis table.

Any help?

Best Regards
-- 
Corrado Topi

Global Climate Change and Biodiversity
Area 18,Department of Biology
University of York, York, YO10 5YW, UK
Phone: + 44 (0) 1904 328645, E-mail: [EMAIL PROTECTED]
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Re: Update - Check points in polygons

2008-03-06 Thread John C. Tull
I have not found a way to work directly with postgis tables. You can  
use v.in.ogr like this:
v.in.ogr dsn=PG:dbname=your_postgis_db host=yourhost  
layer=table_from_postgis out=new_layer


You then have the postgis table available as a layer in grass, but you  
will not be able to edit it directly from grass to my knowledge.  
Someone else might be able to supply the v.out.ogr statement that  
would update the table in postgis.


Cheers,
John

On Mar 6, 2008, at 8:57 AM, Corrado wrote:

Dear John,

I have used postgis to load a shapefile into the postgres database,  
by means

of shp2pgsql.

When I then start grass, how could I can connect to the databse, but  
I do not

understand how to generate a vector map from the postgis table.

Any help?

Best Regards
--
Corrado Topi

Global Climate Change and Biodiversity
Area 18,Department of Biology
University of York, York, YO10 5YW, UK
Phone: + 44 (0) 1904 328645, E-mail: [EMAIL PROTECTED]


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


Re: [GRASS-user] a few suggestions and questions

2008-03-06 Thread Dylan Beaudette
On Wednesday 05 March 2008, Jarek Jasiewicz wrote:
 Dylan Beaudette wrote:
  On Monday 03 March 2008, Jarosław Jasiewicz wrote:
  Nikos Alexandris pisze:
  On Mon, 2008-03-03 at 22:52 -0300, Carlos Guâno Grohmann wrote:
  Hello all
 
  [...]
 
  is plan curvature in r.param.scale broken? I can't get a map of it.
  profc works fine. Also is it possible to make r.param.scale work in
  latlong regions? (please?)
 
  it is imposible due to polinominal fitting when window is more than 3
 
  This may reveal my level of understanding of the r.param.scale module,
  but why should the profile curvature be impossible to calculate when the
  window size is  3x3 ?
 
  Thanks
 
  Dylan
 
  Probably not! Just tested... and it says: Lat/Long location is not
  supported
 
  Maybe check the PhD thesis:
  www.soi.city.ac.uk/~jwo/phd/
 
 
  ___
  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

 I analised the code of (I need that solution for some other problem).
 The module use polinominal fitting to calculate is written to work on
 rectangular grid, so program shoud be compeeltly rewriten to use
 lat-long. As far as I know - r.param scale is now development as
 Landserf maybe try this but I cant say if landserf can work on lat-long
 (I suppose - yes)

Ah- OK. It looks like the problem is with the fitting of polynomials in LL 
locations, and NT the  3x3 grid / plan curv. problem-- that must be related 
to a bug.

I don't see a ticket for r.param.scale on the trac site.

Carlos- can you please create one with any example you might have?

Thanks,

Dylan

-- 
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] I need help

2008-03-06 Thread Nikos Alexandris

On Thu, 2008-03-06 at 13:18 +0100, Raonel wrote:
Hi Raonel!

 I have already discharged the installer of Grass but I am not able to
 install it. I have the manual but I don't understand the form that they
 explain as making it

Which operating system do you use?
Which version of GRASS are you trying to install?


 
 ___
 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] I need help

2008-03-06 Thread Nikos Alexandris

On Thu, 2008-03-06 at 14:07 +0100, Raonel wrote:
 Nikos Alexandris escribió:
  On Thu, 2008-03-06 at 13:18 +0100, Raonel wrote:
  Hi Raonel!
 

  I have already discharged the installer of Grass but I am not able to
  install it. I have the manual but I don't understand the form that they
  explain as making it
[...]

 I execute the command sh grass6install.sh
 grass-6.2.2.tar.gz_Linux_bin.tar.gz and he doesn't find the directory.

Can you be more specific please?

I assume you try to install GRASS under linux. Which distribution
(version) of linux?

From where did you download GRASS (the 
grass-6.2.2.tar.gz_Linux_bin.tar file)  and the grass6install.sh
script?

 You speak spanish?
Hmmm, un poquito! Entiendo mas o menos pero este foro es en ingles.
Podria darme mas informacion por favor ( aunque sea en Spanglish) ;-)


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


Re: [GRASS-user] I need help

2008-03-06 Thread Philipp Steigenberger



Nikos Alexandris schrieb:

On Thu, 2008-03-06 at 14:07 +0100, Raonel wrote:
  

Nikos Alexandris escribió:


On Thu, 2008-03-06 at 13:18 +0100, Raonel wrote:
Hi Raonel!

  
  

I have already discharged the installer of Grass but I am not able to
install it. I have the manual but I don't understand the form that they
explain as making it


[...]
  
  
  

I execute the command sh grass6install.sh
grass-6.2.2.tar.gz_Linux_bin.tar.gz and he doesn't find the directory.



Can you be more specific please?

I assume you try to install GRASS under linux. Which distribution
(version) of linux?

From where did you download GRASS (the 
grass-6.2.2.tar.gz_Linux_bin.tar file)  and the grass6install.sh

script?

  

You speak spanish?


Hmmm, un poquito! Entiendo mas o menos pero este foro es en ingles.
Podria darme mas informacion por favor ( aunque sea en Spanglish) ;-)


___

  

Hola Raonel,
bien venido al mundo GRASS
aquí una lista de difusión en español:

http://lists.osgeo.org/mailman/listinfo/grass-es

quizá vas a encontrar ayuda por allá.

swich to inglés...

You have to unpack the tar.gz by

tar xvfz grass-6.2.2.tar.gz_Linux_bin.tar.gz

Then change into this directory and read the README.
run the .configure.sh
if this works well

you can run

make

and

make install.

If you get errors from the configure.sh., tell them again

Es muy importante que siempre cuando escribes un mail a la lista añades 
la version de GRASS y el sistema (Ubuntu, suse, debian ...) y el numero 
de la version, para que la comunidad sepa las informaciones básicas. 
Además usa un sujeto más significativo como Problems by installing 
GRASS 6.2.2. Casi toda la gente que escribe al foro needs help :-P


Mucha suerte
saludos
Philipp

PS: Nikos, Ich dachte Du schreibst aus Griechenland... aber weit 
gefehlt. ;-) Grüße aus Augsburg
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] I need help

2008-03-06 Thread Nikos Alexandris

On Thu, 2008-03-06 at 23:09 +0100, Philipp Steigenberger wrote:
 
 
[...]

 Hola Raonel,
 bien venido al mundo GRASS
 aquí una lista de difusión en español: 
 
 http://lists.osgeo.org/mailman/listinfo/grass-es 
 
 quizá vas a encontrar ayuda por allá.
 
 swich to inglés...
 
 You have to unpack the tar.gz by
 
 tar xvfz grass-6.2.2.tar.gz_Linux_bin.tar.gz

Really,

I couldn't trace this file? For which distro is it?
 
 Then change into this directory and read the README.
 run the .configure.sh
 if this works well
 
 you can run 
 
 make
 
 and 
 
 make install.
 
 If you get errors from the configure.sh., tell them again
 
 Es muy importante que siempre cuando escribes un mail a la lista
 añades la version de GRASS y el sistema (Ubuntu, suse, debian ...) y
 el numero de la version, para que la comunidad sepa las informaciones
 básicas. Además usa un sujeto más significativo como Problems by
 installing GRASS 6.2.2. Casi toda la gente que escribe al foro needs
 help :-P 
 
 Mucha suerte
 saludos
 Philipp
 
 PS: Nikos, Ich dachte Du schreibst aus Griechenland... aber weit
 gefehlt. ;-) Grüße aus Augsburg

Hallo Philipp. Ich bin in Freiburg und jeder dritte Erasmus-Student ist
ein Spanier. Also man muss zumindest die basics beherschen ;-)

Viele Gruesse,

Nikos

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


[GRASS-user] Writing recode rules into a Postgres Database

2008-03-06 Thread William Hudspeth
Hello,

I would like to explain the problem I am trying to solve. I begin with
importing a shapefile of county boundaries into a GRASS vector map. I
then convert the vector map into a raster map using a county ID code in
the vector map attributes. What I get is a raster map with pixels coded
into some 30 different county ID categories. I also have a second raster
map whose pixels are assigned one of a continuous range of floating
point values (i.e. dust concentration).

I then use r.average to recode the county map IDs into a new map that
has counties coded by average dust concentration. When I run r.info I
get something like this:

***
raster file fips_county2

generated by r.recode
recode of raster file fips_county2
0:0:0.00
35001:35001:5.4066317414
35003:35003:5.9971417728
35005:35005:3.9597935272
35006:35006:7.5931687376
35007:35007:5.3254945193
35009:35009:0.9088373997
35011:35011:2.3610553445
35013:35013:21.1810002482



The recode rules on each line show that the county ID numbers (e.g.
35001) are recoded into average dust concentration values (e.g.
5.4066317414).

I am interested in taking these two pieces of information, county ID and
average dust concentration, and for each county, appending them as a row
to a PostgreSQL database table. I have thought of parsing the recode
files in the hist directories using a scripting language, but would like
to try something more straightforward. Any ideas?

Thanks very much, Bill

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


Re: [GRASS-user] I need help

2008-03-06 Thread Paul Kelly



On Thu, 6 Mar 2008, Paul Kelly wrote:


On Thu, 6 Mar 2008, Philipp Steigenberger wrote:


I execute the command sh grass6install.sh
grass-6.2.2.tar.gz_Linux_bin.tar.gz and he doesn't find the directory.


Can you give the exact command-line you typed, and the exact error mesage 
(copied and pasted). This would make it a lot easier to debug.


[...]

You have to unpack the tar.gz by

tar xvfz grass-6.2.2.tar.gz_Linux_bin.tar.gz


No that's not correct. grass6install.sh is the binary installer script


Replying to myself, sorry I missed the very weird looking filename there 
(tar.gz in the middle and at the end doesn't look right). I think Philipp 
is right and it is actually a source distribution tarball but has been 
renamed with bin in the name just to confuse things In which case his 
instructions about ./configure, make etc. apply. I'm really just 
guessing though.


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


Re: [GRASS-user] I need help

2008-03-06 Thread Philipp Steigenberger

Paul Kelly wrote:



On Thu, 6 Mar 2008, Paul Kelly wrote:


On Thu, 6 Mar 2008, Philipp Steigenberger wrote:


I execute the command sh grass6install.sh
grass-6.2.2.tar.gz_Linux_bin.tar.gz and he doesn't find the directory.


Can you give the exact command-line you typed, and the exact error 
mesage (copied and pasted). This would make it a lot easier to debug.


[...]

You have to unpack the tar.gz by

tar xvfz grass-6.2.2.tar.gz_Linux_bin.tar.gz


No that's not correct. grass6install.sh is the binary installer script


Replying to myself, sorry I missed the very weird looking filename there 
(tar.gz in the middle and at the end doesn't look right). I think 
Philipp is right and it is actually a source distribution tarball but 
has been renamed with bin in the name just to confuse things In which 
case his instructions about ./configure, make etc. apply. I'm really 
just guessing though.


Paul


Raonel, I would suggest that you download again the actual stable version:

Here http://grass.itc.it/download/index.php
(optionally you can choose the mirror nearest to you here: 
http://grass.itc.it/mirrors.php)


you can choose your distribution in the binary column. Or you download 
the sourcecode and compile it by yourself (more complicated):


http://grass.itc.it/grass62/source/grass-6.2.3.tar.gz

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