[Displaying the geographic center of a list of people]

Find the geographic center

Find the geographic center of everyone coming to a particular event.

You can add people one by one and drag them to the right place; the X marking the center will move accordingly.

This package uses OpenLayers, OpenStreetMap, Javascript and Python, and is GPL licensed. Share and enjoy! I'd appreciate it if you'd credit me somewhere and let me know you're using it, but that's not mandatory.

You can play with a live version of it here: Geocenter test page.

Installing geocenter

To use this on your own site, here's what you'll need:

Download the tarball: geocenter-0.4.tar.gz

1. Edit index.html and change the initial latitude, longitude and zoom level to the place where you want your initial map to be. Users can drag from there, but the view has to start somewhere.

2. Edit adduser.cgi and change datadir to point to the absolute system path (e.g. /home/username/public_html/blah/blah) where you're going to put the data directory.

The data dir has to be writable by the apache user, so either: chmod 777 data - or, if you have root - chown apache data

3. If your server doesn't allow CGIs in the same directory as the HTML that's calling them, you'll need to put adduser.cgi wherever CGIs need to go -- maybe somewhere like /home/username/public_html/cgi-bin.


Once installed, the program shouldn't need much maintenance. You may want to keep old versions of the people.xml data file around, though, in case you have problems with spammers adding bogus entries and you want to roll back to a specific date and time. Keeping them around is controlled by the clean_up_files variable in the addusers.cgi script.

Enjoy! I'd love to know how you're using it or hear comments or problems you're having.

Akkana's Software
Shallowsky Home