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

Examples of org.geomajas.gwt.client.spatial.geometry.Polygon


      tempLineEnd = new GfxGeometry("LineStringEditController.updateLineEnd");
      tempLineEnd.setStyle(new ShapeStyle("#FF3322", 0.5f, "#FF3322", 1, 1));

      linearRing = geometry.getGeometryFactory().createLinearRing(srCoords);
      Polygon polygon = geometry.getGeometryFactory().createPolygon(linearRing, null);

      if (geometry.isValid()) {
        tempLineEnd.setStyle(drawStyleGood);
      } else {
        tempLineEnd.setStyle(drawStyleBad);
View Full Code Here


  private void updateTempLine(MouseEvent<?> event) {
    if (tempLine1 == null) {
      createTempLine();
    }

    Polygon polygon = (Polygon) geometry;

    if (polygon != null && polygon.getCoordinates() != null && polygon.getCoordinates().length > 0) {

      LinearRing ring = geometry.getGeometryFactory().createLinearRing(polygon.getCoordinates());
      if (ring != null && geometry.getCoordinates().length > 0) {

        Coordinate[] coordinates = ring.getCoordinates();
        Coordinate firstCoordinate = coordinates[0];
        Coordinate lastCoordinate = coordinates[coordinates.length - 2];
View Full Code Here

            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);
      }
    });
    button3.setWidth100();
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);

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

    if (geometry instanceof MultiPolygon) {
      if (geometryIndex >= 0 && geometryIndex < geometry.getNumGeometries()) {
        return getLinearRing(geometry.getGeometryN(geometryIndex));
      }
    } else if (geometry instanceof Polygon) {
      Polygon polygon = (Polygon) geometry;
      if (exteriorRing) {
        return polygon.getExteriorRing();
      } else if (interiorRingIndex >= 0 && interiorRingIndex < polygon.getNumInteriorRing()) {
        return polygon.getInteriorRingN(interiorRingIndex);
      }
    }
    return null;
  }
View Full Code Here

  protected void updateTempLines(FeatureTransaction featureTransaction, MouseEvent<?> event) {
    if (featureTransaction.getNewFeatures() != null && featureTransaction.getNewFeatures().length > 0) {
      if (tempLine1 == null) {
        createTempLines(featureTransaction, event);
      }
      Polygon polygon = (Polygon) getGeometryIndex().getGeometry(featureTransaction);
      LinearRing ring = getGeometryIndex().getLinearRing(polygon);
      if (ring != null) {
        Coordinate[] coordinates = ring.getCoordinates();
        if (coordinates != null && coordinates.length > 0) {
          Coordinate lastCoordinate = coordinates[coordinates.length - 2];
View Full Code Here

    currentBounds = mapModel.getMapView().getBounds();
    if (serverLayerIds == null) {
      init();
    }

    Polygon polygon = mapModel.getGeometryFactory().createPolygon(currentBounds);
    GwtCommand commandRequest = new GwtCommand(SearchByLocationRequest.COMMAND);
    SearchByLocationRequest request = new SearchByLocationRequest();
    request.setLayerIds(serverLayerIds);
    addFilters(request);
    request.setFeatureIncludes(GeomajasConstant.FEATURE_INCLUDE_GEOMETRY);
View Full Code Here

      if (layer.isShowing() && layer instanceof VectorLayer) {
        request.setFilter(layer.getServerLayerId(), ((VectorLayer) layer).getFilter());
      }
    }

    Polygon polygon = mapWidget.getMapModel().getGeometryFactory().createPolygon(selectedArea);
    request.setLocation(GeometryConverter.toDto(polygon));
    request.setCrs(mapWidget.getMapModel().getCrs());
    request.setQueryType(SearchByLocationRequest.QUERY_INTERSECTS);
    request.setRatio(coverageRatio);
    request.setSearchType(SearchByLocationRequest.SEARCH_ALL_LAYERS);
View Full Code Here

          return true;
        }
      }
      return false;
    } else if (geometry instanceof Polygon) {
      Polygon polygon = (Polygon) geometry;
      if (touchesLineString(polygon.getExteriorRing(), coordinate)) {
        return true;
      }
      for (int n = 0; n < polygon.getNumInteriorRing(); n++) {
        if (touchesLineString(polygon.getInteriorRingN(n), coordinate)) {
          return true;
        }
      }
      return false;
    } else if (geometry instanceof MultiLineString) {
View Full Code Here

        if (isWithin(geometry.getGeometryN(i), coordinate)) {
          return true;
        }
      }
    } else if (geometry instanceof Polygon) {
      Polygon polygon = (Polygon) geometry;
      if (isWithinRing(polygon.getExteriorRing(), coordinate)) {
        for (int i = 0; i < polygon.getNumInteriorRing(); i++) {
          if (isWithinRing(polygon.getInteriorRingN(i), coordinate)) {
            return false;
          }
        }
        return true;
      }
View Full Code Here

TOP

Related Classes of org.geomajas.gwt.client.spatial.geometry.Polygon

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.