Package org.geomajas.gwt.client.map.feature

Examples of org.geomajas.gwt.client.map.feature.Feature


    op = new InsertCoordinateOp(index, new Coordinate(50, 50));
  }

  @Test
  public void testLineString() {
    Feature feature = new Feature();
    feature.setGeometry((LineString) lineString.clone());
    op.execute(feature);
    LineString l = (LineString) feature.getGeometry();
    Assert.assertEquals(50.0, l.getCoordinateN(index.getCoordinateIndex()).getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(lineString.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here


    Assert.assertEquals(lineString.toWkt(), feature.getGeometry().toWkt());
  }

  @Test
  public void testMultiLineString() {
    Feature feature = new Feature();
    feature.setGeometry((MultiLineString) multiLineString.clone());
    op.execute(feature);
    MultiLineString m = (MultiLineString) feature.getGeometry();
    LineString l = (LineString) m.getGeometryN(index.getGeometryIndex());
    Assert.assertEquals(50.0, l.getCoordinateN(index.getCoordinateIndex()).getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(multiLineString.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here

    Assert.assertEquals(multiLineString.toWkt(), feature.getGeometry().toWkt());
  }

  @Test
  public void testPolygon() {
    Feature feature = new Feature();
    feature.setGeometry((Polygon) polygon.clone());
    op.execute(feature);
    Polygon p = (Polygon) feature.getGeometry();
    LinearRing r = p.getInteriorRingN(index.getInteriorRingIndex());
    Assert.assertEquals(50.0, r.getCoordinateN(index.getCoordinateIndex()).getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(polygon.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here

    Assert.assertEquals(polygon.toWkt(), feature.getGeometry().toWkt());
  }

  @Test
  public void testMultiPolygon() {
    Feature feature = new Feature();
    feature.setGeometry((MultiPolygon) multiPolygon.clone());
    op.execute(feature);
    MultiPolygon m = (MultiPolygon) feature.getGeometry();
    Polygon p = (Polygon) m.getGeometryN(index.getGeometryIndex());
    LinearRing r = p.getInteriorRingN(index.getInteriorRingIndex());
    Assert.assertEquals(50.0, r.getCoordinateN(index.getCoordinateIndex()).getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(multiPolygon.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here

    info.setLayers(layers);

    mapModel.initialize(info);
    mapModel.selectLayer(mapModel.getLayer("testLayer"));

    Feature feature = new Feature();
    GeometryFactory factory = new GeometryFactory(4326, -1);
    LinearRing invalidRing = factory.createLinearRing(new Coordinate[] {new Coordinate(10, 10),
        new Coordinate(20, 10), new Coordinate(15, 20)/*, new Coordinate(15, 5)*/});
    Polygon inValidPolygon = factory.createPolygon(invalidRing, null);
    feature.setGeometry(inValidPolygon);
    mapModel.getFeatureEditor().startEditing(new Feature[] {feature}, new Feature[] {feature});
  }
View Full Code Here

TOP

Related Classes of org.geomajas.gwt.client.map.feature.Feature

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.