Examples of LinearRing


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

  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(60.0, r.getCoordinateN(0).getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(polygon.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here

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

    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(60.0, r.getCoordinateN(0).getX(), DELTA);
    op.undo(feature);
    Assert.assertEquals(multiPolygon.toWkt(), feature.getGeometry().toWkt());
  }
View Full Code Here

Examples of org.geomajas.puregwt.client.spatial.LinearRing

  }

  private Path toPath(Polygon polygon) {
    Path path = toPath(polygon.getExteriorRing());
    for (int i = 0; i < polygon.getNumInteriorRing(); i++) {
      LinearRing interiorRing = polygon.getInteriorRingN(i);
      path.moveTo((int) interiorRing.getCoordinate().getX(), (int) interiorRing.getCoordinate().getY());
      for (int j = 1; j < interiorRing.getNumPoints() - 1; j++) {
        Coordinate coordinate = interiorRing.getCoordinateN(j);
        path.lineTo((int) coordinate.getX(), (int) coordinate.getY());
      }
      path.close();
    }
    return path;
View Full Code Here

Examples of org.geomajas.puregwt.client.spatial.LinearRing

  private Path toPath(MultiPolygon multiPolygon) {
    Path path = toPath((Polygon) multiPolygon.getGeometryN(0));
    for (int g = 1; g < multiPolygon.getNumGeometries(); g++) {
      Polygon polygon = (Polygon) multiPolygon.getGeometryN(g);

      LinearRing exteriorRing = polygon.getExteriorRing();
      path.moveTo((int) exteriorRing.getCoordinate().getX(), (int) exteriorRing.getCoordinate().getY());
      for (int i = 1; i < exteriorRing.getNumPoints() - 1; i++) {
        Coordinate coordinate = exteriorRing.getCoordinateN(i);
        path.lineTo((int) coordinate.getX(), (int) coordinate.getY());
      }
      path.close();

      for (int i = 0; i < polygon.getNumInteriorRing(); i++) {
        LinearRing interiorRing = polygon.getInteriorRingN(i);
        path.moveTo((int) interiorRing.getCoordinate().getX(), (int) interiorRing.getCoordinate().getY());
        for (int j = 1; j < interiorRing.getNumPoints() - 1; j++) {
          Coordinate coordinate = interiorRing.getCoordinateN(j);
          path.lineTo((int) coordinate.getX(), (int) coordinate.getY());
        }
        path.close();
      }
    }
View Full Code Here

Examples of org.gwtopenmaps.openlayers.client.geometry.LinearRing

            double radius = storeBinder.getModel().getRadius();
            LonLat lonLat = LonLat.narrowToLonLat(destinationVincenty(center.lon(), center.lat(), angle, radius));
            lonLat.transform("EPSG:4326", map.getProjection());
            points[i] = new Point(lonLat.lon(), lonLat.lat());
        }
        LinearRing ring = new LinearRing(points);
        Polygon polygon = new Polygon(new LinearRing[] { ring });

        vectorLayer.addFeature(new VectorFeature(polygon));
        modifyControl.activate();
    }
View Full Code Here

Examples of org.postgis.LinearRing

   * @return The Polygon object.
   */
  public Polygon createPolygon(Point[] points) {
    Polygon result;
   
    result = new Polygon(new LinearRing[] {new LinearRing(points)});
    result.srid = 4326;
   
    return result;
  }
View Full Code Here

Examples of org.rometools.feed.module.georss.geometries.LinearRing

                if (linearRingElement != null) {
                    Element posListElement = linearRingElement.getChild("posList", GeoRSSModule.GML_NS);
                    if (posListElement != null) {
                        if (poly == null)
                            poly = new Polygon();
                        poly.setExterior(new LinearRing(parsePosList(posListElement)));
                    }
                }
            }
           
            // The internal rings (holes)
            List interiorElementList = polygonElement.getChildren("interior", GeoRSSModule.GML_NS);
            Iterator it = interiorElementList.iterator();
            while (it.hasNext()) {
                Element interiorElement = (Element)it.next();
                if (interiorElement != null) {
                    Element linearRingElement = interiorElement.getChild("LinearRing", GeoRSSModule.GML_NS);
                    if (linearRingElement != null) {
                        Element posListElement = linearRingElement.getChild("posList", GeoRSSModule.GML_NS);
                        if (posListElement != null) {
                            if (poly == null)
                                poly = new Polygon();
                            poly.getInterior().add(new LinearRing(parsePosList(posListElement)));
                        }
                    }
                }
               
            }
View Full Code Here

Examples of org.zkoss.openlayers.geometry.LinearRing

          point.getY() + (r * Math.sin(a)));
      point2List.add(newPoint1);
    }
    point2List.add(point2List.get(0));

    LinearRing linearRing = new LinearRing(point2List);
    List<LinearRing> ringList = new ArrayList<LinearRing>();
    ringList.add(linearRing);
    Vector polygonFeature = new Vector(new Polygon(ringList));

    map.addLayer(vectorLayer);
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.