This query does not work well for some categories because of the recursive pattern. Furthermore, there is really no reason for not getting all possible points in a bounding box. For example, Prague has ~35000 items with location. So, the amount of transferred data is comparatively small.
Another interesting observation is that order of statements in SPARQL matters (at least for WDQS). A good idea here is to place wikibase:box before more general matchers.
This query does not work well for some categories because of the recursive pattern. Furthermore, there is really no reason for not getting all possible points in a bounding box. For example, Prague has ~35000 items with location. So, the amount of transferred data is comparatively small.
https://github.com/zhukovdm/smartwalk/blob/94fe28783a554c38792add14c2e1e2e57b8b4b24/data/wikidata-create/src/fetch.ts#L25-L46