Imagine I know the latitude/longitude of a point in the UK. How do I show the boundaries of the administrative areas that contain it on a map?.

asked 22 Dec '10, 14:30

harryharrold's gravatar image

harryharrold
16224
accept rate: 0%


Alternatively, you could use the MySociety Mapit service. Simply call the following method, which will return the local authority areas in JSON format:

http://mapit.mysociety.org/point/4326/{lng},{lat}

Once you've grabbed the ID of the area you want, you can then get a KML of the area like so:

http://mapit.mysociety.org/area/{area-id}.kml

link

answered 18 Jan '11, 18:29

pezholio's gravatar image

pezholio
7112
accept rate: 33%

edited 22 Jan '11, 01:05

rgrp's gravatar image

rgrp ♦♦
501122027

If you are using OS OpenSpace then it is very easy to plot these boundaries. Simple code examples can be found here:

http://osopenspacewiki.ordnancesurvey.co.uk/wiki/index.php?title=Examples#Boundaries

This simple example plots the boundary of The City of Southampton:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript" src="http://openspace.ordnancesurvey.co.uk/osmapapi/openspace.js?key=INSERT YOUR API KEY HERE"></script>
<script type="text/javascript">
 var osMap, boundaryLayer;
 function init()
{
   osMap = new OpenSpace.Map('map');
   var options = {strategies: [new OpenSpace.Strategy.BBOX()],
            area_code: ["UTA" ] , admin_unit_ids: ["37256"]
                        };
   boundaryLayer = new OpenSpace.Layer.Boundary("Boundaries", options);
   osMap.addLayer(boundaryLayer);
   osMap.setCenter(new OpenSpace.MapPoint(400000, 200000), 2);
}
</script>
</head>
<body onload="init()">
<div id="map" style="width: 500px; height: 300px; border: 1px solid black;"></div>
</body>
</html>

This lookup table (https://openspace.ordnancesurvey.co.uk/openspaceforum/thread.jspa?threadID=257&tstart=0) will provide the UNIT IDs and Area Codes you need for other regions.

link

answered 14 Jan '11, 10:46

John%20Goodwin's gravatar image

John Goodwin
216249
accept rate: 25%

edited 22 Jan '11, 01:05

rgrp's gravatar image

rgrp ♦♦
501122027

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×5
×5

Asked: 22 Dec '10, 14:30

Seen: 798 times

Last updated: 22 Jan '11, 01:05

powered by OSQA