Warwickshire Bike and Walking Routes

Work Completed By: Terry Rich-Whitehead

DESCRIPTION

Find a way of plotting local cycle routes and walks on an online mapping service, provide additional information such as distances, points of interest etc.

Provide a facility for members of the public to add their own information/pictures to enrich the facility.

DETAILS/LOCATION OF PRACTICAL DEMONSTRABLE OUTPUT

Details of where code, web pages etc can be found.

A live demonstration of the project work can be found at the following :-
http://www.agilitas.co.uk/maps/

DESCRIPTION OF THE WORK CARRIED OUT

Describe how you approached this piece of work, any technologies, tools or techniques that you found useful or tried and discarded. Include any examples that you used for inspiration and any contacts you have made in carrying out the work.

Overview
At the start of the project time was spent reviewing what was offered by various web based mapping service providers with a particular emphasis spent on functionality and flexibility.
Attempting to find information on any information that could be used to present cycle routes and foot paths in a dynamic way proved quite difficult to begin with. However, towards the end of the project the basic requirement for a system to meet the core objective was achieved.
The first part of the project was spent investigating the key components required to meet the project brief. These were :-
The means to locate local places in Warwickshire.
The means to overlay routes on maps.
The means to overlay areas such as parks etc.
The means to capture/record date from maps.
Adopting this approach unearthed some interesting features that could be used in future developments to which some proof of concept demonstrations were produced (See Project Outcome section) :-
Place Locator
Mobile Library Locator
County Recycling bin(s) Locator
KLM file location previewer
Area Overlays

Cycle Footway route recording (Core Project Item)
The project also investigated some interesting avenues such as using live or pseudo feeds and displaying the data dynamically.
Live Traffic in Warwickshire
This whole project gave an insight into how maps could be used to display information to the local community. Some of the ideas included.
Recycling locations in the county
Mobile Library Locator
Dynamic road work information
Summer Activities What’s On

Mapping Service Providers
Several mapping service providers were reviewed with regard to the functionality required for the project. Yahoo’s, Google’s, Ordnance Survey’s and Openstreetmap were all reviewed. To date both Yahoo and Google offer the most versatile solutions. Therefore it was decided that for any development/proof of concept work then only Yahoo and Google mapping software would be used.

Yahoo Maps
Yahoo Maps offers a comprehensive API that is accessed via Javascript within a HTML page. The API set is very similar in functionality to that offered by Google. Access to the API is gained via a ‘key’ (see section below).

Google Maps
Again Google Maps offers a comprehensive API that is accessed via Javascript within a HTML page along with a ‘key’. Google’s functionality offers slightly more functionality than that of Yahoo. Two of these additional features warranted further investigation. GGeoXML and the ability to overlay road traffic proved a couple of interesting avenues to investigate.
GGeoXML provides a means to overlay content that is presented in a XML format that is known as KML. KML is a common format for conveying geospatial data that can be used by a wide range of mapping software. There also appears to be some interesting work going on with RSS feeds in the form of a GGeoRSS function.
The live traffic overlay provides both live and historical traffic data for most major trunk roads in the UK. However, live was not really live as the overlay never appeared to get refreshed/updated. The lack of refresh was quickly addressed by a small piece of Javascript (See the Live Traffic in Warwickshire).

OS Openspace
OS Openspace is provided by Ordnance Survey, this is a new offering by OS and as with Yahoo & Google is access via a ‘key’. However, there key does not work when the URL is http://localhost. Not having access to localhost can be a disadvantage when carrying out development work, this and a limited API meant that this product would be used in any development/proof of concept work as part of this project.

Openstreetmap
Openstreetmap relies on the web community to develop its capabilities. This includes the input of mapping data such as roads, footpaths etc. consequently their maps are not complete if fact several local road are not present. As this offering is not complete the this project would not investigate it’s offering any further. However, in time it offers potential for showing detailed mapping information.

