Package org.geomajas.gwt.client.spatial.geometry

Examples of org.geomajas.gwt.client.spatial.geometry.GeometryFactory.createLinearRing()


  public SnappingAlgorithmTest() {
    GeometryFactory factory = new GeometryFactory(4326, -1);
    LinearRing shell1 = factory.createLinearRing(new Coordinate[] {new Coordinate(10.0, 10.0),
        new Coordinate(20.0, 10.0), new Coordinate(20.0, 20.0), new Coordinate(10.0, 20.0),
        new Coordinate(10.0, 10.0)});
    LinearRing hole1 = factory.createLinearRing(new Coordinate[] {new Coordinate(12.0, 12.0),
        new Coordinate(18.0, 12.0), new Coordinate(18.0, 18.0), new Coordinate(12.0, 18.0),
        new Coordinate(12.0, 12.0)});
    geometries.add(factory.createPolygon(shell1, new LinearRing[] {hole1}));
    LinearRing shell2 = factory.createLinearRing(new Coordinate[] {new Coordinate(5.0, 5.0),
        new Coordinate(15.0, 5.0), new Coordinate(15.0, 25.0), new Coordinate(5.0, 25.0)});
View Full Code Here


        new Coordinate(10.0, 10.0)});
    LinearRing hole1 = factory.createLinearRing(new Coordinate[] {new Coordinate(12.0, 12.0),
        new Coordinate(18.0, 12.0), new Coordinate(18.0, 18.0), new Coordinate(12.0, 18.0),
        new Coordinate(12.0, 12.0)});
    geometries.add(factory.createPolygon(shell1, new LinearRing[] {hole1}));
    LinearRing shell2 = factory.createLinearRing(new Coordinate[] {new Coordinate(5.0, 5.0),
        new Coordinate(15.0, 5.0), new Coordinate(15.0, 25.0), new Coordinate(5.0, 25.0)});
    geometries.add(factory.createPolygon(shell2, null));
  }

  @Test
View Full Code Here

    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
Copyright © 2018 www.massapi.com. 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.