David

> I have a map, and I'm trying to create points only in the
> regions in my table. At present my programme plots points everywhere
within
> a maximum bounding rectangle of all my regions and then deletes all the
> points which are not in my regions (about 80% surplus). Is there a way of
> just plotting points inside the regions?

I assume that you are trying to create the equivalent of a MapInfo Dot
Density Theme, with (random) points clipped by the border of each region.

Testing if a point lies within a polygon is computationally intensive.  The
classic computational geometry method is to draw a right-going ray from the
point and then count how many times it crosses an edge of the polygon.  If
the count is odd (1,3,...) then the point is within the polygon.  Clearly
computation time is obviously proportional to the number of edges in the
polygon.

To speed up your computation you can:
* get a faster computer
* use a faster programming language like C or Delphi  - both 100-1000 times
faster than MapBasic
* "thin" the polygon boundaries
* reduce the number of candidate points to test.

If the MBR of your entire region coverage includes a lot of "waste space",
then  you can easily reduce the number of "waste" points  plotted, by
processing your regions one by one like this:

For each region
    calculate the MBR of the region
    For n points
        programatically generate point coords within  MBR
        test if point coords fall within the region
        if true then create point
   Next point
Next region


Regards

David M Haycraft
Information Analysis Associates  Pty Ltd
ABN 47 085 516 105
1 Cumming Place, Wanniassa, 2903
Aust Capital Territory,  Australia
Phone/Fax:  61 + 2 + 6231 8104
Mobile: 0412 001 134
Email:  [EMAIL PROTECTED]
Web :  www.acslink.aone.net.au/actaa/iaa.htm
A MapInfo Technology Partner




_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.

Reply via email to