I've 6.x-3.x-dev of Location module loaded up so that users can apply a zipcode to a content type. That seems to work fine and if I create a view to display those nodes I can see the data.
I've uploaded the U.S. postal code database into mysql which created a table called "zipcodes". Not sure if it's supposed to be called "zipcodes_us" or not but it appears to have all the data in it.
When I try to create a proximity filter in a view I get no results. For example I have a test node with postal code "11215" attached to it. If I run a proximity search for 100 miles around 11215 it generates this query but no results:
SELECT location.lid AS lid,
location.postal_code AS location_postal_code,
(IFNULL(ACOS(0.75850401430838*COS(RADIANS(location.latitude))*(0.27587893852365*COS(RADIANS(location.longitude)) + -0.96119239035641*SIN(RADIANS(location.longitude))) + 0.65166836679255*SIN(RADIANS(location.latitude))), 0.00000)*6369029.198028) AS location_distance,
node.title AS node_title,
node.nid AS node_nid
FROM location location
LEFT JOIN location_instance location_instance ON location.lid = location_instance.lid
LEFT JOIN node node ON location_instance.vid = node.vid
WHERE (location.latitude > 39.219739619529 AND location.latitude < 42.115276380471 AND location.longitude > -75.894465512533 AND location.longitude < -72.076734487467) AND ((IFNULL(ACOS(0.75850401430838*COS(RADIANS(location.latitude))*(0.27587893852365*COS(RADIANS(location.longitude)) + -0.96119239035641*SIN(RADIANS(location.longitude))) + 0.65166836679255*SIN(RADIANS(location.latitude))), 0.00000)*6369029.198028) < 160934.7)
Any ideas what I am doing wrong? THANKS!
Comments
Comment #1
jns120 commentedNevermind. I guess I got something in the order wrong but it's now working.