Unlock

Questions?

Project Blog

|

Contact Us envelope image
Home > Unlock Places > Example Queries

Example Queries

To try out any of the example queries below simply click on the icon next to the query description. Links open in a new window.

Search by name

The most basic query is the name search, which will return a list of matching features:


            http://unlock.edina.ac.uk/ws/search?name=Edinburgh
            
			

Search for the name 'Edinburgh' from the OS gazatteer and format the results as XML.

http://unlock.edina.ac.uk/ws/search?name=Edinburgh&gazetteer=os&format=xml
			

Search for the names 'Edinburgh' & 'Glasgow' from the OS and GeoNames gazetteers and format the results as GeoJSON.

http://unlock.edina.ac.uk/ws/search?name=Edinburgh,Glasgow&gazetteer=os,%20geonames&format=json
			

Limit results to featureType

Search for the names 'Edinburgh' & 'Glasgow' with feature type 'cities' from the OS gazetteer and format the results as KML.

http://unlock.edina.ac.uk/ws/search?name=Edinburgh,Glasgow&featureType=cities&gazetteer=os&format=kml
			

Search for the name 'Edinburgh' with feature type 'farm' from the GeoNames gazetteer and format the results as GeoRSS.

http://unlock.edina.ac.uk/ws/search?name=Edinburgh&featureType=farm&gazetteer=geonames&format=georss
			

Q:Where are these feature types coming from?
A: You can see the whole list of supported feature types. They are a mix of feature type codes derived from the Alexandria Digital Gazetteer, enhanced to fit Ordnance Survey data sources, and also geonames.org feature types.

Feature types seem most useful when you've already found a feature and want to find other ones like it.

Search for a postcode

Search for the post code 'EH9 1PR' from the Unlock gazetteer and format the results as Comma-separated Text.

http://unlock.edina.ac.uk/ws/search?name=EH91PR&format=txt
			

Search within a bounding box

You can use an arbitrary bounding box (top left and bottom right coordinates) to limit the results of searches to places found within the box.

Search for the name 'Craiglockhart' within Edinburgh's bounding box, from the OS gazetteer and format the results as XML.

http://unlock.edina.ac.uk/ws/search?name=Craiglockhart&minx=-3.35081&miny=55.87272&maxx=-2.01274&maxy=55.99475&operator=within&gazetteer=os
			

Search for the names 'Portobello' & 'Musselburgh' within Edinburgh's bounding box, from geoname.org gazetteer and format the results as JSON.

http://unlock.edina.ac.uk/ws/search?name=Portobello,Musselburgh&minx=-3.35081&miny=55.87272&maxx=-2.01274&maxy=55.99475&format=json&operator=within&gazetteer=geonames
			

Search for the name 'Craiglockhart' intersecting Edinburgh's bounding box, from the OS gazetteer and format the results as KML.

http://unlock.edina.ac.uk/ws/search?name=Craiglockhart&minx=-3.35081&miny=55.87272&maxx=-3.01274&maxy=55.99475&operator=intersect&format=kml&gazetteer=os
			

footprintLookup Web Service

Retrieve the footprint for Edinburgh (identifer 9656) from the OS gazetteer and format the results as GeoRSS.

http://unlock.edina.ac.uk/ws/footprintLookup?identifier=9656&gazetteer=os&format=georss
			

Retrieve the footprints (points) for Edinburgh & Glasgow, from the GeoNames gazetteer and format the results as GeoJSON.

http://unlock.edina.ac.uk/ws/footprintLookup?identifier=5823266,5823268&gazetteer=geonames&format=json
			

supportedFeatureTypes Web Service

Note: The supportedFeatureTypes web service only accepts xml, json and txt format parameters.

http://unlock.edina.ac.uk/ws/supportedFeatureTypes?&gazetteer=os,geonames&format=xml
			

featureLookup Web Service

Search for feature number 9656 (Edinburgh) from Ordnance Survey gazetteer and format the results as Comma-separated Text.

http://unlock.edina.ac.uk/ws/featureLookup?id=9656&gazetteer=os&format=txt
			

closestMatchSearch Web Service

Search for the closest match for 'Edinburgh' from the GeoNames gazetteer and format the results as GeoJSON.

http://unlock.edina.ac.uk/ws/closestMatchSearch?name=Edinburgh&gazetteer=geonames&format=json