Wednesday, December 17, 2008

My first JGrass modules

Finally I decided to start to work in the new JGrass developing some hydrological modules (like I did in the JGrass2.0).
Just for exercise and fun I did this two interesting modules, available from the next JGrass release:
  • r.cutout
  • h.hypsographic
This two modules are developed, as all the others in JGrass, following the OpenMI guidelines.

r.cutout

r.cutout allows the user to cut a map on the region defined by an other map that is considered as the MASK. There is also the option to invert the extraction and extract the output map as the complementary of the MASK map in the active region.
The usage is the following:

  • standard mode: jgrass r.cutout --igrass-mask adigebz_nabla --igrass-tocut ad_pit4 --ograss-cut adigebzmask_pit
  • invert mode: jgrass r.cutout --igrass-mask adigebz_nabla --igrass-tocut ad_pit4 --ograss-cut adigebzmask_pit --invert true
where:

--igrass-mask: is the name of the input raster map containing the MASK -> the map that defines the region to cut out
--igrass-tocut: is the input map to cut out
--ograss-cut: is the output cut map over the defined region
--invert is the boolean that indicates the mode of calculation, default is FALSE -> standard mode, for the complementary map use TRUE

In term of pictures.
Starting from the two maps:
  • the map of NABLA calculated on the extracted basin
  • the whole map of depitted elevations
  • obtain the map of depitted elevations on the extracted basin
  • obtain the map of depitted elevation on the extracted basin's complementary area in the active region



r.hypsographic

r.hypsographic allows the user to create the hypsographic curve of a map limited to the active region. The hypsographic curve is usually calculated starting from an elavation map and it is described by the cumulative height frequency curve for the Earth’s surface or some part thereof. A hypsometric curve is essentially a graph that shows the proportion of land area that exists at various elevations by plotting relative area against relative height (http://www.britannica.com/EBchecked/topic/280163/hypsometric-curve).
The usage is the following:
jgrass h.hypsographic --igrass-elevation bz_bacino.pit --bins 50 --ochart-hypsographic "LINE#hypsografic curve#heigth[m smm]#area[km2]#hypso"

where:

--igrass-elevation: is the name of the input raster map of elevation
--bins: is the number of bins in which divide the entire range of heigth of the raster map (default is 100)
--oscalar-hypsographic: is the output scalar set
--ochart-hypsographic: is a way to visualize the output scalar set in a chart

In the example below:
  • the input elevation map on the basin
  • the output hypsographic chart

Sunday, November 16, 2008

Flood expectancy

There is a part of a book I am reading in these days that I consider a part of my thought, since it is well written I decided to add to my blog... :-)

"There are hundreds of thousands of culverts and small bridges over which roads and highways span channel of various size. If the capacity of such culverts were too small and many of them washed out, the expense would be very great. But if overdesign were the rule, money for construction would be needlessly spent." ... "It has been decided that culverts constructed with federal money would be designed to carry without failure a flood discharge with a recurrence interval of 50 years. Such decision places an enormous buden on hydrologists. They must develop simple but dependable methods to estimate flood discharge in ungaged areas in diverse climates and topography and for various basin sizes."
...
"A different kind of social cost results from the fact that people use flood-prone areas. Despite their knowledge of the importance of flood estimates, individuals continue to build on floodplains, encroaching on parts of rivers needed to carry rather ordinary discharges. The floodplain level is equaled or exceeded about one a year. So despite the vast sums spet on controlling floods, flood damage continues to rise year after year and is measured in bilions of dollars. Per-capita flood damage increased two and a half times in the United States between 1916 and 1985."


We should think about this...

Tuesday, August 19, 2008

If you can't be a pine on the top of the hill
Be a scrub in the valley
but be the best little scrub by the side of the hill,
Be a bush
if you can't be a tree.
If you can't be a highway
just be a trail
If you can't be the sun
be a star;
It isn't by size that you win or fail...

