[GRASS-user] Length of a political boundary
Hamish
hamish_b at yahoo.com
Tue Apr 5 03:38:21 EDT 2011
ambijat wrote:
> No, Hamish,
> This is not the case as I see it.
ok, sorry if I misunderstood. how do you get a political boundary
from SRTM data? by watershed? is knowing the "length" actually
important? could whatever you are looking at be answered instead
by a less problematic metric like area or proportion?
> My fundamental method is as follows:
> 1. in a 3x3 matrix of neighbours analysis I want to fit in
> one worthy formula.
> 2. For every such matrix there are going to be at least 3
> non-zero values and 6 zero values.
so far sounds like a job for r.mfilter or r.mapcalc's neighbor
modifier,
> 3. as we know that c^2 = a^2 + b^2, i would be counting on
> a = elevation difference between the two adjacent cells, and
> b = 90 meters, which is the resolution of the cell.
ok. is the center cell always non-zero/null? (ie skip over those)
> 4. So, c values for each such set of two adjacent cells can
> be calculated, and a sum of all such values which are actually
> hypotenuse values would give me more accurate value of the total
> length of the boundary.
>
> This is a kind of algorithm I have in mind. Anybody who can
> translate into formula?
probably it would be r.mapcalc (incredibly versitile), but I
guess you could get a head start by multiplying a r.slope.aspect
slope map into the mix.
good luck,
Hamish
More information about the grass-user
mailing list