Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ This file documents any relevant changes done to ViUR server since version 2.

## [develop] - Current development version

### Fixed
- spatialGuaranteedCorrectness of bones/spatial on very sparse maps ([#167](https://github.com/viur-framework/server/pull/167))



## [2.4.0] Agung - 2019-05-17

Expand Down
15 changes: 8 additions & 7 deletions bones/spatialBone.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,15 @@ def customMultiQueryMerge(self, name, lat, lng, dbFilter, result, targetAmount):
# If a result further away than this distance there might be missing results before that result
# If there are no results in a give lane (f.e. because we are close the border and there is no point
# in between) we choose a arbitrary large value for that lower bound
expectedAmount = self.calculateInternalMultiQueryAmount(targetAmount) # How many items we expect in each direction
limits = [
haversine(latRight[-1][name+".lat.val"], lng, lat, lng) if latRight else 2^31, # Lat - Right Side
haversine(latLeft[-1][name+".lat.val"], lng, lat, lng) if latLeft else 2^31, # Lat - Left Side
haversine(lat, lngBottom[-1][name+".lng.val"], lat, lng) if lngBottom else 2^31, # Lng - Bottom
haversine(lat, lngTop[-1][name+".lng.val"], lat, lng) if lngTop else 2^31, # Lng - Top
haversine(lat+gridSizeLat,lng,lat,lng),
haversine(lat,lng+gridSizeLng,lat,lng)
]
haversine(latRight[-1][name + ".lat.val"], lng, lat, lng) if latRight and len(latRight) == expectedAmount else 2 ** 31, # Lat - Right Side
haversine(latLeft[-1][name + ".lat.val"], lng, lat, lng) if latLeft and len(latLeft) == expectedAmount else 2 ** 31, # Lat - Left Side
haversine(lat, lngBottom[-1][name + ".lng.val"], lat, lng) if lngBottom and len(lngBottom) == expectedAmount else 2 ** 31, # Lng - Bottom
haversine(lat, lngTop[-1][name + ".lng.val"], lat, lng) if lngTop and len(lngTop) == expectedAmount else 2 ** 31, # Lng - Top
haversine(lat + gridSizeLat, lng, lat, lng),
haversine(lat, lng + gridSizeLng, lat, lng)
]
dbFilter.customQueryInfo["spatialGuaranteedCorrectness"] = min(limits)
logging.debug("SpatialGuaranteedCorrectness: %s", dbFilter.customQueryInfo["spatialGuaranteedCorrectness"])
# Filter duplicates
Expand Down