odedahay / geomodel

Automatically exported from code.google.com/p/geomodel
0 stars 0 forks source link

Async returns max_results, but not centered around query location. #35

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use async branch to search a large database, using large max distance.

What is the expected output? What do you see instead?
max_results results are returned, but they are not clustered around the search 
location. They may be offset towards one compass quadrant (NE, SE, SW, NW)

What version of the product are you using? On what operating system?
Async branch, patched for issues 13, 16, 23, 33.

Please provide any additional information below.
This behaviour is caused by over optimisation. max_results are found and 
returned before searching adjacents geocells of equal resolution for closer 
results.

Eliminate this behaviour by changing geomodel.py from:

if len(results) >= max_results:
        if DEBUG:
          logging.debug(('GeoModel Proximity Query: '
                         'Wanted %d results, ending search') %
                        (max_results,))
        break

to:
if len(results) >= max_results and len(cur_geocells) == 4:
        if DEBUG:
          logging.debug(('GeoModel Proximity Query: '
                         'Wanted %d results, ending search') %
                        (max_results,))
        break

Original issue reported on code.google.com by john.david.toy@gmail.com on 5 Nov 2012 at 12:45

GoogleCodeExporter commented 8 years ago
Also, patched asynctools using 
http://code.google.com/p/asynctools/issues/detail?id=14

Original comment by john.david.toy@gmail.com on 5 Nov 2012 at 12:50