@@ -1,4 +1,4 @@ | |||
<?php /* Smarty version 2.6.16, created on 2007-04-05 19:15:39 | |||
<?php /* Smarty version 2.6.16, created on 2007-04-09 17:14:08 | |||
compiled from index.tpl */ ?> | |||
<?php $_smarty_tpl_vars = $this->_tpl_vars; | |||
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array())); | |||
@@ -54,6 +54,7 @@ unset($_smarty_tpl_vars); | |||
<div id="divSiteUpdates"> | |||
<h4>Recent site updates</h4> | |||
<ul class="nobullets"> | |||
<li><em>April 2007</em>Added 50 more councils.<li> | |||
<li><em>March 2007</em> Added an API and a few more councils (inc. Islington and Hackney)</li> | |||
<li><em>February 2007</em> Added loads more councils (inc. Camden and Tower Hamlets)</li> | |||
<li><em>December 2006</em> beta launch</li> | |||
@@ -1,4 +1,4 @@ | |||
<?php /* Smarty version 2.6.16, created on 2007-04-05 19:16:12 | |||
<?php /* Smarty version 2.6.16, created on 2007-04-09 12:02:23 | |||
compiled from about.tpl */ ?> | |||
<?php $_smarty_tpl_vars = $this->_tpl_vars; | |||
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array())); | |||
@@ -1,4 +1,4 @@ | |||
<?php /* Smarty version 2.6.16, created on 2007-04-07 17:19:50 | |||
<?php /* Smarty version 2.6.16, created on 2007-04-09 16:50:59 | |||
compiled from rss.tpl */ ?> | |||
<?php echo '<?xml'; ?> | |||
version="1.0" encoding="UTF-8"<?php echo '?>'; ?> | |||
@@ -1,4 +1,4 @@ | |||
<?php /* Smarty version 2.6.16, created on 2007-03-24 11:13:35 | |||
<?php /* Smarty version 2.6.16, created on 2007-04-09 12:02:28 | |||
compiled from getinvolved.tpl */ ?> | |||
<?php $_smarty_tpl_vars = $this->_tpl_vars; | |||
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array())); | |||
@@ -10,7 +10,7 @@ unset($_smarty_tpl_vars); | |||
<h3>I am a programmer and want to add my local authority</h3> | |||
<p> | |||
You can help by writing a <a href="http://en.wikipedia.org/wiki/Screen_scraping">screen scraper</a> for your local authority that was can import into plannignalerts.com. There are only 2 criteria for the screen scraper: | |||
You can help by writing a <a href="http://en.wikipedia.org/wiki/Screen_scraping">screen scraper</a> for your local authority that was can import into planningalerts.com. There are only 2 criteria for the screen scraper: | |||
</p> | |||
<ol> | |||
<li>That it can output data in the following format: <a href="http://www.planningalerts.com/lambeth.xml">http://www.planningalerts.com/lambeth.xml</a></li> | |||
@@ -19,7 +19,10 @@ unset($_smarty_tpl_vars); | |||
<p> | |||
Other than that it's up to you. It can be in any language. You can host them yourself or we can host it for you. | |||
</p> | |||
<p><span class="highlight">You can grab the code for this site and view some developent tickets <a href="http://code.goo | |||
gle.com/p/planningalerts/">here</a> and join our developer mailing list <a href="http://groups.google.com/group/planningaler | |||
ts-dev"> here</a>.</span> | |||
</p> | |||
<h3>I work for a local authority and would like to make our data available</h3> | |||
<p> | |||
The most important thing you can do is publish your data in a simple format that is freely available on the internet. Something <a href="/lambeth.xml">like this</a> is good but we can work with most formats. Please <a href="/about.php#contact">get in touch</a> if you would like to discuss how you can help. | |||
@@ -1,4 +1,4 @@ | |||
<?php /* Smarty version 2.6.16, created on 2007-04-05 19:16:12 | |||
<?php /* Smarty version 2.6.16, created on 2007-04-09 17:14:56 | |||
compiled from header.tpl */ ?> | |||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |||
@@ -7,42 +7,124 @@ $api = new api; | |||
class api { | |||
//Properties | |||
var $warnings = ""; | |||
var $easting = 0; | |||
var $northing = 0; | |||
var $area_size = 0; | |||
var $warnings = array(); | |||
var $applications; | |||
//Constructor | |||
function api() { | |||
if (isset($_GET['howto'])){ | |||
$this->howto(); | |||
redirect("apihowto.php");//this handles old links to this page | |||
exit; | |||
} else { | |||
$this->setup(); | |||
if(isset($_GET['call'])){ | |||
$this->setup(); | |||
}else{ | |||
$this->setup_old(); | |||
} | |||
$this->bind(); | |||
} | |||
} | |||
//setup | |||
function setup (){ | |||
//setup | |||
function setup(){ | |||
//get the call type | |||
$call = $_GET['call']; | |||
switch ($call) { | |||
case "postcode": | |||
if(!isset($_GET['postcode']) || !is_postcode($_GET['area_size'])){ | |||
array_push($this->warnings, "No valid postcode specified"); | |||
} | |||
if(!isset($_GET['area_size'])){ | |||
array_push($this->warnings, "Area size specified"); | |||
} | |||
//all good, get the data | |||
if(sizeof($this->warnings) == 0){ | |||
$xy = postcode_to_location($_GET['postcode']); | |||
$easting = $xy[0]; | |||
$northing = $xy[1]; | |||
$this->applications = Applications::query($easting, $northing, alert_size_to_meters($_GET['area_size'])); | |||
} | |||
break; | |||
case "point": | |||
//validation | |||
if(!isset($_GET['lat']) || !isset($_GET['lng'])){ | |||
array_push($this->warnings, "No longitude or latitude was specified"); | |||
} | |||
if(!isset($_GET['area_size'])){ | |||
array_push($this->warnings, "Area size specified"); | |||
} | |||
//all good, get the data | |||
if(sizeof($this->warnings) == 0){ | |||
$latlng = new LatLng($_GET['lat'], $_GET['lng']); | |||
$xy = $latlng->toOSRef(); | |||
$easting = $xy->easting; | |||
$northing = $xy->northing; | |||
$this->applications = Applications::query($easting, $northing, alert_size_to_meters($_GET['area_size'])); | |||
} | |||
break; | |||
case "pointos": | |||
//validation | |||
if(!isset($_GET['easting']) || !isset($_GET['northing'])){ | |||
array_push($this->warnings, "No easting or northing was specified"); | |||
} | |||
if(!isset($_GET['area_size'])){ | |||
array_push($this->warnings, "Area size specified"); | |||
} | |||
//all good, get the data | |||
if(sizeof($this->warnings) == 0){ | |||
$this->applications = Applications::query($_GET['easting'], $_GET['$northing'], alert_size_to_meters($_GET['area_size'])); | |||
} | |||
break; | |||
case "authority": | |||
//validation | |||
if(!isset($_GET['authority'])){ | |||
array_push($this->warnings, "No authority name specified"); | |||
} | |||
//all good, get the data | |||
if(sizeof($this->warnings) == 0){ | |||
$this->applications = Applications::query_authority($_GET['authority']); | |||
} | |||
break; | |||
case "area": | |||
//validation | |||
if(!isset($_GET['bottom_left_lat']) || !isset($_GET['bottom_left_lng']) || !isset($_GET['top_right_lat']) || !isset($_GET['top_right_lng'])){ | |||
array_push($this->warnings, "Bounding box was not specified"); | |||
} | |||
//all good, get the data | |||
if(sizeof($this->warnings) == 0){ | |||
$bottom_left_latlng = new LatLng($_GET['bottom_left_lat'], $_GET['bottom_left_lng']); | |||
$bottom_left_xy = $latlng->toOSRef(); | |||
$top_right_latlng = new LatLng($_GET['bottom_left_lat'], $_GET['bottom_left_lng']); | |||
$top_right_xy = $latlng->toOSRef(); | |||
$this->applications = Applications::query_area($bottom_left_xy->easting, $bottom_left_xy->northing, $top_right_xy->easting, $top_right_xy->northing); | |||
} | |||
break; | |||
default: | |||
$this->warnings = "No call type specified"; | |||
} | |||
} | |||
//setup old (maintains the original mini api) | |||
function setup_old (){ | |||
//Grab the postcode and area size from the get string | |||
if (!isset($_GET['area_size'])){ //check is_numeric and isn't too big | |||
$this->warnings .= "No area size specified "; | |||
array_push($this->warnings, "No area size specified"); | |||
} | |||
if (!(isset($_GET['lat']) && isset($_GET['lng'])) | |||
|| !(isset($_GET['postcode'])) ) { | |||
$this->warmings .= "No location specified "; | |||
} | |||
if ($this->warnings == ""){ | |||
if (sizeof($this->warnings) == 0){ | |||
//Get OS ref from postcode | |||
if (isset($_GET['postcode'])) { | |||
$xy = postcode_to_location($_GET['postcode']); | |||
$this->easting = $xy[0]; | |||
$this->northing = $xy[1]; | |||
$this->northing = $xy[1]; | |||
} else { | |||
$latlng = new LatLng($_GET['lat'], $_GET['lng']); | |||
$xy = $latlng->toOSRef(); | |||
@@ -1,4 +1,4 @@ | |||
body {font-family:georgia, serif; text-align:center;line-height:2em;margin:0; | |||
body {font-family:georgia, serif; text-align:center;line-height:1.8em;margin:0; | |||
color:#0f0f0f;} | |||
#divPage {width:500px; margin:0 auto;background:white;text-align:left;} | |||
h1 {font-weight:normal; font-size:2.7em;padding-left:115px;padding-bottom:0.2em;padding-top:0.1em;} | |||
@@ -58,6 +58,14 @@ div.attention h3 {font-size:2em;padding-bottom:0.3em;font-style:normal; color:#4 | |||
dl.faq dt {color:#96ca2f;font-style:italic;} | |||
dl.faq dd {padding-left:0;margin-left:0;} | |||
/* api */ | |||
div.apiitem {border:dotted 1px #808080;background:#fafafa;padding:10px;margin-bottom:1em;} | |||
div.apiitem code {background:white;display:block;padding:10px;border:solid 1px #808080; | |||
word-wrap: break-word} | |||
div.apiitem code em {color:#808080;} | |||
div.apiitem p {font-size:0.8em;margin:0;padding:0;line-height:1.5em;margin-bottom:1em;} | |||
p.apiexamples {position:relative; top:0.7em;} | |||
/* infobox */ | |||
.infobox {background:#fdd9ea; font-size:0.9em;} | |||
@@ -75,6 +83,8 @@ a {color:#22579C;} | |||
/* Footer */ | |||
#divFooter {font-size:0.9em; | |||
padding-top:1.5em;position:relative;} | |||
#divFooter #aOpen {display:block;width:80px;height:15px;background:red url(../images/opendata.png); | |||
position:absolute; right:140px; top:40px;} | |||
#divFooter #aHosted {display:block;width:130px;height:35px;background:url(../images/hosted.png); | |||
position:absolute; right:0; top:30px;} | |||
#divFooter ul {border-top:dotted 1px #808080;padding-top:3px;padding-bottom:20px;} | |||
@@ -3,145 +3,175 @@ | |||
require_once('config.php'); | |||
require_once('DB.php'); | |||
class Application{ | |||
var $authority_id = 0; | |||
var $council_reference = ""; | |||
var $date_recieved = ""; | |||
var $date_scraped =""; | |||
var $address = ""; | |||
var $postcode = ""; | |||
var $description = ""; | |||
var $status = ""; | |||
var $info_url = ""; | |||
var $info_tinyurl = ""; | |||
var $comment_url = ""; | |||
var $comment_tinyurl = ""; | |||
var $map_url = ""; | |||
var $x = 0; | |||
var $y = 0; | |||
class Application{ | |||
var $authority_id = 0; | |||
var $council_reference = ""; | |||
var $date_recieved = ""; | |||
var $date_scraped =""; | |||
var $address = ""; | |||
var $postcode = ""; | |||
var $description = ""; | |||
var $status = ""; | |||
var $info_url = ""; | |||
var $info_tinyurl = ""; | |||
var $comment_url = ""; | |||
var $comment_tinyurl = ""; | |||
var $map_url = ""; | |||
var $x = 0; | |||
var $y = 0; | |||
#lat/lon used by rss.tpl, not yet in schema | |||
var $lat = 0; | |||
var $lon = 0; | |||
#authority name in join'd table 'authority' | |||
var $authority_name = ""; | |||
function exists(){ | |||
$db = DB::connect(DB_CONNECTION_STRING); | |||
$exists = false; | |||
$council_reference = $db->quote($this->council_reference); | |||
$authority_id = $db->quote($this->authority_id); | |||
$sql = "select application_id | |||
from application | |||
where council_reference = $council_reference | |||
and authority_id = $authority_id"; | |||
#lat/lon used by rss.tpl, not yet in schema | |||
var $lat = 0; | |||
var $lon = 0; | |||
if(sizeof($db->getAll($sql)) >0){ | |||
$exists = true; | |||
} | |||
return $exists; | |||
} | |||
//Save | |||
function save(){ | |||
$db = DB::connect(DB_CONNECTION_STRING); | |||
$council_reference = $db->quote($this->council_reference); | |||
$address = $db->quote($this->address); | |||
$postcode = $db->quote($this->postcode); | |||
$description = $db->quote($this->description); | |||
$info_url = $db->quote($this->info_url); | |||
$info_tinyurl = $db->quote($this->info_tinyurl); | |||
$comment_url = $db->quote($this->comment_url); | |||
$comment_tinyurl = $db->quote($this->comment_tinyurl); | |||
$authority_id = $db->quote($this->authority_id); | |||
$x = $db->quote($this->x); | |||
$y = $db->quote($this->y); | |||
$date_scraped = $db->quote($this->date_scraped); | |||
$map_url = $db->quote($this->map_url); | |||
$sql ="insert into application | |||
( | |||
council_reference, | |||
address, | |||
postcode, | |||
description, | |||
info_url, | |||
info_tinyurl, | |||
comment_url, | |||
comment_tinyurl, | |||
authority_id, | |||
x, | |||
y, | |||
date_scraped, | |||
map_url | |||
) | |||
values( | |||
$council_reference, | |||
$address, | |||
$postcode, | |||
$description, | |||
$info_url, | |||
$info_tinyurl, | |||
$comment_url, | |||
$comment_tinyurl, | |||
$authority_id, | |||
$x, | |||
$y, | |||
$date_scraped, | |||
$map_url | |||
)"; | |||
$db->query($sql); | |||
#authority name in join'd table 'authority' | |||
var $authority_name = ""; | |||
function exists(){ | |||
$db = DB::connect(DB_CONNECTION_STRING); | |||
$exists = false; | |||
$council_reference = $db->quote($this->council_reference); | |||
$authority_id = $db->quote($this->authority_id); | |||
$sql = "select application_id | |||
from application | |||
where council_reference = $council_reference | |||
and authority_id = $authority_id"; | |||
if(sizeof($db->getAll($sql)) >0){ | |||
$exists = true; | |||
} | |||
return $exists; | |||
} | |||
//Save | |||
function save(){ | |||
$db = DB::connect(DB_CONNECTION_STRING); | |||
$council_reference = $db->quote($this->council_reference); | |||
$address = $db->quote($this->address); | |||
$postcode = $db->quote($this->postcode); | |||
$description = $db->quote($this->description); | |||
$info_url = $db->quote($this->info_url); | |||
$info_tinyurl = $db->quote($this->info_tinyurl); | |||
$comment_url = $db->quote($this->comment_url); | |||
$comment_tinyurl = $db->quote($this->comment_tinyurl); | |||
$authority_id = $db->quote($this->authority_id); | |||
$x = $db->quote($this->x); | |||
$y = $db->quote($this->y); | |||
$date_scraped = $db->quote($this->date_scraped); | |||
$map_url = $db->quote($this->map_url); | |||
$sql ="insert into application | |||
( | |||
council_reference, | |||
address, | |||
postcode, | |||
description, | |||
info_url, | |||
info_tinyurl, | |||
comment_url, | |||
comment_tinyurl, | |||
authority_id, | |||
x, | |||
y, | |||
date_scraped, | |||
map_url | |||
) | |||
values( | |||
$council_reference, | |||
$address, | |||
$postcode, | |||
$description, | |||
$info_url, | |||
$info_tinyurl, | |||
$comment_url, | |||
$comment_tinyurl, | |||
$authority_id, | |||
$x, | |||
$y, | |||
$date_scraped, | |||
$map_url | |||
)"; | |||
$db->query($sql); | |||
} | |||
class Applications{ | |||
function query($x,$y,$d) { | |||
$db = DB::connect(DB_CONNECTION_STRING); | |||
$sql = "select council_reference, address, postcode, description, info_url, comment_url, map_url, x, y, date_recieved, full_name | |||
from application | |||
inner join authority on application.authority_id = authority.authority_id | |||
where application.x > " . $db->quote($x - $d) . " and application.x < " . $db->quote($x + $d) . | |||
" and application.y > " . $db->quote($y - $d) . " and application.y < " . $db->quote($y + $d) . | |||
" order by date_scraped desc limit 100"; | |||
} | |||
$application_results = $db->getAll($sql); | |||
class Applications{ | |||
$applications = array(); | |||
if (sizeof($application_results) > 0) { | |||
for ($i=0; $i < sizeof($application_results); $i++) { | |||
$application = new application(); | |||
$application->council_reference = $application_results[$i][0]; | |||
$application->address = $application_results[$i][1]; | |||
$application->postcode = $application_results[$i][2]; | |||
$application->description = $application_results[$i][3]; | |||
$application->info_url = $application_results[$i][4]; | |||
$application->comment_url = $application_results[$i][5]; | |||
$application->map_url = $application_results[$i][6]; | |||
$application->x = $application_results[$i][7]; | |||
$application->y = $application_results[$i][8]; | |||
$application->date_received = $application_results[$i][9]; | |||
$application->authority_name = $application_results[$i][10]; | |||
//by point | |||
function query($x,$y,$d) { | |||
$db = DB::connect(DB_CONNECTION_STRING); | |||
$sql = "select council_reference, address, postcode, description, info_url, comment_url, map_url, x, y, date_recieved, full_name | |||
from application | |||
inner join authority on application.authority_id = authority.authority_id | |||
where application.x > " . $db->quote($x - $d) . " and application.x < " . $db->quote($x + $d) . | |||
" and application.y > " . $db->quote($y - $d) . " and application.y < " . $db->quote($y + $d) . | |||
" order by date_scraped desc limit 100"; | |||
$os = new OSRef($application->x, $application->y); | |||
$latlng = $os->toLatLng(); | |||
$application->lat = $latlng->lat; | |||
$application->lon = $latlng->lng; | |||
array_push($applications, $application); | |||
} | |||
} | |||
$application_results = $db->getAll($sql); | |||
return applications::load_applications($application_results); | |||
} | |||
//by area | |||
function query_area($x1,$y1,$x2,$y2) { | |||
$db = DB::connect(DB_CONNECTION_STRING); | |||
$sql = "select council_reference, address, postcode, description, info_url, comment_url, map_url, x, y, date_recieved, full_name | |||
from application | |||
inner join authority on application.authority_id = authority.authority_id | |||
where application.x > " . $db->quote($x1) . " and application.x < " . $db->quote($x2) . | |||
" and application.y > " . $db->quote($y1) . " and application.y < " . $db->quote($y2) . | |||
" order by date_scraped desc limit 100"; | |||
$application_results = $db->getAll($sql); | |||
return applications::load_applications($application_results); | |||
} | |||
//by authority | |||
function query_authority($authority_short_name) { | |||
$db = DB::connect(DB_CONNECTION_STRING); | |||
$sql = "select council_reference, address, postcode, description, info_url, comment_url, map_url, x, y, date_recieved, full_name | |||
from application | |||
inner join authority on application.authority_id = authority.authority_id | |||
where authority.short_name = " . $db->quote($authority_short_name) ." order by date_scraped desc limit 100"; | |||
return $applications; | |||
$application_results = $db->getAll($sql); | |||
return applications::load_applications($application_results); | |||
} | |||
function load_applications($application_results){ | |||
$applications = array(); | |||
if (sizeof($application_results) > 0) { | |||
for ($i=0; $i < sizeof($application_results); $i++) { | |||
$application = new application(); | |||
$application->council_reference = $application_results[$i][0]; | |||
$application->address = $application_results[$i][1]; | |||
$application->postcode = $application_results[$i][2]; | |||
$application->description = $application_results[$i][3]; | |||
$application->info_url = $application_results[$i][4]; | |||
$application->comment_url = $application_results[$i][5]; | |||
$application->map_url = $application_results[$i][6]; | |||
$application->x = $application_results[$i][7]; | |||
$application->y = $application_results[$i][8]; | |||
$application->date_received = $application_results[$i][9]; | |||
$application->authority_name = $application_results[$i][10]; | |||
$os = new OSRef($application->x, $application->y); | |||
$latlng = $os->toLatLng(); | |||
$application->lat = $latlng->lat; | |||
$application->lon = $latlng->lng; | |||
array_push($applications, $application); | |||
} | |||
} | |||
return $applications; | |||
} | |||
} | |||
?> |
@@ -419,4 +419,8 @@ function throw_error($message){ | |||
throw new exception($message); | |||
} | |||
function redirect ($url){ | |||
header("Location: $url"); | |||
} | |||
?> |
@@ -1,25 +1,109 @@ | |||
{include file="header.tpl"} | |||
<h3>PlanningAlerts.com API</h3> | |||
<p> | |||
Planning application data is available programmatically as <a href="http://georss.org/">GeoRSS feeds</a>. GeoRSS can be used in almost most all web mapping APIs and desktop GIS software, and in services like <a href="http://mapufacture.com">mapufacture</a> and <a href="http://pipes.yahoo.com/">Yahoo Pipes</a>. | |||
<p/> | |||
<p> | |||
Planning application data is available programmatically as <a href="http://georss.org/">GeoRSS feeds</a>. GeoRSS can be used in almost most all web mapping APIs and desktop GIS software, and in services like <a href="http://mapufactu re.com">mapufacture</a> and <a href="http://pipes.yahoo.com/">Yahoo Pipes</a>. | |||
<p/> | |||
<p> | |||
Just want the raw data? You can also download it <a href="http://www.planningalerts.com/backup.gz">here</a>. (gzipped mysql database dump with all user information removed). | |||
</p> | |||
<p> | |||
Construct an api request as follows. | |||
Either lat/lng or postcode is required. area_size is always required.<br> | |||
<p/> | |||
<h4>API documentation</h4> | |||
<!--Postcode--> | |||
<div class="apiitem"> | |||
<h5>Single Location by postcode</h5> | |||
<p class="apidefinition"> | |||
Return applications near a given postcode. The area included is a square either 400m (s), 800m (m) or 4000m (l) with the postcode at it's center. | |||
</p> | |||
<code> | |||
http://www.planningalerts.com/api.php?<strong>call</strong>=postcode<br/>&<strong>postcode</strong>=[some postcode]&<strong>area_size</strong>=['s' 'm' or 'l']</em> | |||
</code> | |||
<p class="apiexamples"> | |||
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">view example</a> | |||
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">view on a map</a> | |||
</p> | |||
</div> | |||
<code> | |||
http://www.planningalerts.com/api.php?<br> | |||
lat=[some latitude]<br> | |||
&lng=[some longitude]<br> | |||
&postcode=[some postcode]<br> | |||
&area_size=['s' 'm' or 'l'] | |||
</code> | |||
<p> | |||
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">an example query</a> | |||
</p> | |||
<!--Single--> | |||
<div class="apiitem"> | |||
<h5>Single Location by longitude/latitude</h5> | |||
<p class="apidefinition"> | |||
Return applications near a given longitude/latitude. The area included is a square either 400m (s), 800m (m) or 4000m (l) with the longitude/latitude at it's center. | |||
</p> | |||
<code> | |||
http://www.planningalerts.com/api.php?<strong>call</strong>=point<br/>&<strong>lat</strong>=[some latitude]&<strong>lng</strong>=[some longitude]<strong>area_size</strong>=['s' 'm' or 'l'] | |||
</code> | |||
<p class="apiexamples"> | |||
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">view example</a> | |||
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">view on a map</a> | |||
</p> | |||
</div> | |||
<!--Single--> | |||
<div class="apiitem"> | |||
<h5>Single Location by OSGB</h5> | |||
<p class="apidefinition"> | |||
Return applications near a given longitude/latitude. The area included is a square either 400m (s), 800m (m) or 4000m (l) with the OSGB point at it's center. | |||
</p> | |||
<code> | |||
http://www.planningalerts.com/api.php?<strong>call</strong>=pointos<br/>&<strong>easting</strong>=[some easting]&<strong>northing</strong>=[some northing]<strong>area_size</strong>=['s' 'm' or 'l'] | |||
</code> | |||
<p class="apiexamples"> | |||
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">view example</a> | |||
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">view on a map</a> | |||
</p> | |||
</div> | |||
<!--Box OSGB--> | |||
<div class="apiitem"> | |||
<h5>Area by longitude/latitude</h5> | |||
<p class="apidefinition"> | |||
Return applications within a rectangle defined by longitude/latitude. | |||
</p> | |||
<code> | |||
http://www.planningalerts.com/api.php?<strong>call</strong>=area<br/>&<strong>bottom_left_lat</strong>=[some latitude]&<strong>bottom_left_lng</strong>=[some longitude]&<strong>top_right_lat</strong>=[some latitude]&<strong>top_right_lng</strong>=[some longitude] | |||
</code> | |||
<p class="apiexamples"> | |||
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">view example</a> | |||
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">view on a map</a> | |||
</p> | |||
</div> | |||
<!--Box--> | |||
<div class="apiitem"> | |||
<h5>Area by OSGB</h5> | |||
<p class="apidefinition"> | |||
Return applications within a rectangle defined by OSGB coordinates. | |||
</p> | |||
<code> | |||
http://www.planningalerts.com/api.php?<strong>call</strong>=areaos<br/>&<strong>bottom_left_easting</strong>=[some easting]&<strong>bottom_left_northing</strong>=[some northing]&<strong>top_right_easting</strong>=[some easting]&<strong>top_right_northing</strong>=[some northing] | |||
</code> | |||
<p class="apiexamples"> | |||
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">view example</a> | |||
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">view on a map</a> | |||
</p> | |||
</div> | |||
<!--Box--> | |||
<div class="apiitem"> | |||
<h5>By planning authority</h5> | |||
<p class="apidefinition"> | |||
Return applications for a specific planning authority (e.g. a local council) by authority short name. | |||
</p> | |||
<code> | |||
http://www.planningalerts.com/api.php?<strong>call</strong>=authority<br/>&<strong>authority_short_name</strong>=[some name] | |||
</code> | |||
<p class="apiexamples"> | |||
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">view example</a> | |||
<a href="http://www.planningalerts.com/api.php?lat=51.52277&lng=-0.067281&area_size=l">view on a map</a> | |||
</p> | |||
</div> | |||
<h4>License information</h4> | |||
<p> | |||
Both the <a href="http://www.planningalerts.com/backup.gz"> raw data</a> and data via the api are licensed under the <a hrref="http://creativecommons.org/licenses/by-sa/2.0/">Creative Commons Attribution-ShareAlike 2.0 license</a>. The license granted in relation to the 'Work' should be read broadly to relate not only copyright but all other IP rights present in this dataset including, for example, any Database rights. | |||
</p> | |||
{include file="footer.tpl"} |
@@ -22,8 +22,12 @@ | |||
Yes please! To be able to cover the whole country we need help in writing screen scrapers to search the websites of every local authority in the country. If you'd like to write one for your local council <a href="about.php#contact">get in touch</a>. | |||
</dd> | |||
<dt>Can I have a copy of your data?</dt> | |||
<dd>Yes. You can use our <a href="http://www.planningalerts.com/api.php?howto">API</a> or download the <a href="h | |||
ttp://www.planningalerts.com/backup.gz"> raw data</a> (gzipped mysql database dump will all user information removed) | |||
</a>. </dd> | |||
<dd>Yes. You can use our <a href="http://www.planningalerts.com/api.php?howto">API</a> or download the <a href="http://www.planningalerts.com/backup.gz"> raw data</a> (gzipped mysql database dump with all user information removed) | |||
</a>. | |||
</dd> | |||
<dt>What kind of license is your data available under?</dt> | |||
<dd> | |||
Both the <a href="http://www.planningalerts.com/backup.gz"> raw data</a> and data via the api are licensed under the <a hrref="http://creativecommons.org/licenses/by-sa/2.0/">Creative Commons Attribution-ShareAlike 2.0 license</a>. The license granted in relation to the 'Work' should be read broadly to relate not only copyright but all other IP rights present in this dataset including, for example, any Database rights. | |||
</dd> | |||
</dl> | |||
{include file="footer.tpl"} |
@@ -5,7 +5,8 @@ | |||
<li><a href="about.php">About</a></li> | |||
<li><a href="about.php#contact">Contact</a></li> | |||
</ul> | |||
<a id="aHosted" href="http://www.mysociety.org"><span class="hide">Hosted by MySociety</span></a> | |||
<a id="aOpen" href="http://okd.okfn.org/" title="Data on this site is open"><span class="hide">Open Data</span></a> | |||
<a id="aHosted" href="http://www.mysociety.org" title="This website is hosted by mySociety"><span class="hide">Hosted by MySociety</span></a> | |||
</div> | |||
</div> | |||
{if $onloadscript !="" || $set_focus_control !=""} | |||
@@ -1,4 +1,4 @@ | |||
#!/usr/bin/python | |||
#!/usr/local/bin/python | |||
import urllib, urllib2 | |||
import HTMLParser | |||
@@ -1,4 +1,4 @@ | |||
#!/usr/bin/python | |||
#!/usr/local/bin/python | |||
import cgi | |||
import cgitb; cgitb.enable(display=0, logdir="/tmp") | |||
@@ -1,4 +1,4 @@ | |||
#!/usr/bin/python | |||
#!/usr/local/bin/python | |||
list_of_sites_filename = "PublicAccessSites.csv" | |||
other_files_to_copy_filename = "OtherFilesToCopy.csv" | |||