Latitude and longitude values and information related to the location (such as place names) are registered in nsf as one document.
I want to get the document that is closest to the latitude / longitude obtained by NotesGPSCoodinates class.
The current code prepares a view that displays latitude and longitude in columns, repeats calculating the distance from the first view entry, and holds the document ID with the shortest distance calculated up to the last entry.
Since this code performs distance calculations on the caller side, I know that the more view entries, the more data communication and the less efficient.
In SQL, functions such as SQRT can be used to write expressions. For example, the following code:
SELECT SQRT (POWER ((35.690224 – lat) / 0.0111, 2) + POWER ((139.700089 – lng) / 0.0091, 2)) AS distance FROM geodata ORDER BY distance
If DQL has expressions and functions that can be used in a query like this, it will be possible to efficiently obtain information that is closest to the current location.
1. Domino is a NoSQL database, so SQL comparisons need to be made in distant analog.
2. DQL's direction for expression handling is to leverage all the work people have done in Formula Language. And to continue that work. The richness of the Formula Language library is competitive with any other expression language in the field.
3. Given 2, 'form'.field or 'view'.column references would be used in DQL to access the Formula Language code residing therein