The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Changes for version 0.06

  • Scott Gifford contribed the following changes
  • query_postal_codes contained some errors:
    • It assumed that the space between single degrees of latitude and longitude are the same.  This only holds true at the equator; otherwise the distance between two degrees longitude is:
      • cos($lat*PI/180)*LON_MILEAGE_CONSTANT
      • This formula is probably well-known, but I got it from:
        • http://www.malaysiagis.com/related_technologies/mapping/basics1b.cfm
      • This corrected a bug where the cells searched would often miss areas that were a ways away from the site.
    • There were bugs when the search radius crossed the poles, the prime meridian, or the -180/180 longitude line.  All of these are now fixed in various ways (see the code).
    • postal_code attribute was sometimes not returned correctly for some results.
  • query_postal_codes now searches for ZIP codes whose distances are inside or exactly at the search radius, instead of strictly inside (<= instead of <).
  • The search algorithm has gotten complex, so I re-implemented nearby_postal_codes in terms of query_postal_codes.  Benchmarking shows that this doesn't introduce much of a performance hit, and it makes the code much more maintainable.
  • A bug in test_near when the $cell and $center were on opposite sides of the -180/180 longitude line caused a cell to be missed.
  • Modified load.pl to take an optional parameter with a filename to build from.
  • Corrected 01_basic.t with new results based on modified code.
  • Added regression test 02_polevault for near poles, prime meridian, and 180/-180 latitude line, including test data edgetest.data

Modules

Find closest zipcodes, distance, latitude, and longitude.