|
|
| | Ask HN: Performance optimizations for Geospatial applications | | 1 point by alanz1223 on Aug 27, 2016 | hide | past | favorite | 3 comments | | I am in the process of creating a mobile app that consumes geospatial data intensively. I am displaying a map of points of interest and upon user interaction (pinching, panning) with the map, I query the database for the new region. As you may infer this is very computationally expensive as I could potentially be making thousands of geospatial queries per minute. My current DB is RethinkDB, however as explained in Uber's tech stack article they use Redis for caching geospatial data. Does anyone have any insight into how to accomplish this? Are there any alternatives you recommend? Thanks |
|

Consider applying for YC's Summer 2026 batch! Applications are open till May 4
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
|
Often with geodata, people viewing a map of the whole country are interested in a different subset of the data than people viewing a small local area. For instance, when I view Texas I don't need the database to tell me where every street is - only the major rivers and highways. This is called layering. Consider 3-5 zoom levels and filter out the data that your user is going to care about at each, then in your indexing / storage scheme make it easy for the database to filter down to an appropriate dataset for the zoom level.
Also, fetch an area 4 times too big from the server and cache it so as they pan around in the local area you don't have to keep querying.
If you are rendering maps on the server side, and hand rolling that, consider using WMTS rather than WMS to serve your raster maps. WMTS tiles can be cached much more effectively than WMS tiles.
Just because something can be a spatial query doesn't mean it has to be. Spatial queries are relatively heavy. If your users are mostly operating inside one country, feel free to segment your data by country and only query the database for data for the countries on the screen - much lighter than applying a bounding box to a bunch of polygons.