Theissen polygons

From: mccauley@ecn.purdue.edu (Darrell McCauley)
Reply-To: grassp-list@amber.cecer.army.mil
To: grassp-list@amber.cecer.army.mil
In-Reply-To: Darrell McCauley's message of Wed, 1 Apr 92 17:51:02 -0500 <9204012251.AA14387@sandbar.ecn.purdue.edu>
Subject: Theissen polygons

Yesterday I wrote:
>Is anyone working on something to create Theissen polygons from site files?
>If not, do you know where I could get src code to get me started?

I've got some code from netlib and have started work. I assume that there's
not a problem with incorporating this in GRASS (there's no copyright or
anything and I will give credit to the original author). Right?

There seems to be something missing from $GISBASE/man/man5---a
description of vector files. Is anyone working on this?

A description of ASCII vector files does exist, but managed to miss being
distributed with 4.0. My understanding is that you can request it from
the Office of GRASS Integration. I have also placed them for anonymous
ftp from moon.cecer.army.mil in file misc/asc_vect_fmt.tar

Once I find all bisectors, I'm faced with a question of what to do at
the edges. Suggestions? I plan to put a rectangle along the borders of
the DEFAULT region and extend the lines to there. Good? Bad?

That sounds like a good plan to me. Just have to make sure that you don't
have any points or polygons that extend outside of the default region.
Also consider using the CURRENT region instead of the DEFAULT.

Unless I become more intimately familiar with the library routines, I
plan write an ascii vector file. Good? Bad?

I would recommend writing binary vector files, just because it makes one
less step for the user running it. The upcomming GRASS Programmer's Manual
will give info for writing vector files. Until then, I recommend looking
at the source code for v.in.ascii (src/mapdev/v.in.ascii) for an example of
how to create binary vector files. Or drop me a note if you want me to
mail you troff files for it.

Since I'm not real familiar with file formats, I would like to know
if the following format is okey-doke:

  A 2
   2.30000 4.0000
   5.0000 3.0000

That looks good. Note that the columns are y,x order. Don't forget the
header of course.

After dumping a vector file that I had lying around, I noticed some
entries with an "A" and some with an "a" (DEAD_AREA?). I guess this
will become more apparent once I get it working and try to use the
vector file.

Dead features are those which have been deleted. They are no longer real.
The codes are changed rather than incurring the overhead of deleting data
from the middle of a file.

Should I include the original sites as points ("P") or DEAD_DOTs ("p")
in the vector file? There's already a way to use site_lists to label
vector files (s.to.dig on moon:incoming).

Points ("P") would be good. I would probably make that a runtime option whether
they are included or not.

Darrell

--

  Dave Gerdes
  US Army Construction Engineering Research Lab
  Spatial Analysis & Systems Team
  dpgerdes@cerl.cecer.army.mil
  (217) 352-6511 x591

> After dumping a vector file that I had lying around, I noticed some
> entries with an "A" and some with an "a" (DEAD_AREA?). I guess this

Dead features are those which have been deleted. They are no longer real.
The codes are changed rather than incurring the overhead of deleting data
from the middle of a file.

I see that v.clean takes these out - wish I would have known this back in
the days of really tight diskspace, when I was doing things like
  foreach file (/usr/local/bin/*)
   strip $file
  end

Learn something new everyday.