Be the best of whatever you are.


Italian translation...

Se non puoi essere un pino sul monte,
sii una saggina nella valle,
ma sii la migliore piccola saggina sulla sponda del ruscello.
Se non puoi essere un albero,
sii un cespuglio.
Se non puoi essere un'autostrada
sii un sentiero.
Se non puoi essere il sole,
sii una stella.

Sii sempre il meglio di ciò che sei.

Martin Luther King

Friday, July 25, 2008

Back again after 3 moths...

I am back again with some JGrass tips.
Things have been really busy in this period, I think the only week I wasn't in office was the Hacking Event in Bolsena, thanks to all partecipant for the nice days.

Regarding the JGrass staff, yeah we are working on it, and we are planning to finish all the porting from the old JGrass2.0 to the new JGrass uDig plugin. So during the next month I will write some documentation (here or in the wiki) on JGrass main stuffs. The month before FOSS4G is financed by HydroloGIS and CUDAM to set up all the needed user documentation and to fix some of the known (and unknown but coming) JGrass bugs/problems/not so usable things.

If you use JGrass and have some interesting comments, please leave your comment here or use the JGrass wiki page to directly interact with our staff.
All the problems and bug reports are very wellcome.

Wednesday, April 23, 2008

How print two-sides brochure in OpenOffice

To save paper and ink when printing I love to have my documents printed with two pages in one and on both sides. Finally I found these two helpfull links to make it automatically in OpenOffice...

http://openoffice.blogs.com/openoffice/2008/03/printing-two-si.html

http://blog.dixo.net/2007/07/18/save-paper-with-openoffice-brochure-printing/

Enjoy your printing!!! :-)

Tuesday, April 22, 2008

A tribute from my hydrologic menthor

From opera "i mille fiumi" (the thousand rivers) of Arrigo Boetti and Anna-marie Sauzeau-Boetti

