NYCPHP Meetup

NYPHP.org

[nycphp-talk] Hello / Geo coords

Hans Zaunere hans at nyphp.org
Thu Nov 20 15:33:34 EST 2003



Spot wrote:

> Hey everyone,
>  
> Just thought I would introduce myself as new member to the list and pose 
> a question at the same time.
> 
> My name is Spot(yes, legally). I am with deviantART.com. We are the 
> largest art community in the world with a little under 500,000 artists, 
> almost 3 million pieces of art and close to 80 million hits a month. We 
> move about 55mbit/s average. Running on 37 boxes (last I checked) and 
> two 9 terabyte fibre enclosures. All on Apache/PHP/Mysql. Except for 
> Zues talking to the fibre enclosures for raw data (images). All of our 
> code is from the ground up. No external libraries.

That's quite a setup.  While some other major PHP sites might get more hits, I'd bet deviantART is heavier (because your primary dealings are with images).  Are you guys hosted out of LA?

> Currently we are employing somewhat of a locational system where we 
> allow artists to provide their Geo coords (after getting them from 
> Maporama.com) and then, currently using GeoURL.org, we pull in RSS feeds 
> and allow them to see lists of artists close to them.
> 
> We are interested in bringing as much of this "in-house" as possible. 
> Especially the GeoURL functionality. Does anyone have any information on 
> methods for creating "crow flies" distances between artists based on geo 
> coords? I would be interested in using a third party library if there is 
> one.

Dealing with lat/long is fairly straightforward... just a series of mathematical equations and you can generate distances.  I used to deal with these equations alot back in the GPS days, but of course they escape me now.  Maybe this is handy:

http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=php+lat%2Flong

noteably:

http://mx.coldstorageonline.com/highlight.php?file=geo_data.php&type=php
http://jan.ucc.nau.edu/~cvm/latlongdist.html

and I think the formula actually is at the top of:

http://jan.ucc.nau.edu/~cvm/latlon_formula.html


Newer versions of MySQL also support GIS types of operations, and postgresql might already.  Also, there are loads of zipcode calculation libs out there, which work on basically the same principal... actually, just using zipcodes might be easier  :)

H





More information about the talk mailing list