[GRASS-user] Length of a political boundary

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

On 4/5/2011 1:08 PM, Hamish wrote:

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?

The answer to this is by first extracting the vector line (boundary line) then converting it to raster line and then finally by r.mapcalc substituting the values by corresponding cells. So, this was not a problem at all.

Aha! you have given me an idea about using r.slope.aspect let me see how I can work it out.

regards,
Ambrish