Introduction Implementation KVP encoding Parameter discussion

28 Copyright © 2014 Open Geospatial Consortium

8.5.1.1 Introduction

8.5.2 Nearest Neighbour

8.5.2.1 Introduction

A nearest neighbour search finds objects near a centre point and orders the features in the response according to the distance from that search point. Unlike a centre-point-radius search, a nearest neighbour search will always return a result – regardless of how far away from the centre point the closest object is – as long as the database is not empty.

8.5.2.2 Implementation

The nearest neighbor search relies on a spatial index being available in order to calculate distances to all locations in the supporting databases. This meant that the virtual global gazetteer would have to rely on the NGA WFS-G based on WFS 1.1 and the USGSNB WFS-G based on WFS 2.0. The testbed participants found that currently the Filter 2.0 standard prevents WFS 2.0 from being backwards compatible with WFS 1.1. This is discussed in the Testbed-10 CCI Profile Interoperability Engineering Report OGC 14- 021, clause 10. Consequently, the nearest neighbour algorithm was implemented on the client application.

8.5.2.3 KVP encoding

A stored query with the name “Nearest Neighbour By Location Type” and assigned the identifier “urn:cw:def:query:OGC-WFS::NearestNeighbours:ByLocationTypeName” can be implemented to provide the nearest neighbor capability on WFS-Gs supplying the virtual global gazetteer. The following table defines the parameters for this stored query: Parameter Name Expected Type Lat Number Lon Number srsName URI locationTypeName String Copyright © 2014 Open Geospatial Consortium 29 The following is an example invocation of the nearest neighbour stored query that returns the nearest objects of type “Mountain”: http:www.opengeospatial.orgserver?service=WFSversion=2.0request=GetFeature storedQuery_Id=urn:cw:def:query:OGC- WFS::NearestNeighbours:ByLocationTypeNamelocationTypeName=mountainlat=45 .288278lon=-66.062351srsName=urn:ogc:def:crs:EPSG::4326count=10

8.5.2.4 Parameter discussion

All parameters are mandatory.

8.5.3 Bounding-box search