Jeremy Sandberg wrote:
> I was thinking of doing a 2D array but I don't really want to enter 500
> values plus there is a huge chance of error from that.  I was wondering if
> there was some other way that I could do this so it would be much more
> simple and less full of errors?  I am doing it in access...I know, I know
> don't get mad.  But it is a really nifty program that makes my life a lot
> easier most of the time :)  That said I have access to VBA script stuff as
> well as normal database things.  Any ideas guys?
>   
Hmm... Well, the array has the advantage of being easier to understand 
and possibly even to update. The only other thing I can think of would 
be to treat each area as a polygon and then test whether the given point 
is inside that polygon, iterating through all of the possible polygons. 
This has the advantage of working if you ever need to use floating point 
inputs rather than integers, but will likely be less efficient than the 
2D array (though for a data set of this size, it's likely to be a 
negligible difference).

For some approaches, see:
http://en.wikipedia.org/wiki/Point_in_polygon
http://www.geometryalgorithms.com/Archive/algorithm_0103/algorithm_0103.htm
http://www.geog.ubc.ca/courses/klink/gis.notes/ncgia/u33.html#SEC33.3

--
Nathaniel Price
--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to