Package org.springframework.data.geo

Examples of org.springframework.data.geo.Point


   * @see DATAMONGO-858
   */
  @Test
  public void convertsBoxToDbObjectAndBackCorrectly() {

    Box box = new Box(new Point(1, 2), new Point(3, 4));

    DBObject dbo = GeoConverters.BoxToDbObjectConverter.INSTANCE.convert(box);
    Shape shape = GeoConverters.DbObjectToBoxConverter.INSTANCE.convert(dbo);

    assertThat(shape, is((org.springframework.data.geo.Shape) box));
View Full Code Here


   * @see DATAMONGO-858
   */
  @Test
  public void convertsCircleToDbObjectAndBackCorrectly() {

    Circle circle = new Circle(new Point(1, 2), 3);

    DBObject dbo = GeoConverters.CircleToDbObjectConverter.INSTANCE.convert(circle);
    Shape shape = GeoConverters.DbObjectToCircleConverter.INSTANCE.convert(dbo);

    assertThat(shape, is((org.springframework.data.geo.Shape) circle));
View Full Code Here

   * @see DATAMONGO-858
   */
  @Test
  public void convertsPolygonToDbObjectAndBackCorrectly() {

    Polygon polygon = new Polygon(new Point(1, 2), new Point(2, 3), new Point(3, 4), new Point(5, 6));

    DBObject dbo = GeoConverters.PolygonToDbObjectConverter.INSTANCE.convert(polygon);
    Shape shape = GeoConverters.DbObjectToPolygonConverter.INSTANCE.convert(dbo);

    assertThat(shape, is((org.springframework.data.geo.Shape) polygon));
View Full Code Here

   * @see DATAMONGO-858
   */
  @Test
  public void convertsSphereToDbObjectAndBackCorrectly() {

    Sphere sphere = new Sphere(new Point(1, 2), 3);

    DBObject dbo = GeoConverters.SphereToDbObjectConverter.INSTANCE.convert(sphere);
    org.springframework.data.geo.Shape shape = GeoConverters.DbObjectToSphereConverter.INSTANCE.convert(dbo);

    assertThat(shape, is((org.springframework.data.geo.Shape) sphere));
View Full Code Here

   * @see DATAMONGO-858
   */
  @Test
  public void convertsPointToListAndBackCorrectly() {

    Point point = new Point(1, 2);

    DBObject dbo = GeoConverters.PointToDbObjectConverter.INSTANCE.convert(point);
    org.springframework.data.geo.Point converted = GeoConverters.DbObjectToPointConverter.INSTANCE.convert(dbo);

    assertThat(converted, is((org.springframework.data.geo.Point) point));
View Full Code Here

   * @param y
   * @param metric
   * @return
   */
  public static NearQuery near(double x, double y, Metric metric) {
    return near(new Point(x, y), metric);
  }
View Full Code Here

   */
  @Test
  public void shouldWriteEntityWithGeoBoxCorrectly() {

    ClassWithGeoBox object = new ClassWithGeoBox();
    object.box = new Box(new Point(1, 2), new Point(3, 4));

    DBObject dbo = new BasicDBObject();
    converter.write(object, dbo);

    assertThat(dbo, is(notNullValue()));
View Full Code Here

   */
  @Test
  public void shouldReadEntityWithGeoBoxCorrectly() {

    ClassWithGeoBox object = new ClassWithGeoBox();
    object.box = new Box(new Point(1, 2), new Point(3, 4));

    DBObject dbo = new BasicDBObject();
    converter.write(object, dbo);

    ClassWithGeoBox result = converter.read(ClassWithGeoBox.class, dbo);
View Full Code Here

   */
  @Test
  public void shouldWriteEntityWithGeoPolygonCorrectly() {

    ClassWithGeoPolygon object = new ClassWithGeoPolygon();
    object.polygon = new Polygon(new Point(1, 2), new Point(3, 4), new Point(4, 5));

    DBObject dbo = new BasicDBObject();
    converter.write(object, dbo);

    assertThat(dbo, is(notNullValue()));
View Full Code Here

   */
  @Test
  public void shouldReadEntityWithGeoPolygonCorrectly() {

    ClassWithGeoPolygon object = new ClassWithGeoPolygon();
    object.polygon = new Polygon(new Point(1, 2), new Point(3, 4), new Point(4, 5));

    DBObject dbo = new BasicDBObject();
    converter.write(object, dbo);

    ClassWithGeoPolygon result = converter.read(ClassWithGeoPolygon.class, dbo);
View Full Code Here

TOP

Related Classes of org.springframework.data.geo.Point

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.