Package org.openstreetmap.osmosis.plugin.elasticsearch.model.shape

Examples of org.openstreetmap.osmosis.plugin.elasticsearch.model.shape.ESLocation


    return ESShapeType.POINT;
  }

  @Override
  public ESLocation getCentroid() {
    return new ESLocation(latitude, longitude);
  }
View Full Code Here


  public String toJson() {
    XContentBuilder builder = null;
    try {
      builder = jsonBuilder();
      builder.startObject();
      ESLocation centroid = shape.getCentroid();
      builder.field("centroid", new double[] { centroid.getLongitude(), centroid.getLatitude() });
      builder.field("lengthKm", shape.getLengthKm());
      builder.field("areaKm2", shape.getAreaKm2());
      builder.startObject("shape");
      builder.field("type", shape.isClosed() ? "polygon" : "linestring");
      builder.startArray("coordinates");
View Full Code Here

          builder.addLocation(location.get(1), location.get(0));
        }
      }

      List<Double> centroid = (List<Double>) response.getField("centroid").getValue();
      builder.shapeBuilder.setCentroid(new ESLocation(centroid.get(1), centroid.get(0)));
      Double length = (Double) response.getField("lengthKm").getValue();
      builder.shapeBuilder.setLength(length);
      Double area = (Double) response.getField("areaKm2").getValue();
      builder.shapeBuilder.setArea(area);
View Full Code Here

TOP

Related Classes of org.openstreetmap.osmosis.plugin.elasticsearch.model.shape.ESLocation

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.