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

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:{lng},{lat}

Once you've grabbed the ID of the area you want, you can then get a KML of the area like so:{area-id}.kml


answered 18 Jan '11, 18:29

pezholio's gravatar image

accept rate: 33%

edited 22 Jan '11, 01:05

rgrp's gravatar image

rgrp ♦♦

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

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

<html xmlns="">
<script type="text/javascript" src=" 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.setCenter(new OpenSpace.MapPoint(400000, 200000), 2);
<body onload="init()">
<div id="map" style="width: 500px; height: 300px; border: 1px solid black;"></div>

This lookup table ( will provide the UNIT IDs and Area Codes you need for other regions.


answered 14 Jan '11, 10:46

John%20Goodwin's gravatar image

John Goodwin
accept rate: 25%

edited 22 Jan '11, 01:05

rgrp's gravatar image

rgrp ♦♦

Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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



Asked: 22 Dec '10, 14:30

Seen: 798 times

Last updated: 22 Jan '11, 01:05

powered by OSQA