One of the most popular features on MothersClick is our geo-mapping system for mothers’ groups—-a mashup of Google maps and mommy groups (created with the organic groups module).
Now, I receive lots of email and questions about how we built such a system with Drupal and location module. The fact is, we didn’t—-well, we did use Drupal, but we did not use location module. The module is a behemoth, it performs slowly, and isn’t too friendly when you have data outside the US. We didn’t use the GMap module either—-we didn’t want nor need the bloat.
So at MothersClick, we started fresh. We wrote a module that added a location form to any node type we specified and also to users. We then used a database table to store this data that was similar to location module’s table structure. From there, we hooked this up to Google’s geocoding service to grab latitude and longitude coordinates for an address. We also added in an address verification layer that worked with Google to verify addresses as well.
The next step was to add in proximity search. Due to time constraints we couldn’t build a full geo-spatial index, so we opted to rely on a bit of math for proximity searches. While this isn’t super ideal, it does indeed work very well for us.
Add in a custom Google maps module that communicates via AJAX with our custom location module and voilá!
Yes that’s great, how can I have it on my site, you might ask, eh?
Well soon you can!
Mark and Allie at Advantage Labs, together with Brandon Bergren have released 2 brand new geo modules:
These 2 modules are the future of geo data in Drupal, and I’m proud to say, that MothersClick will be contributing to both of these modules, as we plan to migrate our custom location modules to these modules one day soon.
Hmmmmm, very interesting. We JUST committed to the Location module for storing our geo data – although with limited enthusiasm…just because there is (was?) nothing else and we simply don’t have time to come up with a custom solution.
As you say…for countries other than the US it does very little out of the box, so at the moment it’s just a bucket to throw the data in – hoping that at one stage we’ll get it out again in a meaningful way.
I’m not too worried about it though…at the moment for us the only pressing decision to make was where to put the data, and the Location table is as good as any other place.
However, to future-proof us as much as possible, I’d really like to know what the plans for these new modules are…especially in regards to the storage. The Postal module says “It will eventually provide a CCK field”.
Does this mean if we would use it now and then it becomes a CCK field the data will be transformed accordingly? Or is it “a new beginning”, where we would have to take care of the data migration (in which case we might as well keep using the Location module until Postal has been CCKified).
I’m talking about many many thousands of addresses, so it would greatly improve my sleep knowing that they are in a good place :)
Right now, these modules are in heavy development, but their storage mechanisms are pretty solid, meaning, database changes should be minimal as they are worked on.
I believe the postal CCK fields + storage is working (I haven’t had a chance to play with it much as of lately) but do give it a shot, I do believe it is working in that manner.
Nice post Ted. The address verification layer sounds like a great idea. Is there more information on this anywhere? – Ian
Well basically we just look at what Google returns. It will return something to the effect “address cannot be found” and in those cases we alert the user that the address cannot be verified.
We have only had one case where this was incorrect since Google maps did not know about a new subdivision going up, so we manually had to set that one.
This sound perfect for a project I’m working on. Will you post here when the modules are publicly available?
Sure, definitely will! Still aways off but be sure to check those project pages for updates!
Hi Ted,
are there any news on the modules you/motherclick are using? When will they be made public?
I think many people are really looking forward to check and use your custom gmap module, as well as an integration with geo/postal (which seem to be not developed very actively, considering the low amount of CVS development that’s going on at the moment – any news on that?).
So do you/mothersclick plan to contribute some modules?
If not/if no time, can you perhaps hand over the custom gmap module code to the community in its raw state – or at least point to how you implemented it and how it implements the cool ajax pan/zoom reload thing, or how you integrated it with geo/postal?
Would be really great to hear some news on that <:)
cheers,
daniel
Is there any update on when Postal and Geo will be released? Would yoiu be able to mail me the files if possible? Thanks for this great post.
This post ranks quite highly on google for “drupal location”. The text sounds ever so promising and yet the post is over a year old and neither of these modules have managed a release yet. Even the hidden dev releases wouldn’t work together (one is 5.x only and one is 6.x only). Is there an update – is anyone putting concentrated effort into getting these modules going? Is there any kind of timeline anyone is aiming for? Or has the whole thing kind of lost drive?
Fletch, yes everything is in Location 3, see here: http://drupal.org/project/location
We’re hoping to migrate our solution to this module and help test once an alpha/beta is ready.
Thanks Ted, that sounds great. Interesting that you decided to join the Location module after all. Actually I used Location recently for a Real Estate website. It was out of that and an address CCK field module, but I went for Location because it integrated with the Google Maps module. It worked pretty well but I definitely would love to be able to offer proximity searches. Got a second-hand car sales website coming up and I think it would be handy there too… so it’s great to hear this news and good luck getting it going! Location RC2 is now out by the way.
Wonderful work, and something we desperately need for our social networking site. Might I ask about the current status of the project?
Thanks for all the effort to date!
@Steve we actually trimmed back our efforts but a lot of great work is in the location module now so check it out!
Add your comment