Is it possible to return a list of regions that border, say, Hampshire or are contained in Hampshire?

asked 14 Jan '11, 12:13

John%20Goodwin's gravatar image

John Goodwin
216249
accept rate: 25%


The Ordnance Survey linked data contains some simple qualitative spatial relations like 'touches', 'within' and 'contains'. There can be used in a SPARQL query to do simple spatial queries.

The following query (done at the OS SPARQL endpoint http://api.talis.com/stores/ordnance-survey/services/sparql) returns a list of features bordering Hampshire.

PREFIX spatialrelations: <http://data.ordnancesurvey.co.uk/ontology/spatialrelations/>

select ?a ?name
where
{
  ?a spatialrelations:touches <http://data.ordnancesurvey.co.uk/id/7000000000017765> .
  ?a <http://www.w3.org/2004/02/skos/core#prefLabel> ?name  .
  ?a a <http://data.ordnancesurvey.co.uk/ontology/admingeo/County> .
}

This query returns a list of county electoral divisions contains in Hampshire:

PREFIX spatialrelations: <http://data.ordnancesurvey.co.uk/ontology/spatialrelations/>

select ?a ?name
where
{
  ?a spatialrelations:within <http://data.ordnancesurvey.co.uk/id/7000000000017765> .
  ?a <http://www.w3.org/2004/02/skos/core#prefLabel> ?name  .
  ?a a <http://data.ordnancesurvey.co.uk/ontology/admingeo/CountyElectoralDivision> .
}

for particular nesting geographies there are shorthand predicates. the following returns all the Westminster constituencies in South East England:

PREFIX admingeo: <http://data.ordnancesurvey.co.uk/ontology/admingeo/>

select ?a ?name
where {
  <http://data.ordnancesurvey.co.uk/id/7000000000041421> admingeo:westminsterConstituency ?a .
  ?a <http://www.w3.org/2004/02/skos/core#prefLabel> ?name  .
}

Similar predicates such as: http://data.ordnancesurvey.co.uk/ontology/admingeo/county, http://data.ordnancesurvey.co.uk/ontology/admingeo/district and http://data.ordnancesurvey.co.uk/ontology/admingeo/ward provide similar short cuts.

The spatial relations and administrative geography vocabularies can be download:

http://www.ordnancesurvey.co.uk/ontology/spatialrelations.owl

http://www.ordnancesurvey.co.uk/ontology/admingeo.owl

link

answered 14 Jan '11, 12:22

John%20Goodwin's gravatar image

John Goodwin
216249
accept rate: 25%

edited 14 Jan '11, 14:35

rgrp's gravatar image

rgrp ♦♦
501122027

mapit.mysociety also provides information via URIs on regions that touch, overlap, cover etc of selected areas

  • /area/[area ID]/touches.html
  • /area/[area ID]/covers.html
  • /area/[area ID]/overlaps.html
  • /area/[area ID]/children.html
  • /area/[area ID]/covered.html
  • /area/[area ID]/coverlaps.html

Hampshire County Council http://mapit.mysociety.org/area/2227/coverlaps.html

link

answered 22 Jan '11, 16:17

naesk's gravatar image

naesk
176126
accept rate: 20%

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:

×10
×6
×2
×1

Asked: 14 Jan '11, 12:13

Seen: 723 times

Last updated: 22 Jan '11, 16:17

powered by OSQA