Needs work
Project:
Location
Version:
7.x-3.x-dev
Component:
Data update
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
14 Jul 2006 at 14:13 UTC
Updated:
13 Jan 2021 at 14:57 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
astra commentedWhat is the patch location.nl.inc used for?
How to install it?
How to configure and make it work?
For example, creating a node with a location in United States, I can get a link "Google Map" to link to the map from the node view. But I don't know how to get this support for the Netherlands using the patch location.nl.inc. Could you please explain this patch in detail?
Comment #2
BachusII commented> What is the patch location.nl.inc used for?
The directory modules/location/supported contains location.countycode.inc files for every country known to drupal.
This 'patch' is my adaptation
> How to install it?
Make a backup copy of your location.nl.inc file in the location/supported directory. (For safe keeping)
Replace your file with mine.
> How to configure and make it work?
I provide one map link, to himbuv.com (disabled by default), but it is a very general map. It does show you in what region the zipcode lies in though.
The google map link is provided, but it doesn't work that wel for the Netherlands. It probably works for wel known places like the big cities, but it sucks for the smaller towns. Therefor I commented out the google map link on line 134.
For the US and germany there are files containing the geographic locations for every zip code.
For the Netherlands, sadly, there are not. If you include a Dutch zip code in the location information for your node, my code will check the database whether it knows that zips location. If it can't be found in the DB, the code attempts to retrieve the geographic information and update the DB for future reference.
It works quite wel with the GMap module.
Someday himbuv.com may change it's page layout, or discontinue the service, breaking the code. Until that day there isn't much to configure.
I may be found willing answering further questions in Dutch. (Then again, I may be not.)
Same username as here, and my ISP is planet.nl (Kindly use 'Drupal: ' in the subject.)
Comment #3
astra commentedThanks for your guidance. I installed this location patch and have a test. Great! It works when creating a node with the location information in Holland.
I see this patch is able to
1) provide a map link (himbuv) following the location information;
2) automatically retrieve lat/long information and update the corresponding data if entering post code;
3) communicate with gmap.module so that the location can be viewed in a block and on a node map.
So that's a good job! Also one question:
If it's possible to create a map link to more perfect geographic map, such as one from routenet.nl or anwb.nl, instead of the general map from himbuv?
I'm from China and live in Holland. My English is not so good but better than Dutch.
Comment #4
BachusII commented> If it's possible to create a map link to more perfect geographic map, such as one from routenet.nl
> or anwb.nl, instead of the general map from himbuv?
Theoretically, yes.
Practically, why not.
Legally, be very careful.
Do keep in mind that google maps is only commented out (line 134) It's easily re-enabled.
route.anwb.nl seems to be fairly secured.
routenet.nl on the other hand. Uses something like:
http://www.routenet.nl/address.asp?task=map_address&language=NL&addressn...
In other words, easy.
Are you allowed?
I couldn't find any Terms Of Service on routenet.nl. Perusal of the site leads to the most likely answer of "Yes, you can use our service. And that will be X euro for Y requests. What method will you be using to pay our invoice?"
Bearing in mind that I won't be adding this to my site(s), I don't have that large a budget en certainly don't want the legal hassle.
The minimum seems to be
http://www.routenet.nl/address.asp?task=map_address&language=NL&zipcode=...
Though it is still very grainy. Resolution increases with correct street info (streetname + addressnumber).
I'd advise to use something in the line of
http://www.routenet.nl/address.asp?task=map_address&language=NL&zipcode=...
Add an entry in the
location_map_link_nl_providers()function (line 132)And something like:
Comment #5
astra commentedThanks for your explanation and code in detail. Following your instruction I started make customization to the file location.nl.inc. I was wondering why I can't copy the php code on drupal pages with mouse selection. So I had to carefully and manually enter your code. But it gave me a surprise because it works and seems without any problem. I mean my location can be linked to the routenet map just one click. That's really amazing.
I only try to use this service to non-profit websites so I think that should be no problem legally. But also thanks for your reminding about this issue. Be careful.
By the way:
>add an entry in the location_map_link_nl-providers() function (line 132)
I added an entry like this
I hope it's all right without potential problems even though it works. Because I really don't know what the right url is. Maybe should be http://www.routenet.nl/map/. Also I don't know what the 'tos' is.
Comment #6
khoogheem commentedI have created a csv and sql file for all cities in NL with the lat/lon..
The only thing I don't have is the zipcodes for those cities and since the zipcode sql requires a unique zipcode it is somewhat useless right now. There are some 8000+ entries right now and it would be great if we could get the zipcodes in there at least one for each city so it could be somewhat useful. However I don't know of a goodway to quickly get those without doing a lookup on each one.
if anyone has some ideas let me know. Also if you would like the files let me know
Comment #7
BachusII commentedGoogle geocoding will return the numerical part of the zipcodes. Not enough because in NL the 2 appended alfabetical characters are required.
On the one hand this approach will result in 8k+ lookups.
On the other it will result in the compiling of a database that could be used without legal hassle. Provided you pubish it with a public domain/GPL/creative commons type licence of course.
At, let's say, 30 lookups per hour (10 days for 8k lookups) I don't think Google would mind to much.
And yes, I would like a copy of the files.
Comment #8
khoogheem commentedgive me your email or setup your contact in your profile
Comment #9
BachusII commentedMy ISP is planet.nl, same username as here. Kindly prefix 'Drupal: ' on the subject line, thank you.
Comment #10
bdragon commentedChanging component to Data Update.
Comment #11
bdragon commentedThis needs work. The google geocoder is marked as OK for .nl (and therefore doesn't need to be in the inc file. Also, someone needs to review the services again.)
Comment #12
yesct commentedA year later, this still needs to be looked at. Marking it postponed needs more info.
Connecting it to a collection of other zip code data issues #175193: Zip code database out of date
Comment #13
yesct commentedan example of a location.xx.inc file
Comment #14
pieterbezuijen commentedI'm interested in this as well. Is the file still available? Looking for a proximity search... but I'm hassling with the postal codes. Found a file with only the 4 numbers on http://download.geonames.org/export/dump/
Comment #15
pieterbezuijen commentedI added some code from location.us.inc (with minor modifications) and got proximity search working with help of the above 4-number-postal-code database.
Lines I added to location.nl.inc:
Note: changed country-code and the number '5' to '4'.
Comment #16
yesct commenteduse the dev version, and
http://drupal.org/patch/create
And that would make this a lot easier for the maintainer to get this in.
Post back if you need any help making the patch.
Comment #17
pieterbezuijen commentedNever worked with cvs or creating patches, I'll give it a try.
Comment #18
joostvdl commentedHi Pieter
Is it possible to give an description of the things you did. I'm trying to create also a proximity search with Howto: zip code proximity search using Location Module. But still with no luck....
Comment #19
Mesdag commentedRecently I had the need for a Dutch postalcode database to do a proximity search.
I used the one at geonames.org (http://www.geonames.org/countries/NL/netherlands.html) with the 4pp format (format: 1234) and converted that one to the format used in the module
For some codes it is lacking the province. Not a big deal for me.
However there is also a 6pp (format: 1234 AB) database located at http://kvdb.net/projects/6pp/downloads.
It contains a lot more details like streetname and such.
According to a message on the site it contains at least 50% of all the Dutch postcodes.
If I have time I would like to see if this version yields better results for searching.
I also need to find out what kind of license is used there. As far I can tell it is free.
For now I can provide you the 4pp version, see attachment.
@joostvdl
The patch contains code for the Dutch proximity search. You will need this code along with the postal-codes to do a proximity search.
Please review and comment.
Comment #20
BartVB commentedSince Google provides a geocoding service nowadays I've made patch that used Google to do the postalcode lookup. It first checks if the postalcode is in the zipcodes database table, if it isn't it does a lookup to your geocoding service (through location_latlon_exact()) after which it stores the retrieved zipcode in the database.
Comment #21
BartVB commentedHmm, attached the wrong file :)
This patch is almost the same but it also fills the timezone and dst fields (with a hardcoded 1 and 1 for these Dutch locations).
Comment #22
BartVB commentedA more general solution for the distance filter can be found in this issue:
http://drupal.org/node/343487
Comment #23
Remco commentedThis thing is breaking my head :P For some reason i cannot get it working.
Here is the deal.
I setted the location gmap en views module like discribed on this page: http://svendecabooter.be/blog/implementing-location-proximity-search-for...
I used the 6pp database which can be downloaded from here: http://kvdb.net/projects/6ppdev I converted it for drupal using this little python program:
./dbconverter.py >> zipcodes.nl.mysql
Anyways.. I cant add the database into the attachment sinds it's bigger then 1 mb.. even packed. But this is how it looks:
I cannot seem to get the search working... Are there any Dutchies that go this working and could explain how?
//edit also created a forumtopic here: http://drupal.org/node/628558
//edit2 got it working as discribed in the topic
Comment #24
Remco commentedlocation-proximity-nl.patch kicks ass. No need for the database anymore :)
Thanks for this!
Comment #25
roderikFYI: location-proximity-nl.patch does kick ass.
But it would kick even more ass if the functionality for that was included in general location.inc code; there's no real reason it should be NL-specific.
Trying to get comments on that at http://drupal.org/node/662892#comment-2409692 .
Comment #26
yesct commentedHmm no need for database. Maybe this would be more likely to get in, if there was a setting like "use calculated" (or whatever, I haven't looked at this in detail) or "use database". So that it would be a config option and would not break what someone might already have working.
Comment #27
BartVB commentedThe patch first checks if a location is in the DB, if it's not then it will try to look it up. So this patch is useful in both scenario's (start with empty or with an already filled 'zipcodes' table).
Comment #28
summit commentedSubscribing, interesting in also location proximity with province in holland or anywhere else..
greetings, Martijn
Comment #29
cyberwolf commentedSubscribing.
Comment #30
tulipboy commentedSubscribing, great patch!
Comment #31
podarokAll data updates have to be rolled against latest 7.x-3.x-dev and after that backported to 6.x-3.x
Comment #32
podarokbot
Comment #34
lambic commentedI couldn't get the patch to apply on the 3.8-beta2 tag so here's a new patch for that purpose.
Comment #35
lambic commentedFound some issues with the patch after getting it to apply, so here's a fixed version.