I've been working on and off (whilst learning about Drupal) on extending the location module to include support for outputting KML feeds, finding content based on its location - by country at the moment - and generally trying to group together all content that has a geographic reference. At the moment, the functionality is:
- pulling all content with reference to a country into the /location/ page
- feeding this information out through RSS, with geo:lat and geo:long tags attached (thanks to existing geo support)
- feeding the items that have coordinates out using KML feeds (currently not Google Earth network links, but static files at time of download)
- ability to limit items by country
Right now it's pretty simple, but the beginnings of this work are online, with code to follow soon. I'd appreciate any comments on its usefulness in it's present state, and any suggestions for a direction to take it. There are a few things I need to fix still but let me know if you spot anything that's not working as expected. Oh, and it's based on 4.6, but it should be easy enough for me to port to 4.7.
Geographic search is an important piece in all of this, and will be one of the next steps I attempt to tackle, taking away the US-centric emphasis on zipcodes and moving it more towards geographic co-ordinates. Another major step that I've been looking at is getting location information into the system, possibly using the satellite/hybrid view on Google Maps as a basis for a geocoder - similar to the geobloggers et al. approach - with the addition of place names to help give people a context to where they are looking at.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | location_7.patch | 15.85 KB | geodaniel |
Comments
Comment #1
geodaniel commentedSo, finally I am releasing some code... Attached is the patch file to upgrade location.module to add a /location/ section to the site which lists all location-enabled nodes. It can be broken down by country and it also serves an RSS feed and KML network link for each of the pages it shows.
I'd be grateful if anyone has a chance to pull apart the code and let me me what it's like. Bear in mind it's the first code I've submitted to Drupal, so I've a lot to learn still on styles etc.
Comment #2
ankur commentedThe patch has been committed to DRUPAL-4-6, but not to head. When trying to apply the patch to head, hunks #2 and #3 failed. this just means that it can probably be applied by hand, but before that's done, I'd like to see how it works out in 4.6
If people post back w/ issues, perhaps we can fix it before applying it to head. Issue will be left open until we get a final version applied to HEAD.
-Ankur
Comment #3
geodaniel commentedThanks Ankur. I'll look into why it failed and probably spend some time tidying it up in some places too.
Comment #4
geodaniel commentedI never did get around to updating that code for 4.7. I've spent some time on it today, updating it and fixing some things, and it's pretty much there, but...
Without having followed the development of the views module or location_views, is this view of the location data made obsolete by those modules? I'd still like to add in the KML links - both for individual nodes and for pages of nodes. Perhaps this would be best added to the location views module now though?
Comment #5
karens commentedI think adding it to location views makes a lot of sense. If you haven't played around with views, in general it is a really great and flexible way to aggregate a collection of nodes, so you don't have to write anything to do that part, you just need to create functions to do something with the nodes once you have them. For instance, GMap takes a views view of a collection of nodes and plots them all on a map. The nice thing about views is that once you understand how it works, it works the same in all modules, so you don't have lots of different interfaces to get used to. Plus, you can easily combine filters from different modules, like filtering for both location and event characteristics at the same time.
The latest version of location views has a GMap locator that you can use to select a center point to use for a search for nearby nodes, along with various selectors for city, state, country, etc. So a user could create a view that uses a map tool as a selector, then output the info using your kml function(s). (See a demo of location views at http://www.elderweb.com/demo).
Comment #6
geodaniel commentedI've just taken Location Views for a quick spin and like what I'm seeing. It takes out a lot of the work from creating the groups of nodes, as I had initially started on as a base for feeding out the KML. I've moved this issue over to the Location Views project now and will work on integrating it into there.
Comment #7
geodaniel commentedI'm thinking I'm probably going to move this into a separate module. I've not used views for it, but perhaps this would be a good addition in the future to make it more flexible.
Comment #8
geodaniel commentedI've moved this to a separate module: KML module.
Comment #9
(not verified) commented