Unlock

Questions?

Project Blog

|

Contact Us envelope image

Example Queries


Places

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

You can use the Query Builder and Example Queries below to experiment with other queries to the Unlock gazetteer service.

Select an API and output format, then enter the search parameters (red fields indicate mandatory parameters). Results from the query will be displayed in a new window. Entering a key will also append the key parameter on to the example queries in the table below. Queries highlighted in red require a valid API key, as they access Ordnance Survey data.

Enter Key (optional)


Query Builder


(key required)

Note: Red fields are mandatory.

Example Queries

Links open in a new window. Queries highlighted in red require a valid API key (entered above).



Web Service Gazetteer(s) Operator XML KML GeoJSON GeoRSS TXT

1.

nameSearch OS XML KML GeoJSON GeoRSS TXT
Search for name 'Edinburgh' from OS gazetteer.

2.

nameSearch GeoNames XML KML GeoJSON GeoRSS TXT
Search for name 'Edinburgh' from GeoNames gazetteer.

3.

nameSearch OS, GeoNames XML KML GeoJSON GeoRSS TXT
Search for name 'Edinburgh' from OS & GeoNames gazetteers.

4.

nameSearch (with multiple names) OS XML KML GeoJSON GeoRSS TXT
Search for names 'Edinburgh' & 'Glasgow' from OS gazetteer.

5.

nameAndFeatureSearch OS XML KML GeoJSON GeoRSS TXT
Search for names 'Edinburgh' & 'Glasgow' with feature type 'cities' from OS gazetteer.

6.

nameAndFeatureSearch GeoNames XML KML GeoJSON GeoRSS TXT
Search for name 'Edinburgh' with feature type 'farm' from GeoNames gazetteer.

7.

nameAndFeatureSearch GeoNames XML KML GeoJSON GeoRSS TXT
Search for name 'Edinburgh' with feature type 'populated place' and restrict search to the United Kingdom, from GeoNames gazetteer.

8.

postCodeSearch OS XML KML GeoJSON GeoRSS TXT
Search for post code 'EH9 1PR' from OS gazetteer.

9.

spatialNameSearch OS within XML KML GeoJSON GeoRSS TXT
Search for the name 'Waverley' within Edinburgh's bounding box, from OS gazetteer.

10.

spatialNameSearch GeoNames within XML KML GeoJSON GeoRSS TXT
Search for the name 'Waverley' within Edinburgh's bounding box, from GeoNames gazetteer.

11.

spatialNameSearch (with multiple names) OS, GeoNames within XML KML GeoJSON GeoRSS TXT
Search for the names 'Portobello' & 'Musselburgh' within Edinburgh's bounding box, from the OS & GeoNames gazetteers.

12.

spatialNameSearch OS intersect XML KML GeoJSON GeoRSS TXT
Search for name 'Waverley' intersecting Edinburgh's bounding box, from the OS gazetteer.

13.

spatialFeatureSearch OS within XML KML GeoJSON GeoRSS TXT
Search for features with feature type 'sport' within Edinburgh's bounding box, from the OS gazetteer.

14.

spatialFeatureSearch GeoNames within XML KML GeoJSON GeoRSS TXT
Search for features with feature type 'hotel' within Edinburgh's bounding box, from the GeoNames gazetteer.

15.

spatialFeatureSearch (with multiple feature types) OS, GeoNames within XML KML GeoJSON GeoRSS TXT
Search for feature types 'hotel' & 'sport' within Edinburgh's bounding box, from the OS & GeoNames gazetteer.

16.

spatialFeatureSearch OS intersect XML KML GeoJSON GeoRSS TXT
Search for feature types 'educational' intersecting Edinburgh's bounding box, from the OS gazetteer.

17.

footprintLookup OS XML KML GeoJSON GeoRSS TXT
Retrieve the footprint for Edinburgh (identifer 9656) from the OS gazetteer.

18.

footprintLookup (with multiple identifiers) GeoNames XML KML GeoJSON GeoRSS TXT
Retrieve the footprints (points) for Edinburgh & Glasgow, from the GeoNames gazetteer.

19.

supportedFeatureTypes OS XML JSON TXT
Retrieve the supported feature types thesaurus from the OS gazetteer.

20.

supportedFeatureTypes GeoNames XML JSON TXT
Retrieve the supported feature types thesaurus from the GeoNames gazetteer.

21.

supportedFeatureTypes OS, GeoNames XML JSON TXT
Retrieve the supported feature types thesaurus from the OS & GeoNames gazetteers.

22.

featureLookup OS XML KML GeoJSON GeoRSS TXT
Search for feature number 9656 (Edinburgh) from Ordnance Survey gazetteer.

23.

featureLookup GeoNames XML KML GeoJSON GeoRSS TXT
Search for feature number 4574609 (Edinburgh) from GeoNames gazetteer.

24.

closestMatchSearch OS XML KML GeoJSON GeoRSS TXT
Search for the closest match for 'Edinburgh' from Ordnance Survey gazetteer.

25.

closestMatchSearch GeoNames XML KML GeoJSON GeoRSS TXT
Search for the closest match for 'Edinburgh from Geonames gazetteer.

26.

uniqueNameSearch OS XML KML GeoJSON GeoRSS TXT
Search for the name 'Edinburgh', returning a single result per feature, from Ordnance Survey gazetteer.

27.

uniqueNameSearch GeoNames XML KML GeoJSON GeoRSS TXT
Search for the name 'Edinburgh', returning a single result per feature, from GeoNames gazetteer.

banner logo and buttons - images © iStockphoto 2010