API Keys
Access to the API’s used by Google, Yahoo and OSOpenspace is controlled by the use of a software ‘key’ which relates to the URL of the web site that the HTML pages originate. The ‘key’ has to be placed as Javascript in any page/frame that accesses the providers API. The ‘key’ are provided by the provider and relate to the domain name of the site hosting the web pages. Have these keys can present problems when developing pages are the key for the local/testing machine will be different to that of the live host. However, there are ways around this by using dynamic pages that reference a local file. As part for this project dynamic pages were achieved using PHP that called a local file containing the key.

KML Files
KML (keyhole Markup Language) is a XMK based file format used to display geographic data in various mapping applications such as Google Earth, Google Maps, and Google Maps for mobile. Further detailed information can be found at :-
http://en.wikipedia.org/wiki/KML
KML files have been used extensively with in this project as there are many sources out on the web and once familiar with the format can relatively easily be produced. Producing them using Javascript, PHP etc has to be the quickest by far particularly when dealing with large amounts of data. Most of the demonstration pages of this project use KML files.
One important point of KML files that can cause confusion to developers is that any icon or image references must be visible to the Google servers (ie you cannot reference images of the local machine).

Frustrations
Throughout the project there were glimpses of what could be achieved particularly in the use of KML files. However, finding good sources of data proved to be difficult. For instance overlay local news items, there but there is noting that could place then geospatially on a map without a lot of intelligent post-processing.

Cycle Footway route recording
Something was achieved. It was not developed as far as I would have liked but it works.

PROJECT OUTCOME

Describe the degree to which the work was successful in addressing the project description. Include reasons why or why not.

Introduction
In order to help evaluate the functionality offered by the various API’s several example web pages were produced. In the subsections below each is ….

Place Locator
This was developed to prove the Yahoo ‘drawZoomAndCenter’ function. This function is used to locate places anywhere in the world. To locate a place just pass the place name as a parameter and the Yahoo map will display the chosen place, well if you are concise enough. That’s the secret been concise. The place locater attempts to construct a concise string using the parameters entered by the user plus the inclusion of ‘UK’. It will even work to house number level. To use simply enter as much information as possible and press find.

Capture-2.jpg

Place Locator

Mobile Library Locator

Example at: http://www.agilitas.co.uk/maps/libraries.html

This was a combined effort using data extracted from Lotus Notes database. Data was extracted from Notes and placed in a local MySQL database for ease of access. A pre-processer was written in PHP to create a KML file that was then placed out on the web. Finally a web page was written to access the KML file and display the data as an overlay using the Google Maps API.
When launched the page is focused over Warwickshire including an overlay displaying images of mobile library buses all over the county. Select any of these buses and further information about the mobile library will be displayed (e.g. The location, the day and time plus must more).

Capture-3.jpg

Mobile Library Locator

County Recycling bin(s) Locator

A follow on the Mobile Library Locator was the Recycle bin locator. This used the same principles as with the libraries. The data used for the overlay is purely fictional but this small development demonstrates what can be quickly achieved using KML file as overlays. It would have been nice to have the coordinate data on recycling bins as this could have made this a really useful development. The Idea behind this was to provide the general public with a simple way to find the nearest recycle point for what they wanted to dispose of.

Capture-5.jpg

County Recycling bin(s) Locator

Live Traffic in Warwickshire

Example at: http://www.agilitas.co.uk/maps/wcc-traffic02.php

The purpose of this development was to produce a page that would be pseudo live and what better than using traffic. The development uses data readily available via Google maps and a very simple refresh routine. For the demonstration the refresh rate was set to 5 mins. It is believed a lot more could be done with this development. For instance if live traffic updates or details of road works could be extracted then this data could easily be overlayed as well. One interesting aspect of this development is where does Google get its live traffic data from? Is it publically available? If so a lot more could be archived.

Capture-4.jpg

Live Traffic in Warwickshire

KML file location previewer

Example at: http://www.agilitas.co.uk/maps/kmlviewer.html

