Package org.geomajas.geometry

Examples of org.geomajas.geometry.Geometry


  // -------------------------------------------------------------------------

  @Test
  public void emptyToDto() throws GeomajasException {
    // Test JTS Point to DTO:
    Geometry empty = converter.toDto(createEmpty());
    Assert.assertNull(empty);
  }
View Full Code Here


  }

  @Test
  public void jtsPointToDto() throws GeomajasException {
    // Test JTS Point to DTO:
    Geometry point = converter.toDto(createJtsPoint());
    Assert.assertEquals(jtsC1.x, point.getCoordinates()[0].getX());
  }
View Full Code Here

  }

  @Test
  public void jtsLineStringToDto() throws GeomajasException {
    // Test JTS LineString to DTO:
    Geometry lineString = converter.toDto(createJtsLineString());
    Assert.assertEquals(jtsC2.x, lineString.getCoordinates()[1].getX());
  }
View Full Code Here

  }

  @Test
  public void jtsLinearRingToDto() throws GeomajasException {
    // Test JTS LinearRing to DTO:
    Geometry linearRing = converter.toDto(createJtsLinearRing());
    Assert.assertEquals(jtsC4.x, linearRing.getCoordinates()[3].getX());
  }
View Full Code Here

  }

  @Test
  public void jtsPolygonToDto() throws GeomajasException {
    // Test JTS Polygon to DTO:
    Geometry polygon = converter.toDto(createJtsPolygon());
    Assert.assertEquals(jtsC6.x, polygon.getGeometries()[1].getCoordinates()[1].getX());
  }
View Full Code Here

  }

  @Test
  public void jtsMultiPointToDto() throws GeomajasException {
    // Test JTS MultiPoint to DTO:
    Geometry multiPoint = converter.toDto(createJtsMultiPoint());
    Assert.assertEquals(jtsC3.x, multiPoint.getGeometries()[2].getCoordinates()[0].getX());
  }
View Full Code Here

  }

  @Test
  public void jtsMultiLineStringToDto() throws GeomajasException {
    // Test JTS MultiLineString to DTO:
    Geometry multiLineString = converter.toDto(createJtsMultiLineString());
    Assert.assertEquals(jtsC7.x, multiLineString.getGeometries()[1].getCoordinates()[2].getX());
  }
View Full Code Here

  }

  @Test
  public void jtsMultiPolygonToDto() throws GeomajasException {
    // Test JTS MultiPolygon to DTO:
    Geometry multiPolygon = converter.toDto(createJtsMultiPolygon());
    Assert.assertEquals(jtsC7.x, multiPolygon.getGeometries()[1].getGeometries()[1].getCoordinates()[2].getX());
  }
View Full Code Here

  // -------------------------------------------------------------------------
  // Private methods for creating DTO geometries:
  // -------------------------------------------------------------------------
 
  private Geometry createDtoPoint() {
    Geometry geometry = new Geometry(Geometry.POINT, SRID, -1);
    geometry.setCoordinates(new Coordinate[] { dtoC1 });
    return geometry;
  }
View Full Code Here

    geometry.setCoordinates(new Coordinate[] { dtoC1 });
    return geometry;
  }

  private Geometry createDtoLineString() {
    Geometry geometry = new Geometry(Geometry.LINE_STRING, SRID, -1);
    geometry.setCoordinates(new Coordinate[] { dtoC1, dtoC2, dtoC3, dtoC4 });
    return geometry;
  }
View Full Code Here

TOP

Related Classes of org.geomajas.geometry.Geometry

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.