Hi,
I'm having trouble getting proximity search to yield any results in my Views, and the fairly obvious answer (I think) is that I need to install the zipcode.uk.mysql that comes in the 'databases' folder of the module (I have nodes with the zip/postal code added via Location, but searching yields nothing - as if they are not there. Cron has run and site re-indexed. So I guess that the postal code search has nothing to check against... right?) Now I know this is going to sound dumb, but, uh....how?
I try to create a 'zipcodes' table on my DB in phpmyadmin, i 'm not sure how many fields to enter so have tried '8', then just got stuck... I labelled the fields a thru to g, but the table never seems to appear in my list of tables ('watchdog' remains the last one)
I understand I should run the INSERT code form the zipcode file to insert all the data in the table, (I guess using the 'SQL' tab in the phpmyadmin interface) but like I say, how to create the table?
Obviously, I have no idea what I'm doing with phpmyadmin. Please help! Just a nudge in the right direction would be good, I find the whole phpmyadmin interface a bit overwhelming.
Thanks to anyone who can shed light on this for me.
Comments
Comment #1
luke76 commentedBy the way I'm doing this on MAMP. I've tried the command line method mentioned via Terminal but I get 'command not recognised' for sql.
Comment #2
luke76 commentedOK, I found there was in previous versions a zipcodes.mysql file which when imported into the database by phpmyadmin set up the table. I used the zipcodes.sql file from 5.x-2.7
Then successfully imported the zipcodes.uk.sql
I've checked the table and all the data is there. Proximity still not working though...:)
Any ideas? Anyone?
Comment #3
luke76 commentedComment #4
uksigma commentedsubscribed
Comment #5
droople commentedI can confirm UK postcode proximity search doesn't work at all.
GMap 5.x-1.0
Location 5.x-3.x-dev
In my case I created 15 nodes, with post codes spread around England, Scotland & Isle of Wight
ran a 5miles proximity of a Scotland node, but I got all 5 nodes in results, in created time sorting, not proximity sorting
Comment #6
kkrgopalan commentedHi
I am having trouble getting proximity search to work too. I am using
location - location-5.x-3.0
gmap - gmap-5.x-1.0
Does anyone have this working with the combination above?
I have it working on another installation using
location - location-5.x-3.0-rc1 and gmap - gmap 5.x-1.0-rc1
Thanks
Krishna
Comment #7
muhleder commentedNot sure about the 5.x code, but in the 6.x version the location.uk.inc file is missing code for finding the location of a postalcode that is present in the location.us.inc file.
FWIW I'm using 6.x 3.0 and am getting results when proximity searching by lat/lon, but not by postcode. I think UK based postcode geocoding might be better off with different code than the US version, given the different system and availability of postcode data here.
Comment #8
muhleder commentedThis code gets the postcode proximity search working at a basic level in 6.x, it might work in 5.x as well.
Added to location.uk.inc
This will find a location for an entered postcode if there is an exact match(upper/lower case not specific) but it would be nice to add the ability to match say BS6 5PJ to BS6 5 or BS6 if we don't have a full match. Ideally we would be able to match BS6 5PJ to an average of the locations for other postcodes of the form BS6 5xx that we had in the database.
I suppose the order of preference would be
search postcode:BS6 5PJ
1. BS6 5PJ
2. BS6 5P
3. Average of BS6 5Px positions
4. BS6 5
5. Average of BS6 5x positions
6. BS6
The full uk postcode database contains about 2,000,000 entries, but there are public domain databases which have ~40,000 entries. We should be able to get a decent level of accuracy using them without having to shell out £5k for the full commercial database from the Post Office.
Comment #9
kenwen commentedif my company were to buy the database could i then allow use for the location module? Don't quite understand what the licensing terms are!
we have a BIG need for postcode matching and would potentially be willing to shell out for it.
Comment #10
muhleder commentedIf your company licences the postcode database you can use it for your website, so long as you're not using it to provide a geocode API for other sites.
Think the cost is about £5000 to start and then £1500 per year for updates. Details are on the Royal Mail website. If that's too much then I think the next best thing is the postcode data from http://www.npemap.org.uk/data/ 40,000 postcodes and you could probably do some kind of averaging to get more points.
Comment #11
kenorb commentedDoesn't work for me as well.
Comment #12
kenwen commentedWe've been looking at a few alternatives; could this be integrated into the location module? Guessing it will require custom coding so an estimate on price would be great!
http://www.postcodesoftware.net/
Comment #13
designwork commentedHi All,
This is not only a uk problem its a missing sql statement in the api function location_latlon_rough. But with some cooding you can change it in the views handler.
As long as bdragon is not changing the api function you may use the following code:
replace the code in your location_views_handler_filter_proximity.inc placed in the folder handler of location with the changed code here.
Warm regards from cologne
Dirk
Comment #14
droople commentedIs this for 5 or 6 version?
thank
Comment #15
designwork commentedHi all,
one more change for the views handler. Its for drupal 6 and location 6x.3.0. Its running on a beta production site.
use it like my post above.
Dirk
Comment #16
yesct commentedduplicate of #339155: Is UK postcode proximity searching actually possible in 5.x?
some issues that might be related and might help:
#363540: UK Location information not saved to table Location
and a search for issues dealing with location.uk.inc
http://drupal.org/project/issues/location?text=location.uk.inc&status=Al...
or location.xx.inc
http://drupal.org/project/issues/location?text=location.xx.inc&status=Al...
Comment #17
iantresman commentedThe Wikipedia UK Postcodes article on has some useful external links to resources, including:
See also:
Comment #18
OzSchmoz commentedThanks Dirk, that's a real help.
Comment #19
juicytoo commentedSwap latitiude and longitude coordinates before importing.
I worked for me.
Someone told me about this, but forgot who.
I don't know why the zipcode..mysql
would have the longitude first, then the latitude.
it should be according to the schema
latitude then longitude.
cheers
Comment #20
nyleve101 commentedjuicytoo,
how do you swap the latitude and longitude co-ordinates?
Where do i put this?
UPDATE zipcodes SET latitude =(@temp:=latitude), latitude = longitude, longitude = @temp
Any help is appreciated thanks!