Skip to content
Browse files

Search list should include self

  • Loading branch information...
1 parent 45c9cd0 commit 6422e85e3ebfd454cb49991d430aac9ac4b62319 David Troy committed May 30, 2008
Showing with 3 additions and 3 deletions.
  1. +2 −2 README
  2. +1 −1 geohash-demo.js
View
4 README
@@ -28,8 +28,8 @@ However, 'dqcjqcp84c6e' is not centered inside 'dqcjqc', and searching within 'd
So instead, we can use the mathematical properties of the Geohash to quickly calculate the neighbors of 'dqcjqc'; we find that they are:
'dqcjqf','dqcjqb','dqcjr1','dqcjq9','dqcjqd','dqcjr4','dqcjr0','dqcjq8'
-This gives us a bounding box around 'dqcjqcp84c6e' roughly 2km x 1.5km and allows for a database search on fewer than 9 keys:
-SELECT * FROM table WHERE LEFT(geohash,6) IN ('dqcjqf','dqcjqb','dqcjr1','dqcjq9','dqcjqd','dqcjr4','dqcjr0','dqcjq8');
+This gives us a bounding box around 'dqcjqcp84c6e' roughly 2km x 1.5km and allows for a database search on just 9 keys:
+SELECT * FROM table WHERE LEFT(geohash,6) IN ('dqcjqc', 'dqcjqf','dqcjqb','dqcjr1','dqcjq9','dqcjqd','dqcjr4','dqcjr0','dqcjq8');
MORE INFORMATION
GeoHash on Wikipedia (http://en.wikipedia.org/wiki/Geohash)
View
2 geohash-demo.js
@@ -130,7 +130,7 @@ function plotGeoHash (gLatLng) {
for (var n in geoHashBox.neighbors) {
boxes.push("'"+geoHashBox.neighbors[n].geohash+"'");
}
- boxList.innerHTML += boxes.join(',') + ")";
+ boxList.innerHTML += boxes.join(',') + geoHashBox.geohash + ")";
searchInfo = document.getElementById("searchInfo");
var xdistance = geoHashBox.neighbors.topleft.corners.topleft.distanceFrom(geoHashBox.neighbors.topright.corners.topright);

0 comments on commit 6422e85

Please sign in to comment.
Something went wrong with that request. Please try again.