WorldKit geowiki

This geowiki is a small program that allows to add points, lines and areas on an image (from satellites, aerial photos or scanned maps), edit them, and to log and undo these changes. Additionally, elements on the map can be linked to URLs or to an independent wiki.

This implementation is based on worldKit (a simple but powerful web-mapping application, www.worldkit.org) and has been combined with PmWiki (a simple but powerful wiki system, www.pmwiki.org), though instead of PmWiki other wiki systems can be used as well.

Interface

The user interface of the geowiki has 4 main modes: view, search, edit and history. In all modes you see title and menu on top of the page, the map on the left and the content area on the right hand side. The latter depends on the current mode, as well as the behaviour of the map. You can switch modes by clicking on the corresponding links in the menu, where you find two additional links to inspect the geo data (content of file rss.xml) and get to this info page.

view: Shows the latest state of the map. You can drag and drop the map to move around, while clicking on map items opens any related URL in the content area. If you want to see the linked page in a separate window, click on the link above the content area ('open in new window').

search: Contains a search field where you can enter the name of an item, so that the map will be centered and zoomed to this item. Clicking on an item centers the item on the map. Here you also find the tag cloud from the former geowiki, which shows all the tags associated with map items. Clicking on a tag activates the related items.

edit: Here you can add new items to the map or edit existing ones. For the former just start filling the form, for the latter click on the 'pick' button and then on an item in the map, whose values will be loaded into the form. An item can be a point, line or area. Lines and areas are also made up of connected single points. Coordinates for each point can be entered manually or by clicks into the map. The button 'del last point' removes the last point entered. Each item needs to have a unique title (if you add an item with an existing title, the old item will be overwritten). Additionally, you can add a short description, a user name and a number of tags or categories. The latter have to be separated by commas without spaces (e.g. tag1,tag2,tag3). If the geowiki is not linked to a wiki, you will have an additional field to enter a URL for this item, which will be opened when the item gets clicked in view-mode. At the bottom of the form you find a button to submit the new item to the data file or modify any existing item with this title. Clicking the 'delete' button instead will remove any item with the given title from the data file. For all fields it is best to avoid any non-standard characters. Special characters from different languages may display as garbage for other users, and quotation marks (' or ") may cause problems with the geowiki scripts.

history: Shows recent modifications of the map as a list, with the last modification at the bottom. Each entry shows the action (add, mod(ify), del(ete)), the modified item's name, a timestamp, a user name (if given) and an 'edit' link. A click on the timestamp loads the map of this given time (though these items may show up in different order), a click on the item title zooms and centers to this item, and a click on 'edit' loads the values of this item into the form in edit-mode. The two latter actions depend on the state which is currently shown on the map. If you just deleted 'my favourite bar', a click on this name or on the edit-link won't have any effect, but if you display the state before deleting it, the same links will work.

Files

The system consists of the following files:

Original worldKit files

geowiki.swf: A link to the worldkit flash file, download the latest version from worldkit.org
day.jpg: Satellite image of the earth, from worldkit, from NASA.
geowiki.css: Contains some style information for worldkit.
tags: HTML code for tag cloud. Has to be writable by the webserver. Is being recreated each time an item gets created/deleted/modified, i.e. with each modification of rss.xml.
jsrsClient.js: and jsrsServer.php.inc: JSRS is an AJAX toolkit, which is used for the communication between client and server.
gettags.rs.php Small remote script which returns the content of the file tags.

New or modified geowiki files

index.php: User interface of the geowiki
geowiki.js: Javascript functions used by the geowiki
config.php: Configuration of geowiki, some options can be given in the url
rss.xml: 'Database' file, contains the geo information in plain XML and has to be writable by the webserver. You can edit it by hand, but it is important that each item is on one single line and the <guid> entry is the first entry after <item>. The functions which modify the file are very simple and can't handle arbitrary xml-files. Even if geowiki displays a modified file correctly, it could still cause problems when being modified.
rss.xml.log: A simple logfile, to keep track with all modifications to rss.xml. Must be writable by the webserver. This file is used to show intermediate versions, so if you edit rss.xml by hand, it makes sense to add these changes to rss.xml.log as well, which is quite easy.
data.rs.php: Functions which change rss.xml and log these changes in rss.xml.log
history.php: Lists the modifications which have been logged in rss.xml.log and allows to display and undo them.
rss.php: Recreates previous states of rss.xml from rss.xml.log. The order of the items may be different than at the previous point of time though.
about.html This help file

Text Wiki

The geowiki can be combined with any wiki system that allows automatic creation of new pages when linked to a non-existing page. Here, it has been combined with pmwiki, since it is simple to install (needs only php, no database necessary), but combination with other wiki systems like mediawiki should be equally straight-forward.

The spatial and textual wiki components remain independent, combined only by links from the map items to the corresponding wiki page and vice versa. In worldkit the links are set by defining the wiki root in index.php . Let the variable $wikiUrl point to your wiki, so that appending of the item name will create a new page. As an example you could have $wikiUrl = 'http://www.somewhere.org/pmwiki.php/Main/'. An item 'cool bar' could then point to http://www.somewhere.org/pmwiki.php/Main/CoolBar or sth. similar (depending on your system).

If you don't need the extended wiki functionality, you can define $wikiUrl = ''. In this case you can add arbitrary URLs to each geo item.

When using PmWiki, some modifications of the standard layout make it easier to read within the content area of the geowiki. For these changes you have to create a new skin for your pmwiki installation. Therefore copy the folder pub/skins/pmwiki, e.g. to pub/skins/geowiki, and edit pub/skins/geowiki/pmwiki.tmpl:


In pub/skins/geowiki/pmwiki.css change the number after #wikifoot { padding-left: to 4px;
In local/config.php set $Skin = 'geowiki'; and make the changes you want.

Philosophy

The idea while writing this geowiki was to apply the wiki principles of easy editing, linking and tracking to geographical data. This data can then be combined with additional information by linking the geographical items with an independent (text-) wiki system. The whole system should be simple to set up and use and have minimal requirements regarding technology and skills. For the latter reason all data is stored in xml/text-files instead of a database system. However, if you want to manage large amounts of data, a database will probably be more appropriate.

Remarks / issues

Currently it is not possible to use the config option <accuplot>true</accuplot>, since lines and polygons won't be drawn correctly. A future update of worldKit might resolve this issue and keep the line thickness constant between different zoom levels.

Content in view- and history-mode is displayed in an iframe. This may render the back-button of your browser useless (only on this page of course!) and may lead to confusing results when reloading the page. It is also possible, that the history won't display the latest modifications, if its content is cached by the browser. These issues will hopefully be overcome with some javascript in further updates.

Currently hardly any security checks have been implemented. This means it might be possible to include custom code sequences or mess around with local files (no idea if or how, though). User names can be chosen and changed freely, so they are no reliable means of identification. Data files don't get locked while writing, so during concurrent modifications it is possible that one of the changes gets lost, or the data file gets scrambled (in this case you can restore it by making use of the logfile).

The data file is being loaded into memory each time it is modified, so large files will increase the memory space needed by your web-server. In case of a very large number of items, it probably makes sense to use a real database.

Credits

Big thanks go out to Mikel, who wrote and released worldKit and the initial geowiki, gives helpful advice on the mailing list and nicely adds new features upon request. The same holds for Patrick Michaud for writing pmwiki. Finally thanks to the people at Mahiti (www.mahiti.org), who let me spend some time on this project, and to those who gave hints on errors or just said they like it.

This project is released under the GPL (GNU General Public License).