Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dirty hack for enabling the usage of mongoDB Index2d
If one type contains properties named lon and lat, reorder properties to have these two at the top. For performing filtering on geo coordinates in Documents of the mongoDB (e.g. operation geoWithin), the Json document containing the coordinates must have the longitude/X coordinate as first property and the latitude/Y coordinate as second property (property names are irrelevant!). But as JsonSlurper reorders the properties in alphabetic sequence, we can not force the necessary longitude / latitude sequence by defining it in the model json. Therefore this code tests for the existence of the properties lon and lat. If both are present, then the properties are reordered so that lon and lat come first!
- Loading branch information