Naughter Software Logo

CNominatim v1.05 A set of C++ classes to handle Nominatim queries

Nominatim is the search tool used by OpenStreetMap. For further information on Nominatim, please see http://wiki.openstreetmap.org/wiki/Nominatim. Nominatim is a web service provided by OpenStreetMap to convert addresses to locations on a map and the reverse also known as Geocoding which converts a lat / long point or specific OSM element to an address. It also allows lookup of specific OSM ids.

 

The classes provided are: Nominatim::CSearchQuery, Nominatim::CSearchPlace, Nominatim::CReverseGeocodingQuery, Nominatim::CReverseGeocodingQueryResult, Nominatim::CAddressLookupQuery, Nominatim::CLookupPlace & Nominatim::CNominatim. The three main methods provided are:

HRESULT Search(const CSearchQuery& query, CSearchPlaceArray& result, LPCTSTR pszServer = _T("nominatim.openstreetmap.org"), LPCTSTR pszURL = _T("search"))

The search method performs the address lookup query using the parameters specified in "query" and returns an array of results in "result" using the specified Nominatim server "sServer". The method returns a standard HRESULT code to indicate success or failure. When the CNOMINATIM_MFC_EXTENSIONS preprocessor value is not defined, std::vector is used instead of CArray for the "result" parameter.

 

HRESULT ReverseGeocoding(const CNominatimReverseGeocodingQuery& query, CNominatimReverseGeocodingQueryResult& result, LPCTSTR pszServer = _T("nominatim.openstreetmap.org"), LPCTSTR pszURL = _T("reverse"))

The ReverseGeocoding method performs the reverse geocoding query using the parameters specified in "query" and returns the result in "result" using the specified Nominatim server "sServer". The method returns a standard HRESULT code to indicate success or failure.

 

HRESULT AddressLookup(const CAddressLookupQuery& query, CLookupPlaceArray& result, LPCTSTR pszServer = _T("nominatim.openstreetmap.org"), LPCTSTR pszURL = _T("lookup"))

The AddressLookup method performs the address lookup query using the parameters specified in "query" and returns the result in "result" using the specified Nominatim server "sServer". The method returns a standard HRESULT code to indicate success or failure. When the CNOMINATIM_MFC_EXTENSIONS preprocessor value is not defined, std::vector is used instead of CArray for the "result" parameter.

 

 

Features

 

The enclosed zip file contains the CNominatim source code and a simple VC 2010 console application which demonstrates the classes using the sample as mentioned on the Nominatim wiki page.

 

Copyright

 

Updates

V1.05 (8 October 2017)

V1.04 (8 October 2017)

V1.03 (8 November 2015)

V1.02 (21 July 2013)

V1.01 (7 August 2011)

V1.0 (24 October 2010)