pMap

Welcome to pMap (planningMap). It currently offers this service: take the previous 28 days’ planning applications to lbg, map those that can be geo-coded (by postcode), and list those that can’t. You can read a bit more about it and check the source code below.

pMap

The data is scraped and processed in a fairly long-winded way as the e-shootershill server side scripts (which are written in php) are not allowed to interact with servers in other domains (i.e. the council).

In the past, this site has worked around this obstacle by using JavaScript to access ‘Sponsor a brick for Severndroog‘ data directly by the browser using a proxy which homes the script and the sponsorship details, however that was not possible this time. Since JavaScript is historically limited by the Same Origin Policy, various workarounds are available for applications that need to live in one domain and obtain resources (such as planning data) from another – in this case a Yahoo pipe provides an intermediate service that can both a) get the planning data, and b) pass it on.

A Yahoo pipe scrapes the data, ready for the browser to collect it

From this point, a JavaScript in the browser looks for a postcode in each application, and if it finds one, it uses it to request latitude and longitude co-ordinates from mapit, plotting the application details on the map. If no postcode is found, the application is listed below.

TODO

Forthcoming in future versions: There are a number of features that this could have, as the planning data is quite rich in information – probably the first things to do are to find access to a service that geocodes locations without a postcode; and to allow custom date ranges to be explored. Following that different markers for different types of work could be plotted and toggled on/off to make it quick and easy to see what kind of changes are happening… other data differences that could be highlighted include ward and conservation.

The html/javascript is available, it can be freely reused, or better still forked via open source sharing. Whilst it obtains google maps and jquery scripts remotely, it currently requires a local copy of gmap3, plus the Yahoo Pipe. It might be possible to replace the latter with functions provided by easyXDM, although that remains to be tested.