La classificazione per ordine di grandezza e' il metodo più comune per organizzare l'informazione relativa ad una data categoria, nel caso dei fiumi, la grandezza si puo' intendere alla potrenza uno, due, o tre., cioè può essere espressa in km, km2 o m3 (lunghezza, bacino o portata), il criterio di lunghezza e' il più arbitrario e ingenuo, ma tutt'ora il piu' diffuso, eppure e' impossibile misurare la lunghezza di un fiume per le mille e piu' perplessita' che solleva la sua esistenza fluida (per i suoi meandri e i suoi passaggi attraverso i laghi, per le sue diramazioni attorno alle isole o i suoi spostamenti nella zona del delta,, per gli interventi dell'uomo lungo il suo corso, per i confini inafferrabili tra acqua dolce e acqua salata ...) molti fiumi non sono mai stati misurati perche' le loro rive o acque sono inacessibili, persino gli spiriti dell'acqua solidarizzano a volte con la flora e fauna per tenere gli uomini a distanza, di conseguenza alcuni fiumi scorrono senza nomi, innominati per la loro realta' intoccata, o innominabili per scongiura umana (alcuni mesi fa, un pilota che volava a bassa quota sopra la foresta brasiliana scopri' un "nuovo" affluente del rio delle amazzoni). altri fiumi non possono essere misurati perche' invece hanno un nome, un nome causale dato loro dagli uomini (nome uniforme lungo il corso intero quando il fiume, navigabile diventa veicolo di comunicazione umana; nomi diversi quando il fiume, temibile, visita gruppo umani isolati); ora l'entita' di un fiume si puo' stabilire o in riferimento al suo nome (traccia dell'avventura umana), o in riferimento alla sua integalita' idrografica (avventura dell'acqua dal punto sorgente piu' remoto fino al mare, l di fuori dei nomi assegnati ai vari tratti), il problema e' che le due avventure coincidono raramente, di solito l'avventura dell'esploratore va contro corrente, partendo dal mare; quella dell'acqua invece ci finisce, l'esploratore che risale il fiume deve fare testa o croce ad ogni bivio, perche' a monte di ogni confluenza tutto si rarefa: l'acqua, a volte l'aria, ma sempre la propria certezza, mentre il fiume che scende verso il mare condensa gradualmente le sue acque e la certezza della sua strada ineluttabile, chi puo' dire di se e' meglio seguire l'uomo o l'acqua? l'acqua, dicono i moderni geografi, obiettivi e umili, e cosi' si mettono a ricomporre l'identita' dei fiumi, un esempio: il mississipi di neworleans non e' proprio l'estensione del mississipi che sorge dal lago itasca nel minnesota, come s'impara a scuola, ma di un ruscello che sorge nel montana occidentale sotto il nome di jefferson red rock e poi diventa mississipi-missouri a st louis, il numero di chilometri a monte risulta maggiore dalla parte del missouri, pero' e' un fatto che questo metodo "scientifico" viene attuato soltanto a proposito dei grandi fiumi prestigiosi, quelli suscettibili di gareggiare per primati di lunghezza, il ripensamento metodologico non si spreca per i minori (meno di 800 km) i quali continuano a chiamarsi (e misurarsi) secondo il solo nome di battesimo, anche se, nel caso che abbiano due corsi sorgenti (dotati di altri due nomi) quello piu' lungo potrebbe essere giustamente incluso nel corso principale, la presente classificazione rispecchia questo doppio metodo, esso segue la legge dell'acqua e la legge degli uomini, perche' tale si presenta l'informazione a riguardo, in breve, rispecchia il gioco parziale dell'informazione piu' che la vita fluida dell'acqua, questa classificazione fu iniziata nel 1970 e terminata nel 1973, alcuni dati furono trascritti da pubblicazioni famose, numerosi dati furono elaborati sulla materia fornita dagli istituti geografici non europei, governi, universita', centridi studi privati e singoli studiosi di tutto il mondo, questa convergenza di documentazione costituisce la sostanza e il significato del lavoro, gli innumerevoli asterischi contenuti in queste mille schede pongono innmerevoli dubbi e fanno da contrappunto al rigido metodo di classificazione, sia l'informazione parziale esistente sui fiumi, sia i problemi linguistici legati alla loro identita', sia la natura irrimediabilmente sfuggente delle acque, fanno che questa classifica come tutte le precedenti o successive sara' sempre provvisoria e illusoria

Anne-marie Sauzeau-Boetti

(n.d.t the text is published without capital letters)

Unfortunatelly I didn't find an English version of the text... maybe someone has one.

Saturday, April 5, 2008

Which values?

I will put here a lyric I read on an Environmental Declaration of an Italian institution. It is in Italian, I don't want to translate it but if someone will ask I will try... not so easy for my poor English... :-)
From the "Opera sull'acqua e altre poesie" of Erri De Luca 2002, a collection of lyrics having the theme the water, the first one...

VALORE

Considero valore ogni forma di vita,
la neve, la fragola, la mosca.

Considero valore il regno minerale,
l'assemblea delle stelle.

Considero valore il vino
finché dura il pasto,
un sorriso involontario,
la stanchezza di chi non
si è risparmiato,
due vecchi che si amano.

Considero valore quello che domani non varrà più niente
e quello che oggi vale ancora poco.

Considero valore tutte le ferite.
Considero valore risparmiare acqua,
riparare un paio di scarpe,
tacere in tempo,
accorrere a un
grido,
chiedere permesso prima di sedersi,
provare gratitudine senza ricordare di che.

Considero valore sapere in una stanza dov'è il nord,
qual è il nome del vento che sta
asciugando il bucato.

Considero valore il viaggio del vagabondo,
la clausura della monaca,
la pazienza del
condannato, qualunque colpa sia.

Considero valore l'uso del verbo amare e l'ipotesi che esista un creatore.

Molti di questi valori non ho conosciuto.

I consider a value to save water...