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

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


    button3.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group2);
        GeometryFactory factory = map.getMapModel().getGeometryFactory();
        LinearRing shell = factory.createLinearRing(new Coordinate[] { new Coordinate(110, 10),
            new Coordinate(210, 10), new Coordinate(210, 110), new Coordinate(110, 110),
            new Coordinate(110, 10) });
        LinearRing hole = factory.createLinearRing(new Coordinate[] { new Coordinate(140, 40),
            new Coordinate(170, 40), new Coordinate(170, 70), new Coordinate(140, 70),
            new Coordinate(140, 40) });
View Full Code Here


        map.getVectorContext().drawGroup(map.getGroup(RenderGroup.SCREEN), group2);
        GeometryFactory factory = map.getMapModel().getGeometryFactory();
        LinearRing shell = factory.createLinearRing(new Coordinate[] { new Coordinate(110, 10),
            new Coordinate(210, 10), new Coordinate(210, 110), new Coordinate(110, 110),
            new Coordinate(110, 10) });
        LinearRing hole = factory.createLinearRing(new Coordinate[] { new Coordinate(140, 40),
            new Coordinate(170, 40), new Coordinate(170, 70), new Coordinate(140, 70),
            new Coordinate(140, 40) });
        Polygon polygon = factory.createPolygon(shell, new LinearRing[] { hole });
        ShapeStyle style = new ShapeStyle("#9933EE", 0.5f, "#9900FF", 1, 2);
        map.getVectorContext().drawPolygon(group2, "Polygon", polygon, style);
View Full Code Here

    worldImage.setStyle(new PictureStyle(0.8));

    // And some geometries
    final GfxGeometry worldGeometry = new GfxGeometry("MultiPolygonInWorldSpace");
    final GeometryFactory gf = new GeometryFactory(map.getMapModel().getSrid(), map.getMapModel().getPrecision());
    Polygon p1 = gf.createPolygon(gf.createLinearRing(new Bbox(10000000d, 1000d, 1000000d, 1000000d)), null);
    Polygon p2 = gf.createPolygon(gf.createLinearRing(new Bbox(12000000d, 1000d, 500000d, 500000d)), null);
    MultiPolygon mp = gf.createMultiPolygon(new Polygon[] {p1, p2});
    worldGeometry.setStyle(new ShapeStyle("#FF0000", 0.5f, "#FF0000", 1.0f, 2));
    worldGeometry.setGeometry(mp);
View Full Code Here

    // And some geometries
    final GfxGeometry worldGeometry = new GfxGeometry("MultiPolygonInWorldSpace");
    final GeometryFactory gf = new GeometryFactory(map.getMapModel().getSrid(), map.getMapModel().getPrecision());
    Polygon p1 = gf.createPolygon(gf.createLinearRing(new Bbox(10000000d, 1000d, 1000000d, 1000000d)), null);
    Polygon p2 = gf.createPolygon(gf.createLinearRing(new Bbox(12000000d, 1000d, 500000d, 500000d)), null);
    MultiPolygon mp = gf.createMultiPolygon(new Polygon[] {p1, p2});
    worldGeometry.setStyle(new ShapeStyle("#FF0000", 0.5f, "#FF0000", 1.0f, 2));
    worldGeometry.setGeometry(mp);

    final GfxGeometry worldGeometry2 = new GfxGeometry("MultiPointInWorldSpace");
