

Nov 09, 2011
The Drupal Location Module is a community module that allows geographic information to be associated with nodes. A Geographic Information System (GIS) describes any information system that integrates, stores, edits, analyzes, shares, and displays geographic information. In a more generic sense, GIS applications are tools that allow users to create interactive queries (user-created searches), analyze spatial information, edit data, maps, and present the results of all these operations.
Among the mentioned searches we find the Zip Code Proximity Search which will give us a list of places (nodes) that are located within a given distance of the zip code estimate center.
First, you must install the Location and Views modules.
For this particular procedure I am using the following versions:
Once you install the Location module, you will need to import the zip codes to the database. To achieve this, take a look at the INSTALL.txt file located in the folder where you installed the module.
Alternatively, you can go to the following folder:
{path_to_location_module}\databaseand using any MySQL execute window, run the script containing the data for the country you want to do searches against.
Create a new or use an existing Content Template capable of holding location information. Configure the Locative Information to hold one position.
Create some content using the Content Type defined before. For this blog post, I have created the following sample nodes:
Place | Latitude | Longitude |
Oshyn Inc. | 34.049886 | -118.253961 |
Dodgertown | 34.073919 | -118.242803 |
Griffith Park | 34.039503 | -118.249197 |
San Diego Int. Airport | 32.733538 | -117.189746 |
http://localhost/drupal/SearchByZipbut yours may differ. You can now input some values for Postal Code and for Distance. You will see the following results.
As a side note, if you look at the address bar you will notice that the page uses arguments to do the search, so you can now use those arguments to call the page directly. The arguments are: