Digitizing in GRASS

David D Gray ddgray at armadce.demon.co.uk
Tue May 23 08:38:31 EDT 2000


Alejandro Imass wrote:
> 
> Justin Hickey wrote:
> 
> >
> >
> > Hope this helps.
> >
> > --
> > Sincerely,
> >
> 
> Thank you Justin.
> Even though I've a lot of stuff on my mind I've spent the last few days trying to
> determine an algorithim that figures out if a given centroid is in the area
> (using the formula for centroid) of which adjacent arcs (arcs that are snapped at
> some nodes) and then build arc/view type polygons (arcs are redundant in the area
> edges) by concatenating these arcs. For example, a six arc ungenerate file from
> GRASS would probably turn out to be a 3 polygon file by adding the adjacenta arcs
> to each other arc.
> My idea is(was?) to process the arc/info genrate output from GRASS, which is in
> arc-node format and make the arc/view type ascii file from this one and then
> feeding this new ascii file into gen2shp. Perhaps the centroids are not needed,
> and I guess, from what you described, that your code does this in a simple form.
> I sure hope so, because not bieng at all from this area, I have had to un-dust my
> Calculus notes and books, even though being the GIS polygons defined by straight
> edges (instead of curves) these areas can be quite "easily" ;-] (yeah right)
> computed using triangles ! I guess.
> 
> Well anyway, I hope your code is much simpler than my way of thinking !
> 
> Thanks again and best regards,
> Alejandro Imass


Hi Alejandro

Do you need a real centroid, ie. a mass point of the area, or would a
centrally located interior point do? If you just want a point for 
labels, attribute assignments, perhaps the second option is what
you need. But there might be calculations you need to do that
require the actual centroid... The problem with using a real
centroid for labelling, attributes is that you can't be sure it
will not be inside an island, even if you take interior holes
into account - so you would have to move it anyway.

It's easier to calculate an any_old_point than a true centroid. You 
just have to circulate the rings and find places where they intersect
the polygon's equator. A point can go in int1<->int2, int3<->int4 etc.
regions because these are `inside'. Of course it's more complicated
if there are holes, but you just have to circulate the holes' rings
as well to find further regions where points are forbidden. inside a
hole = outside the main polygon.

David




More information about the grass-user mailing list