1

I’m developing a client application that displays real-time data on a map from various sources. I’m concerned about performance issues or potential crashes if there are too many resources being streamed at once. I’m considering creating a middleman service to filter the streaming data based on the bounding box (BBOX) that the user is currently viewing on the map. Can anyone suggest a technological solution or share an implementation approach for this scenario?

The primitive idea is to store the real-time data, and create a REST API that gets a bounding box and for all relevant resources he opens a process that will stream the data.

1 Answer 1

0

One way to reduce the number of points, that you need to visualize on a map, is to use geohashing which basically clusters the near-by points on a grid (not based on a radius!).

geohashing basics

The geohash calculates an at most 8 digit long hash from the latitude and longitude coordinates. If you drop the last digit then you got the enclosing box of the cell.

level 1 and 2

level 2 and 3

The most precise hash has 19 meters error, the least precise hash has 2 500 kilometers error.

I highly recommend this website to get familiar with geohashing.

geohashing in action


We were using an npm package (ngeohash) while we were enriching the events via KStream.

We have visualized the clusters' health and size in Grafana. Here are some sample pictures:

The greener circle, the healthier cluster

cluster health

The bigger circle, the denser cluster

cluster size

2
  • Thank you for your detailed answer. One more thing I forgot to mention - the client is a unity application so I need a middleware that can get an HTTP post request, and send the relevant data to the unity client. Do you know any technologies that can integrate with unity applications? Commented Aug 28 at 9:33
  • @user25504668 The geohash calculation can be even on unity side! There are many nuget packages like geohash-dotnet, NGeoHash, etc. Commented Aug 28 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.