Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.MultiLineString


            Map hints) throws IOException, OperationNotSupportedException {
            if (!canEncode(element, value, hints)) {
                throw new OperationNotSupportedException("Cannot encode");
            }

            MultiLineString g = (MultiLineString) value;

            GMLComplexTypes.encode(element, g, output);
        }
View Full Code Here


        }

        @Override
        protected Geometry newGeometry(final double[][][] coords,
                final GeometryFactory geometryFactory) throws DataSourceException {
            MultiLineString mls = null;

            LineString[] lineStrings = null;

            int nLines = coords.length;
View Full Code Here

         
          // TODO, DB2 does not support instantiating a geometry collection from wkb,
          // wkb type 7, replace GeometryCollection with MultiLineString         
          // code in superclass: GeometryCollection geometry = new GeometryCollection(geometries, factory );
          // For DB2, we must use the following line of code
          MultiLineString ml = gf.createMultiLineString(geometries);
         
          FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
         
          PropertyName p = ff.property(aname("geom"));       
          Literal collect = ff.literal(ml);
View Full Code Here

            "<LineString><coordinates>2,2 3,3</coordinates></LineString>" +
            "</MultiGeometry>";

        buildDocument(xml);

        MultiLineString ml = (MultiLineString) parse();
        assertEquals( 2, ml.getNumGeometries() );
    }
View Full Code Here

        assertEquals( 2, ml.getNumGeometries() );
    }
   
    public void testEncodeMultiLineString() throws Exception {
        GeometryFactory gf = new GeometryFactory();
        MultiLineString ml = gf.createMultiLineString(
            new LineString[]{
                gf.createLineString( new Coordinate[] { new Coordinate( 0, 0), new Coordinate( 1, 1) } ),
                gf.createLineString( new Coordinate[] { new Coordinate( 2, 2), new Coordinate( 3, 3) } )
            }
        );
View Full Code Here

     */
    protected MultiLineString createMultiLineString() {
        LineString line1 = gf
                .createLineString(coords(new double[] { 1, 2, 2, 1, 3, 1, 4, 2, 4, 7 }));
        LineString line2 = gf.createLineString(coords(new double[] { 2, 7, 4, 7, 5, 7 }));
        MultiLineString multiLineString = gf
                .createMultiLineString(new LineString[] { line1, line2 });

        return multiLineString;
    }
View Full Code Here

                break LINES;    // goto LINES
            }
        }

        MultiLineString lines = gf.createMultiLineString(toLineStringArray(list));
        lines.setSRID(SRID);

        return lines;
    }
View Full Code Here

            assertEquals("Activity" + i, sf.getAttribute("Name"));

            if (i == 419) {
                assertNotNull(sf.getDefaultGeometry());
                assertTrue(sf.getDefaultGeometry() instanceof MultiLineString);
                MultiLineString mls = (MultiLineString) sf.getDefaultGeometry();
                assertEquals(1, mls.getNumGeometries());
                LineString ls = (LineString) mls.getGeometryN(0);
                assertEquals(2, ls.getNumPoints());
                assertEquals(ls.getStartPoint(), ls.getEndPoint());
            }
            i++;
        }
View Full Code Here

        MathTransform mt = CRS.findMathTransform(WGS84, MERCATOR, true);
        Geometry transformed = JTS.transform(g, mt);
        Geometry postProcessed = handler.postProcess(mt, transformed);
        // should have been duplicated in two parts
        assertTrue(postProcessed instanceof MultiLineString);
        MultiLineString mls = (MultiLineString) postProcessed;
        assertEquals(2, mls.getNumGeometries());
        // the two geometries width should be the same as 20°
        double twentyDegWidth = mercatorEnvelope.getWidth() / 18;
        assertEquals(twentyDegWidth, mls.getGeometryN(0).getEnvelopeInternal().getWidth(), EPS);
        assertEquals(twentyDegWidth, mls.getGeometryN(1).getEnvelopeInternal().getWidth(), EPS);
    }
View Full Code Here

        Geometry preProcessed = handler.preProcess(g);
        assertEquals(g, preProcessed);
        Geometry postProcessed = handler.postProcess(IdentityTransform.create(2), g);
        // should have been copied several times, but not above the limit
        assertTrue(postProcessed instanceof MultiLineString);
        MultiLineString mls = (MultiLineString) postProcessed;
        assertEquals(ProjectionHandlerFinder.WRAP_LIMIT * 2 + 1 , mls.getNumGeometries());
    }
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.