This is a web page that was developed primary to test and check KML files. Paste the URL of the KML file in the appropriate textbox and press Load and then press the pan button. Note sometime the pan has failed to work. If it fails then use the pan and zoom tools on the map itself. In the sample below a feed from British Seismology is used.

Capture-9.jpg

KML File Previewer

Cycle Footway route recording

Example at: http://www.agilitas.co.uk/maps/routes.html

(maps/gooogle/trace01.html)
After following many dead-ends a simple way of recording routes with notes and pictures was achieved. It is not the most elaborate peace of software but it demonstrates most of the key functionality required.
The software in the form of a web page records information entered by the user. When the route is complete the user exports the data as a KML file. The data is exported onto another web page where is has to be viewed as source, saved to the local machine and copied out onto the web. All very messy but shows potential. Ideally the collected data should be passed back to a web server maybe as some sort of AJAX call.
All the recording of data is achieved via one screen. The user selects start tracking to start the process of recording. The user then move the cursor to the start of their route an clicks. This records the start point. Subsequent point can then be recorded right to the end of the route. As the route progresses a blue trace is overlaid on the screen. Mistakes can be removed via the ‘Clear Last’ button or even the ‘Clear All’ which does exactly what is says.
Notes can be added at any point along the route by entering text in the ‘notes’ text area and selecting ‘Add Note’
Images can also be added by placing an image URL in the Image URL text Box and selecting ‘Add Image’. Note the image must be visible on the web (no local images).
Both the start and end points will be displayed as markers on the final output along with any points that have a note and/or image attached.
Once finished the data is exported be selecting the ‘Export’ button.
With a completed KML file on the web drop the URL in KML URL text box on the KML file location previewer and all will be displayed.

Capture-6.jpg

Cycle Footway Route Recording - Start Page

Capture-7.jpg

Cycle Footway Route Recording - Route Recording (Blue Line)

Capture-8.jpg

Cycle Footway Route Recording - Finished Route (Including Photograph)

SHORT TERM BENEFITS

What immediate impact could the output of this R&D work have on the organisation – could it provide benefits without compromising our strategic approach?

From this development as it stands at the present there is not much that benefits for the internals of WCC. However, for the general public there are some good opportunities. The Mobile Library and Recycle bin locations could be very useful.

STRATEGIC IMPLICATIONS

How the work carried out fits with our strategic direction or how it should contribute to our strategic thinking.

A lot of this work overlaps what should be achievable via ‘Warwickshire Maps’ but this project has demonstrated useful web services that could be made available relatively quickly to the general public. The demonstration pages were developed in a timely fashion. It would be interesting to know how quickly the same could be achieved using Warwickshire Maps. Most of these small developments were based around KML files which are used by various mapping applications. The questions must be does Warwickshire Maps handle KML files and can it be interactive on a web page such as handling call-backs as in the route recording development. If not then using maps such as Google Maps should form part of WCC strategy.
This project used a PHP code library for converting coordinate data. To have this available as part of a utility service would be useful as part of SOA. In a similar way software to quickly produce KML outputs would similarly be beneficial.

OTHER NOTES ETC

A live demonstration of the project work can be found at the following :-
http://www.agilitas.co.uk/maps/

Useful Reference Sites Used
http://www.jstott.me.uk/phpcoord/
A Very comprehensive set of PHP functions used for converting between coordinate systems. Brilliant peace of code.

http://www.apachefriends.org/en/xampp-windows.html
Comprehensive standalone web server that is ideal for development work.

http://code.google.com/apis/maps/documentation/reference.html
Google Maps API

http://www.bioneural.net/2008/03/09/mapping-fun-with-georss-and-geo-discovery/
Some information on GoeRSS feeds.

http://www.transportdirect.info/web2/
Could be used for traffic information etc.

http://exploreourpla.net/georss/http://www.digitalgeography.co.uk/feed/
Example of Live News Feeds overlaid on Google maps.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License