Package org.elasticsearch.common.geo

Examples of org.elasticsearch.common.geo.GeoPoint


    assertThat("Cluster after adding Denver again", reducer.reduce(clusters), hasItems(
      new GeoCluster(2, DENVER, new GeoBoundingBox(DENVER))));

    clusters.add(new GeoCluster(SAN_DIEGO));
    assertThat("Cluster after adding San Diego", reducer.reduce(clusters), hasItems(
      new GeoCluster(3, new GeoPoint(37.4400, -108.9567), new GeoBoundingBox(DENVER).extend(SAN_DIEGO))));

    clusters.add(new GeoCluster(LAS_VEGAS));
    assertThat("Cluster after adding Las Vegas", reducer.reduce(clusters), hasItems(
      new GeoCluster(4, new GeoPoint(37.1000, -110.5100), new GeoBoundingBox(DENVER).extend(SAN_DIEGO).extend(LAS_VEGAS))));
  }
View Full Code Here


    return GeoDistance.ARC.calculate(from.getLat(), from.getLon(),
      to.getLat(), to.getLon(), unit);
  }

  public static GeoPoint readFrom(StreamInput in) throws IOException {
    return new GeoPoint(in.readDouble(), in.readDouble());
  }
View Full Code Here

    out.writeDouble(point.getLat());
    out.writeDouble(point.getLon());
  }

  public static GeoPoint copy(GeoPoint point) {
    return new GeoPoint(point.lat(), point.lon());
  }
View Full Code Here

TOP

Related Classes of org.elasticsearch.common.geo.GeoPoint

Copyright © 2018 www.massapicom. 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.