[worldKit-dev] [worldkit-dev] multiple events at single locations

andrew morgan andrew at bytefreq.com
Thu Feb 2 09:23:07 PST 2006


Bruce,

I too have been working quietly on the problem of representing multiple links at the
same location, and have built a quick hack workaround that suits me for the moment.
On www.livingatlas.com I use worldkit to map 1450 links sitting on about 600 cities:

Well, first I tried a number of things like you did too - all around converting my
dataset to move all the links into the description text. I was never really happy
this worked well, and the effort to mess with the rss data was too time consuming,
and not easily automated. Also - aggregating lists of links (having associated
city/location info) into lists of cities (having many associated link records) isn't
fun in xml.

Then I decided that the data needed to be properly transformed before getting loaded
into worldkit with something that can properly aggregate up the data to city level.

I chose mysql as it's quick and easy and free, and built database of located links.

I then built two pages in php that query my database of links and output the found
items in one of two formats, depending on the form:

the output formats are:

A) as an html search results report: city is the report title, the body is a a
bullet-point list of links found there.
B) as a worldkit geoRSS feed, listing the points found by the search. Instead of
putting my links inside the description, I instead use a Group By query to count and
report how many links are found at that location as the description text:  ie. Title
= "Tokyo, Japan" Description = "95 links found here".  Also note the sort order is
always from most populated city to least, so large graduated circles don't obscure
small nearby cities (see Tokyo)

I then set the worldkit geoRSS datasource to be my php page, which means my map data
is always fresh. In the future if my source data hopefully gets more dynamic – then
my map should keep up too. (try
http://www.livingatlas.com/data/auto/test_outputrss.php)
In worldkit, I can now use graduated map symbols based on the number of links found
at that location, which is cool. Note my data always sorts on largest symbol down to
smallest symbol - so little places aren't swamped by bigger nearby cities.

On a map click, Worldkit then sends javascript callbacks which trigger my page to
reload the inline html search results form, having the updated query results... ie
it pulls in the associated list of links for that city on a click.
try out
      http://www.livingatlas.com/fetchlinks.php?Lat=21.3084&Long=-157.801

(note: it's also doing a "headers check" on each link to find dead links" \

All I can suggest is this - once it's set up it's really really trouble free. My
data automatically refreshes every 3 days - and I never touch a thing.

Hope this was useful - do ask any questions you have. I'm happy to share what I can....

Andrew






More information about the worldkit-dev mailing list