Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.LineString


   */
  @Test
  public void testSzenario_003_withValidData_2() throws Exception {
    MultiPolygon splitee = (MultiPolygon) SplitTestUtil.read("MULTIPOLYGON (((2 3, 8 3, 8 6, 2 6, 2 3)))"); //$NON-NLS-1$

    LineString splitter = (LineString) SplitTestUtil.read("LINESTRING(2 3, 2 2, 5 2, 5 5)"); //$NON-NLS-1$
    assertTrue(splitee.isValid());

    List<Geometry> expectedParts = new ArrayList<Geometry>();

    SplitTestUtil.testSplitStrategy(splitee, splitter, expectedParts);
View Full Code Here


  public void testBuilder2Steps() throws Exception {

    Geometry inputGeometry1 = (Geometry) SplitTestUtil.read("POLYGON ((5 35, 35 35, 35 10, 5 10, 5 35))");
    Geometry inputGeometry2 = (Geometry) SplitTestUtil.read("POLYGON ((35 35, 50 35, 50 10, 35 10, 35 35))");

    LineString line = (LineString) SplitTestUtil.read("LINESTRING (0 25, 40 25)");

    Geometry partA = SplitTestUtil.read("POLYGON ((5 35, 5 25, 35 25, 35 35, 5 35))");

    Geometry partB = SplitTestUtil.read("POLYGON ((5 25, 35 25, 35 10, 5 10, 5 25))");
View Full Code Here

  public void testBuilder1Steps() throws Exception {

    Geometry inputGeometry1 = (Geometry) SplitTestUtil.read("POLYGON ((5 35, 35 35, 35 10, 5 10, 5 35))");
    Geometry inputGeometry2 = (Geometry) SplitTestUtil.read("POLYGON ((35 35, 50 35, 50 10, 35 10, 35 35))");

    LineString line = (LineString) SplitTestUtil.read("LINESTRING (0 25, 40 25)");

    Geometry partA = SplitTestUtil.read("POLYGON ((5 35, 5 25, 35 25, 35 35, 5 35))");

    Geometry partB = SplitTestUtil.read("POLYGON ((5 25, 35 25, 35 10, 5 10, 5 25))");
View Full Code Here

    return nCoords > 1;
  }

  public UndoableMapCommand getCommand(EditToolHandler handler) {
    final ILayer selectedLayer = handler.getContext().getSelectedLayer();
    LineString trimmingLineInLayerCrs;
    try {
      trimmingLineInLayerCrs = getTrimmingLineInLayerCrs(handler);
    } catch (OperationNotFoundException e) {
      throw (RuntimeException) new RuntimeException("Cannot reproject trim line from "
            + "layer's crs to map's crs").initCause(e);
View Full Code Here

   */
  private LineString getTrimmingLineInLayerCrs(EditToolHandler handler)
    throws OperationNotFoundException, TransformException {

    final PrimitiveShape currentShape = handler.getCurrentShape();
    final LineString line = GeometryCreationUtil.createGeom(LineString.class, currentShape, false);
    return line;
  }
View Full Code Here

            coords.add(new Coordinate(x, y));
            pathIterator.next();
        }

        Coordinate[] coordinates = coords.toArray(new Coordinate[coords.size()]);
        LineString line = gf.createLineString(coordinates);
        return line;
    }
View Full Code Here

    LOGGER.fine("splitLine parameter:" + splitLine.toText()); //$NON-NLS-1$
    LOGGER.fine(((CoordinateReferenceSystem) splitLine.getUserData())
        .toWKT());

    try {
      LineString splitReprojected = (LineString) GeoToolsUtils.reproject(
          splitLine,
          (CoordinateReferenceSystem) splitLine.getUserData(),
          desiredCRS);
      SplitFeatureBuilder sfb = new SplitFeatureBuilder();
      sfb.splitLine = splitReprojected;
View Full Code Here

   
          assert geomToSplit instanceof Polygon;
   
          final Polygon polygon = (Polygon) geomToSplit;
          final List<Geometry> splitPolygon;
          LineString splitLine = getSplitLine().getOriginalSplitLine();
          if (SplitUtil.isClosedLine(splitLine)) {
   
            splitPolygon = splitPolygonClosedLines(polygon);
          } else {
   
View Full Code Here

   *            Polygon that will suffer the split operation.
   * @return List with the resultant polygons.
   */
  private List<Geometry> splitPolygonClosedLines(final Polygon polygon) {

      LineString splitLine = getSplitLine().getOriginalSplitLine();

      RingExtractor ringExtractor = new RingExtractor(splitLine);
      ResultRingExtractor data = ringExtractor.processExtraction();
      SplitClosedLines closedLines = new SplitClosedLines(data);

View Full Code Here

            final Coordinate[] splitLine, final LinearRing ring ) {

        this.splitLineSegmentWithIntersectionList = new ArrayList<SplitLineSegmentIntersectionNode>();
        for( int i = 0; i < (splitLine.length - 1); i++ ) {

            LineString lineSegment = this.geomFactory.createLineString(
                    new Coordinate[]{splitLine[i], splitLine[i + 1]});

            List<Point> segmentIntersectionList = new GeometryList<Point>();
            // make the intersection between the line segment and each boundary segment in order to
            // create the intersection link
            List<LineString> ringSegmentList = ringToSegmentList(ring);
            for( LineString ringSegment : ringSegmentList ) {

                Geometry intersectionGeom = lineSegment.intersection(ringSegment);

                if (intersectionGeom instanceof Point) {

                    IntersectionLink link = new IntersectionLink(lineSegment, ringSegment,
                            (Point) intersectionGeom);
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.geom.LineString

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.