View Full Code Here

  // Constructor
  // -------------------------------------------------------------------------

  public RemoveRingOperationTest() {
    GeometryFactory gwtFactory = new GeometryFactory(SRID, PRECISION);
    LinearRing exteriorRing = gwtFactory.createLinearRing(new Coordinate[] {new Coordinate(0.0, 0.0),
        new Coordinate(20.0, 0.0), new Coordinate(20.0, 20.0), new Coordinate(0.0, 20.0)});
    LinearRing interiorRing1 = gwtFactory.createLinearRing(new Coordinate[] {new Coordinate(12.0, 12.0),
        new Coordinate(14.0, 12.0), new Coordinate(14.0, 18.0), new Coordinate(12.0, 18.0)});
    LinearRing interiorRing2 = gwtFactory.createLinearRing(new Coordinate[] {new Coordinate(16.0, 12.0),
        new Coordinate(18.0, 12.0), new Coordinate(18.0, 18.0), new Coordinate(16.0, 18.0)});
View Full Code Here

    String geometryType = geometry.getGeometryType();
    if (Geometry.POINT.equals(geometryType)) {
      gwt = factory.createPoint(geometry.getCoordinates()[0]);
    } else if (Geometry.LINEAR_RING.equals(geometryType)) {
      gwt = factory.createLinearRing(geometry.getCoordinates());
    } else if (Geometry.LINE_STRING.equals(geometryType)) {
      gwt = factory.createLineString(geometry.getCoordinates());
    } else if (Geometry.POLYGON.equals(geometryType)) {
      LinearRing exteriorRing = (LinearRing) toGwt(geometry.getGeometries()[0]);
      LinearRing[] interiorRings = new LinearRing[geometry.getGeometries().length - 1];
View Full Code Here

    mapWidget.setContextMenu(menu);

    if (maxBoundsDisplayed) {
      VectorLayer layer = getFeatureTransaction().getLayer();
      GeometryFactory factory = mapWidget.getMapModel().getGeometryFactory();
      LinearRing hole = factory.createLinearRing(new Bbox(layer.getLayerInfo().getMaxExtent()));
      LinearRing shell = factory.createLinearRing(mapWidget.getMapModel().getMapView().getMaxBounds());
      Polygon polygon = factory.createPolygon(shell, new LinearRing[] { hole });

      maxExtent = new GfxGeometry("maxExtent");
      maxExtent.setGeometry(polygon);
View Full Code Here

    if (maxBoundsDisplayed) {
      VectorLayer layer = getFeatureTransaction().getLayer();
      GeometryFactory factory = mapWidget.getMapModel().getGeometryFactory();
      LinearRing hole = factory.createLinearRing(new Bbox(layer.getLayerInfo().getMaxExtent()));
      LinearRing shell = factory.createLinearRing(mapWidget.getMapModel().getMapView().getMaxBounds());
      Polygon polygon = factory.createPolygon(shell, new LinearRing[] { hole });

      maxExtent = new GfxGeometry("maxExtent");
      maxExtent.setGeometry(polygon);
      maxExtent.setStyle(new ShapeStyle("#000000", .6f, "#990000", 1, 2));
View Full Code Here

  public RemoveRingOperationTest() {
    GeometryFactory gwtFactory = new GeometryFactory(SRID, PRECISION);
    LinearRing exteriorRing = gwtFactory.createLinearRing(new Coordinate[] {new Coordinate(0.0, 0.0),
        new Coordinate(20.0, 0.0), new Coordinate(20.0, 20.0), new Coordinate(0.0, 20.0)});
    LinearRing interiorRing1 = gwtFactory.createLinearRing(new Coordinate[] {new Coordinate(12.0, 12.0),
        new Coordinate(14.0, 12.0), new Coordinate(14.0, 18.0), new Coordinate(12.0, 18.0)});
    LinearRing interiorRing2 = gwtFactory.createLinearRing(new Coordinate[] {new Coordinate(16.0, 12.0),
        new Coordinate(18.0, 12.0), new Coordinate(18.0, 18.0), new Coordinate(16.0, 18.0)});

    polygon = gwtFactory.createPolygon(exteriorRing, new LinearRing[] {interiorRing1, interiorRing2});
View Full Code Here

    GeometryFactory gwtFactory = new GeometryFactory(SRID, PRECISION);
    LinearRing exteriorRing = gwtFactory.createLinearRing(new Coordinate[] {new Coordinate(0.0, 0.0),
        new Coordinate(20.0, 0.0), new Coordinate(20.0, 20.0), new Coordinate(0.0, 20.0)});
    LinearRing interiorRing1 = gwtFactory.createLinearRing(new Coordinate[] {new Coordinate(12.0, 12.0),
        new Coordinate(14.0, 12.0), new Coordinate(14.0, 18.0), new Coordinate(12.0, 18.0)});
    LinearRing interiorRing2 = gwtFactory.createLinearRing(new Coordinate[] {new Coordinate(16.0, 12.0),
        new Coordinate(18.0, 12.0), new Coordinate(18.0, 18.0), new Coordinate(16.0, 18.0)});

    polygon = gwtFactory.createPolygon(exteriorRing, new LinearRing[] {interiorRing1, interiorRing2});
  }
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.