Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.MultiLineString


     * @throws NoSuchAuthorityCodeException
     */
    private MultiLineString parseMultiLineString(int dimension, CoordinateReferenceSystem crs)
            throws XmlPullParserException, IOException, NoSuchAuthorityCodeException,
            FactoryException {
        MultiLineString geom;

        parser.require(START_TAG, GML.NAMESPACE, GML.MultiLineString.getLocalPart());

        List<LineString> lines = new ArrayList<LineString>(2);

View Full Code Here


        SimpleFeatureCollection origional = source.getFeatures();

        FeatureCollection result = process.execute(origional, "from_lrs", "to_lrs", 0.5, 1.5);
        Assert.assertEquals(1, result.size());
        Feature feature = result.features().next();
        MultiLineString segment = (MultiLineString) feature.getDefaultGeometryProperty().getValue();
        Assert.assertEquals(2, segment.getNumPoints());
        Assert.assertEquals(0.5, segment.getCoordinates()[0].x, 0.0);
        Assert.assertEquals(0.0, segment.getCoordinates()[0].y, 0.0);
        Assert.assertEquals(1.5, segment.getCoordinates()[1].x, 0.0);
        Assert.assertEquals(0.0, segment.getCoordinates()[1].y, 0.0);
    }
View Full Code Here

        SimpleFeatureCollection origional = source.getFeatures();

        FeatureCollection result = process.execute(origional, "from_lrs", "to_lrs", 0.5, 3.5);
        Assert.assertEquals(1, result.size());
        Feature feature = result.features().next();
        MultiLineString segment = (MultiLineString) feature.getDefaultGeometryProperty().getValue();
        Assert.assertEquals(3, segment.getNumPoints());
        Assert.assertEquals(0.5, segment.getCoordinates()[0].x, 0.0);
        Assert.assertEquals(0.0, segment.getCoordinates()[0].y, 0.0);
        Assert.assertEquals(3.5, segment.getCoordinates()[2].x, 0.0);
        Assert.assertEquals(0.0, segment.getCoordinates()[2].y, 0.0);
    }
View Full Code Here

        SimpleFeatureCollection origional = source.getFeatures();

        FeatureCollection result = process.execute(origional, "from_lrs", "to_lrs", 0.5, 5.5);
        Assert.assertEquals(1, result.size());
        Feature feature = result.features().next();
        MultiLineString segment = (MultiLineString) feature.getDefaultGeometryProperty().getValue();
        Assert.assertEquals(4, segment.getNumPoints());
        Assert.assertEquals(0.5, segment.getCoordinates()[0].x, 0.0);
        Assert.assertEquals(0.0, segment.getCoordinates()[0].y, 0.0);
        Assert.assertEquals(5.5, segment.getCoordinates()[3].x, 0.0);
        Assert.assertEquals(0.0, segment.getCoordinates()[3].y, 0.0);
    }
View Full Code Here

                                        + toMeasure + " fromMeasure:" + fromMeasure);
                            }
                        }
                    }
                    results.add(createTargetFeature(firstFeature, (SimpleFeatureType) firstFeature
                            .getType(), new MultiLineString((LineString[]) lineMerger
                            .getMergedLineStrings().toArray(new LineString[0]), geometryFactory)));
                }
            } finally {
                if (featureIterator != null)
                    featureIterator.close();
View Full Code Here

            return geometryFactory.createPolygon(invertedShell, invertedHoles);
        } else if (geom instanceof MultiPoint) {
            return geometryFactory.createMultiPoint(invertCoordinates(geom
                    .getCoordinates()));
        } else if (geom instanceof MultiLineString) {
            MultiLineString multiLineString = (MultiLineString) geom;
            LineString[] inverted = new LineString[multiLineString
                    .getNumGeometries()];
            for (int count = 0; count < multiLineString.getNumGeometries(); count++) {
                inverted[count] = (LineString) invertGeometryCoordinates(multiLineString
                        .getGeometryN(count));
            }
            return geometryFactory.createMultiLineString(inverted);
        } else if (geom instanceof MultiPolygon) {
            MultiPolygon multiPolygon = (MultiPolygon) geom;
View Full Code Here

            return geometryFactory.createPolygon(invertedShell, invertedHoles);
        } else if (geom instanceof MultiPoint) {
            return geometryFactory.createMultiPoint(invertCoordinates(geom
                    .getCoordinates()));
        } else if (geom instanceof MultiLineString) {
            MultiLineString multiLineString = (MultiLineString) geom;
            LineString[] inverted = new LineString[multiLineString
                    .getNumGeometries()];
            for (int count = 0; count < multiLineString.getNumGeometries(); count++) {
                inverted[count] = (LineString) invertGeometryCoordinates(multiLineString
                        .getGeometryN(count));
            }
            return geometryFactory.createMultiLineString(inverted);
        } else if (geom instanceof MultiPolygon) {
            MultiPolygon multiPolygon = (MultiPolygon) geom;
View Full Code Here

            "      ]"+
            "    }");
    }

    MultiLineString multiLine() {
        MultiLineString mline = gf.createMultiLineString(new LineString[]{
            gf.createLineString(array(new double[][]{{100.1, 0.1}, {101.1, 1.1}})),
            gf.createLineString(array(new double[][]{{102.1, 2.1}, {103.1, 3.1}}))
        });
        return mline;
    }
View Full Code Here

            "      ]"+
            "    }");
    }

    MultiLineString multiLine3d() {
        MultiLineString mline = gf.createMultiLineString(new LineString[]{
            gf.createLineString(array(new double[][]{{100.1, 0.1, 10.2}, {101.1, 1.1, 10.2}})),
            gf.createLineString(array(new double[][]{{102.1, 2.1, 11.2}, {103.1, 3.1, 11.2}}))
        });
        return mline;
    }
View Full Code Here

        List<Geometry> lineList = popGeometry(linestringtextNode);

        LineString[] lineStrings = lineList.toArray(new LineString[lineList.size()]) ;
       
        MultiLineString multiLineString= getGeometryFactory().createMultiLineString(lineStrings);
        return multiLineString;
   
    }
View Full Code Here

TOP

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

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.