[Techtalk] Data structure for Earth slice data

Marilyn Wulfekuhler marilyn at anyawos.com
Fri Dec 5 16:10:14 UTC 2008


Hope I got the attributions right; my comments are below.

>
>> Kelly Jones writes:
>>> What's a good data structure/methodology for representing "slices"  
>>> of
>>> the Earth?
>>>
>>> Obviously, the description above is one way to represent the data,  
>>> but
>>> it's not very useful.
>>>
>>> I want a representation that will:
>>>
>>> % Tell me if a given latitude/longitude is inside or outside the  
>>> set.
>>>
>>> % For a given latitude, tell me what longitudes (if any) are inside
>>> the set. Vica versa for a given longitude.
>>>
>>> % Tell me the area of my set.
>>>
>>> % Make it easy to map the boundary of my set
>>
> On Wed, Dec 03, 2008 at 07:06:14PM -0800 or thereabouts, Akkana Peck  
> wrote:

>> Then for definitions based on a list of cities and radii from each
>> city, like your example, all you need to start out is a list of
>> triples to store those data, then write the other functions in
>> terms of those.

>>
> On 4-Dec-08, at 6:47 AM, Conor Daly wrote:
>
> It strikes me that it would be worth considering doing your primary
> representation in terms of the mathematical functions that describe  
> the
> earth's surface.  Basically the earth is a squashed sphere (a geoid)  
> which
> can be described by a set of equations.  Now, quite how you use  
> these to do
> your sets I'm not sure...
>
I'd say it depends on how accurate your representation has to be in  
order to solve your problems, and whether you need absolutely accurate  
distance (area) or just relative distance.   You might be able to get  
away with a simple polygonal representation of your area (based on lat/ 
long), and pretend the Earth is flat.

My company has an application where we have to, given a lat and long,  
find the nearest airport with a weather system (which are stored as  
lat/long pairs).  My partner was originally writing the code, and used  
a complicated distance formula that took into account curvature of the  
earth, etc.  I pointed out that we don't really care what the absolute  
distance is, just the relative distances (ie, find the closest).  So  
you can use something very simple like Euclidean squared, or even  
Manhattan distance (as long as the triangle inequality holds), and the  
result will be the same without a lot of complicated functions or  
representations.  I think this will work pretty well as long as you  
don't have areas in far north or south latitudes, where the longitude  
lines start to converge, and as long as boundaries on your areas of  
interest are convex (and aren't too big, say, smaller than North  
America ;-).

Marilyn Wulfekuhler






More information about the Techtalk mailing list