Split Nearby into a fast query for coordinates + a details query for each pin
See original GitHub issueNearby is too slow to use in Paris:
- Be in the center of Paris (or use a fake GPS app to pretend)
- Open Nearby
- Spinning forever, never finishes
I suggest splitting the current big SPARQL requests into:
- a first simple request that only returns QID,coordinates pairs.
- for each pin, an asynchronous request that loads the place’s details: name, description, class, existence, etc.
I did some tests (both with 1km radius):
- Request currently performed by the app: Timeout after 60 seconds
- Simplified request: Returns all results in 11 seconds
Due to radius stepping, the request that fetches coordinates is often performed several times, making it even more important to fine-tune.
Fetching details afterwards means that some pins will disappear when Exists
is enabled, but I don’t think it is problematic as it is disabled by default, users who willingly enabled it will understand why the pins disappear.
Latest master.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:18 (15 by maintainers)
Top Results From Across the Web
mysql - Find nearest latitude/longitude with an SQL query
It calculates the distance based on the latitude/longitude of that row and the target latitude/longitude, and then asks for only rows where the...
Read more >Nearby Search | Places API - Google Developers
Returns only those places that are open for business at the time the query is sent. Places that do not specify opening hours...
Read more >Calculating Distance Between 2 Locations of Latitude ...
Calculate or Query Great Circle Distance Between Points of Latitude and Longitude Using The Haversine Formula (PHP, JavaScript, Java, Python, ...
Read more >Geo-distance query | Elasticsearch Guide [8.5] | Elastic
How to compute the distance. Can either be arc (default), or plane (faster, but inaccurate on long distances and close to the poles)....
Read more >Searching for a close numeric match on spatial coordinates
The smart and fast solution for this class of problems is an index-backed "nearest neighbor" search. For the record: if you want precise ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure, here is a query that gives everything, coordinates and details and whether it is a WLM monument:
Obviously it times out in crowded places. The example above took 30 seconds even with a tiny radius of 0.1.
Thanks for helping with the query @nicolas-raoul ! Pinging @ashishkumar468 instead, I don’t think the other username works. 😉