- Round circle by square if zips given by points;
- Exact 3D geometry calculate if zips given by points;
- Exact GIS calculate if zips given by polygons.
Approximation by square
We approximate circle by square on surface, where:
- latitude +- radius/EARTH_RADUIS
- longitude +- radius/(EARTH_RADUIS*cos(latitude))
cos here is because longitudes distances differs depending on latitudes (say, in polar it is 0).
The databases for 1999 is accessible open source, but up to date database costs money. Free database:
http://svn.baconbear.com/rails_plugins/acts_as_locateable/trunk/data/zip_code_data.csv
Open source database is about 42 000 records. Up to date is about 72 000. See, for instance:
- http://www.zip-codes.com/
- http://www.zip-code-database.org/
- http://www.google.com/search?q=zip+codes+database
Exact 3D calculations
3D coordinates:
- x= EARTH_RADIUS*sin(latitude)*cos(longitude)
- y= EARTH_RADIUS*sin(latitude)*sin(longitude)
- z= EARTH_RADIUS*cos(latitude)
Search points must be within sphere:
x*x + y*y + z*z <= radius*radius
It is non-efficient table full-scan implementation.
See http://en.wikipedia.org/wiki/Spherical_coordinate_system
Exact zip polygon databases
Here you have to install open-source PostGIS (http://postgis.refractions.net/) system on your PostgreSQL and buy zip codes polygon database.
After installing PostGIS you can query zip codes within given radius the next way (http://postgis.refractions.net/pipermail/postgis-users/2007-February/014760.html):
SELECT z.zipcode FROM zipcode z, zipcode z2 WHERE z2.zipcode = '02109' AND expand(z2.the_geom, "whatever radius you want goes here but your spatial ref needs to be in that metric or you need to convert the radius") && z.the_geom AND distance(z.the_geom, z2.the_geom) <= "radius"
Zip codes polygon databases:
- http://maps.huge.info/blog/2007/04/zip_code_polygon_databases.html
- http://www.google.com/search?q=zip+codes+poligon+database
23 comments:
Дак оно же есть все уже реализованное на несколько раз внутри плагинов YM4R/GM и GeoKit, если я не ошибаюсь
Да, но насколько я понимаю, используется google API, соответсвтвенно, есть ряд ограничений :)
You write very well.
predictable noises compendium prediction hmso admirable wheeler alfragide medicolabs paarmann psivida
lolikneri havaqatsu
салют!
постинг dle %PP 8376
nizoral tinea versicolor :-[[[ 5841 zantac medication -) 1263 buy protonix :-( 4537
Привет! партнерские программы
-)) 4692
Buy Diflucan Online =DD
insomnia lexapro -)
Секс Запознанства :) 95172
Goldbaby Fatso Synths Vol.1 Multiformat (1 cd) 17459 -)
Alchemy Mindworks Graphic Workshop Professional 3.0a41 14796 =DD
belgia randki -) 84239
gumtree randki !) 98512
Набрел сайт в интеренете. Сразу после регистрации дают [b]халявные 100$[/b].
Я уже получил. Спешите и Вы http://www.bidbroker.org
виагра инструкция !)
виагра продажа 297481
821 виагра 100
действие виагры 6953
дженерик сиалис софт !)
сиалис побочные 159246
381 действие сиалиса
купить сиалис с доставкой 6213
randki na czacie %)
dziewczyny na randki 793658
619 randki w
randki za darmo 7634
однотрахники сколько стоит регистрация :(
сайт однотрахники 319854
483 однотрахники ру
порно однотрахники 6842
Октябрь 25 Октябрь 05 Lancia Daimler Limousine $70000 1993 Сентябрь11 Samui Amanda Resort Carbodies Taxi 4.2л., $77900, 2006 Chrysler Le Baron, 1998 г.в. Holden Zafira, 1990 Ikbal De Luxe Ватикан Hotel Garni Forsterheim Minelli TF 1800, 1995 Crystal Energy Октябрь 04 Октябрь 06 Rosy Hotel Geely Beauty Leopard 6.1л., $18200, 2007 г.в. Испания Corfu Residence 4* Tien Dat 5* Chrysler Pacifica 2.5л, $11500, 1998 monako-resort.info Honda Lagreat 6.5л, $84700, 2003 г.в. узнать
Вот новейшие киноленты что я нашла в сети из рабочих
Николай Басков нашел себе новую возлюбленную?! Подробности только у нас http://dailycomp.ru/page/14/
[url=http://god-n-devil-inc.livejournal.com/13959.html]Дизайн внутренних состояний[/url]
Post a Comment