Hi
I want to work with r.plane and r.lake to get simulate floodings in DTMs.
In the section of interest there is a river which runs from about SSW to NNE. For r.plane I need the
azimuth. Is there a tool in GRASS which tells me the angle between two
points I mark on the map like I can measure in between two points with d.measure?
Could you recommend other tools to simulate flooding events in GRASS?
On Thursday 28 February 2008, Philipp Steigenberger wrote:
Hi
I want to work with r.plane and r.lake to get simulate floodings in DTMs.
In the section of interest there is a river which runs from about SSW to
NNE. For r.plane I need the
azimuth. Is there a tool in GRASS which tells me the angle between two
points I mark on the map like I can measure in between two points with
d.measure?
Simple trigonometry is a start. Or on a computer the atan2() function is
useful:
will return the angle in degrees. The above example is from R, but the C
implementation should be similar. Check your local documentation.
It shouldn't be hard to add something like this to d.measure for interactive
estimation of bearings.
On a related note, I wrote a module for GRASS sometime ago called d.bearing
which would create a transect from a starting point, a bearing, and a
distance along the resulting line. I will dig the source out and see if it
still compiles. It might be useful to combine that functionality with what
you are talking about.
On Thursday 28 February 2008, Philipp Steigenberger wrote:
Hi
I want to work with r.plane and r.lake to get simulate floodings in DTMs.
In the section of interest there is a river which runs from about SSW to
NNE. For r.plane I need the
azimuth. Is there a tool in GRASS which tells me the angle between two
points I mark on the map like I can measure in between two points with
d.measure?
Well of course I had to go and try this out.
attached is a patch (against todays SVN) to optionally print the bearing
between clicks.
On Thursday 28 February 2008, Dylan Beaudette wrote:
On Thursday 28 February 2008, Philipp Steigenberger wrote:
> Hi
> I want to work with r.plane and r.lake to get simulate floodings in DTMs.
>
> In the section of interest there is a river which runs from about SSW to
> NNE. For r.plane I need the
> azimuth. Is there a tool in GRASS which tells me the angle between two
> points I mark on the map like I can measure in between two points with
> d.measure?
Well of course I had to go and try this out.
attached is a patch (against todays SVN) to optionally print the bearing
between clicks.
Dylan
And of course here is an updated patch which computes bearing from 0 (math
style North = 90 deg) or from 90 (compass style North = 0 deg).
> Well of course I had to go and try this out.
>
> attached is a patch (against todays SVN) to optionally print the
> bearing between clicks.
Hi,
you should add a check so that it won't allow bogus results if the
location is in Lat/Lon:
e.g. from d.grid:
if (geogrid->answer && G_projection() == PROJECTION_LL)
G_fatal_error(_(".. option is not available for LL projection"));
(the great circle line's bearing changes with distance along it; unless
you are interested in the rhumbline?)
for this stuff also checkout m.cogo, r.transect, r.profile,
d.rhumbline, d.geodesic
Hamish
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
On Thursday 28 February 2008, Philipp Steigenberger wrote:
Hi
I want to work with r.plane and r.lake to get simulate floodings in DTMs.
In the section of interest there is a river which runs from about SSW to
NNE. For r.plane I need the
azimuth. Is there a tool in GRASS which tells me the angle between two
points I mark on the map like I can measure in between two points with
d.measure?
Simple trigonometry is a start. Or on a computer the atan2() function is useful:
In GRASS I work in Transversal Mercator (Gauß-Krüger)
I know the script isn't perfect, cause it doesn't work if N1 = N2, but
for me this doesn't matter.
On Saturday 01 March 2008, Philipp Steigenberger wrote:
Dylan Beaudette schrieb:
> On Thursday 28 February 2008, Philipp Steigenberger wrote:
>> Hi
>> I want to work with r.plane and r.lake to get simulate floodings in
>> DTMs.
>>
>> In the section of interest there is a river which runs from about SSW to
>> NNE. For r.plane I need the
>> azimuth. Is there a tool in GRASS which tells me the angle between two
>> points I mark on the map like I can measure in between two points with
>> d.measure?
>
> Simple trigonometry is a start. Or on a computer the atan2() function is
> useful:
>
> atan2( (end_y - start_y) , (end_x - start_x) ) * 180/pi
Dylan Beaudette schrieb:
> attached is a patch (against todays SVN) to optionally print the bearing
> between clicks.
>
> Dylan
Dylan,
sorry, I have no idea how to incllude this patch to my system.
I'm neither good in R or C or Fortran or Python.
> attached is a patch (against todays SVN
(Also I have problems to install the actual SVN)
But I'm used to write shell scrpits, so I wrote this one for bc.
In GRASS I work in Transversal Mercator (Gauß-Krüger)
I know the script isn't perfect, cause it doesn't work if N1 = N2, but
for me this doesn't matter.
Philipp
Philipp,
Glad to hear that you were able to make something which worked for you. I have
submitted the patch to d.measure to the tracker, and may be integrated into
GRASS proper if it is deemed useful by the dev crowd.