This is the sample application for the blog article Geospatial indexing for IBM Notes/Domino data that describes the demonstrated technique in detail.

The project “Mindoo Geohash Demo” shows how to work with geospatial data in HCL Notes/Domino, in order to efficiently find locations nearby given coordinates in the database.

The sample database can be used to store and search real-world locations. A location document consists of a name, a type (e.g. “Restaurant” or “Supermarket”), address information with street/zip/city/country and a field for other custom data.

When entered via the web interface, we use the Google Geocoding API to retrieve geo coordinates (latitude/longitude) for the address.

These coordinates are stored alongside the other location data in the database.

Location documents can also be created via a REST API call.

The database provides search functionality via web UI and REST API to quickly find the nearest locations for a given point (either entered as address or latitude/longitude pair), sorted in ascending distance.

For effiency reasons, we do not scan through the whole dataset to find locations nearby, but use so called Geohashes to precompute the relevant location document subset in the lookup Notes View that needs to be scanned.

This is similar to how other NoSQL databases like MongoDB implement geospatial indexing.

To get started, simply sign the database, copy it to your HCL Domino R9+ server and open it in a browser.

The database contains a sample dataset (all Starbucks stores in New York and Berlin, all Apple Stores in Germany) as a starting point, but this data can be deleted to start from scratch.

To search for locations, enter an address (e.g. “Brandenburger Tor, Berlin, Germany”) and the maximum distance in meters (e.g. 1000) in the search form and click the search button.

You can further restrict the result set by specifying a location type (e.g. “Coffee”). Just select a type and leave the address field empty to see all locations with that type in the database.

For a visual representation of the search results, select up to 25 rows in the result list and they will get displayed via the Google Maps API.

For a deeper understanding how Geohashes work, use the Geohash Demonstrator to find the surrounding geohashes for an address.