org.elasticsearch.common.geo
Class ShapeBuilder

java.lang.Object
  extended by org.elasticsearch.common.geo.ShapeBuilder

public class ShapeBuilder
extends Object

Utility class for building Shape instances like Point, Rectangle and Polygons.


Nested Class Summary
static class ShapeBuilder.PolygonBuilder
          Builder for creating a Shape instance of a Polygon
static class ShapeBuilder.RectangleBuilder
          Builder for creating a Rectangle instance
 
Method Summary
static com.spatial4j.core.shape.Point newPoint(double lon, double lat)
          Creates a new Point
static ShapeBuilder.PolygonBuilder newPolygon()
          Creates a new ShapeBuilder.PolygonBuilder to build a Polygon
static ShapeBuilder.RectangleBuilder newRectangle()
          Creates a new ShapeBuilder.RectangleBuilder to build a Rectangle
static com.vividsolutions.jts.geom.Geometry toJTSGeometry(com.spatial4j.core.shape.Shape shape)
          Converts the given Shape into the JTS Geometry representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newPoint

public static com.spatial4j.core.shape.Point newPoint(double lon,
                                                      double lat)
Creates a new Point

Parameters:
lon - Longitude of point
lat - Latitude of point
Returns:
Point with the latitude and longitude

newRectangle

public static ShapeBuilder.RectangleBuilder newRectangle()
Creates a new ShapeBuilder.RectangleBuilder to build a Rectangle

Returns:
RectangleBuilder instance

newPolygon

public static ShapeBuilder.PolygonBuilder newPolygon()
Creates a new ShapeBuilder.PolygonBuilder to build a Polygon

Returns:
PolygonBuilder instance

toJTSGeometry

public static com.vividsolutions.jts.geom.Geometry toJTSGeometry(com.spatial4j.core.shape.Shape shape)
Converts the given Shape into the JTS Geometry representation. If the Shape already uses a Geometry, that is returned.

Parameters:
shape - Shape to convert
Returns:
Geometry representation of the Shape


Copyright © 2009-2012. All Rights Reserved.