Examples of BoundingBoxGeoHashIterator


Examples of ch.hsr.geohash.util.BoundingBoxGeoHashIterator

    assertEquals(steps, 0);

    steps = GeoHash.stepsBetween(bl, bl.next(4));
    assertEquals(steps, 4);

    BoundingBoxGeoHashIterator iter = new BoundingBoxGeoHashIterator(new TwoGeoHashBoundingBox(bl, ur));
    int count = 0;
    while (iter.hasNext()) {
      iter.next();
      count++;
    }
    assertEquals(12875, count);

    int allHashes = 0;
    int inBbox = 1;
    int latMore = 0;
    int lonMore = 0;
    int bothMore = 0;
    int latLess = 0;
    int lonLess = 0;
    int bothLess = 0;
    int latLessLonMore = 0;
    int latMoreLonLess = 0;
    GeoHash idx = bl;
    BoundingBox iterBbox = iter.getBoundingBox().getBoundingBox();
    while (idx.compareTo(ur) < 0) {
      idx = idx.next();
      allHashes++;
      if (iterBbox.contains(idx.getPoint())) {
        inBbox++;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.