bestBboxSearchCells doesn't return (and runs out heap)

30 views
Skip to first unread message

Jeff Schnitzer

unread,
Jun 23, 2011, 4:38:32 PM6/23/11
to javageomod...@googlegroups.com
Hi all.  I'm just getting started with geohashing.  Is there any good explanation for what the cost function does and how it impacts the system?

I'm trying to do a bounding box query on appengine.  This works:

BoundingBox bb = new BoundingBox(38.912056, -118.40747, 35.263195, -123.88965);

List<String> cells = GeocellManager.bestBboxSearchCells(bb, null);

System.out.println("Cells are: " + cells);


But this just hangs, and eventually produces an OOM:


BoundingBox bb = new BoundingBox(38.912056, -118.40747, 35.263195, -123.88965);

List<String> cells = GeocellManager.bestBboxSearchCells(bb, new CostFunction() {

@Override

public double defaultCostFunction(int numCells, int resolution)

{

// Here we ensure that we do not try to query more than 30 cells, the limit of a gae IN filter

return numCells > 30 ? Double.MAX_VALUE : 0;

}

});

System.out.println("Cells are: " + cells);


Since I am using this in an IN filter to select out items in the box, is this not a good choice for the cost function?  If so, why am I getting an endless loop?  Am I likely to see this same problem in other situations?


Thanks,

Jeff

Alexandre Gellibert

unread,
Jul 15, 2011, 11:16:09 AM7/15/11
to javageomodel-discuss
Issue fixed in the 0.0.8 version.
Reply all
Reply to author
Forward
0 new messages