Examples of GeometryCollection


Examples of com.vividsolutions.jts.geom.GeometryCollection

                polygons[i] = transformPolygon((Polygon) mp.getGeometryN(i), factory);
            }

            transformed = factory.createMultiPolygon(polygons);
        } else if (g instanceof GeometryCollection) {
            GeometryCollection gc = (GeometryCollection) g;
            Geometry[] geoms = new Geometry[gc.getNumGeometries()];

            for (int i = 0; i < geoms.length; i++) {
                geoms[i] = transform(gc.getGeometryN(i));
            }

            transformed = factory.createGeometryCollection(geoms);
        } else {
            throw new IllegalArgumentException("Unsupported geometry type " + g.getClass());
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryCollection

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

            GeometryCollection g = (GeometryCollection) value;

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

Examples of com.vividsolutions.jts.geom.GeometryCollection

        // LOGGER.log(Level.WARNING, sdeEx.getMessage());
        // throw sdeEx;
        // }

        int numParts;
        GeometryCollection gcol = null;

        if (geometry instanceof GeometryCollection) {
            gcol = (GeometryCollection) geometry;
        } else {
            Geometry[] geoms = { geometry };
            gcol = new GeometryFactory().createGeometryCollection(geoms);
        }

        List<SDEPoint> allPoints = new ArrayList<SDEPoint>();
        numParts = gcol.getNumGeometries();

        int[] partOffsets = new int[numParts];
        Geometry geom;
        Coordinate[] coords;
        Coordinate c;

        for (int currGeom = 0; currGeom < numParts; currGeom++) {
            partOffsets[currGeom] = allPoints.size();
            geom = gcol.getGeometryN(currGeom);

            coords = geom.getCoordinates();

            for (int i = 0; i < coords.length; i++) {
                c = coords[i];
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryCollection

    }
   
    @Override
    public Object getProperty(Object object, QName name) throws Exception {
        if (GML.geometryMember.equals(name)) {
            GeometryCollection multiGeometry = (GeometryCollection) object;
            Geometry[] members = new Geometry[multiGeometry.getNumGeometries()];

            for (int i = 0; i < members.length; i++) {
                members[i] = (Geometry) multiGeometry.getGeometryN(i);
            }

            GML3EncodingUtils.setChildIDs(multiGeometry);

            return members;
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryCollection

     * @return
     */
    private PathIterator getPathIterator(final LiteShape2 shape) {
        // DJB: changed this to handle multi* geometries and line and
        // polygon geometries better
        GeometryCollection gc;
        if (shape.getGeometry() instanceof GeometryCollection)
            gc = (GeometryCollection) shape.getGeometry();
        else {
            Geometry[] gs = new Geometry[1];
            gs[0] = shape.getGeometry();
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryCollection

        "<Polygon>" +
        "<outerBoundaryIs><LinearRing><coordinates>0,0 1,1 2,2 0,0</coordinates></LinearRing></outerBoundaryIs></Polygon>" +
        "</MultiGeometry>";
        buildDocument(xml);
       
        GeometryCollection gc = (GeometryCollection) parse();
        assertEquals( 3, gc.getNumGeometries() );
        assertTrue( gc.getGeometryN(0) instanceof Point );
        assertTrue( gc.getGeometryN(1) instanceof LineString );
        assertTrue( gc.getGeometryN(2) instanceof Polygon );
    }
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryCollection

        assertTrue( gc.getGeometryN(2) instanceof Polygon );
    }
   
    public void testEncodeMultiGeometry() throws Exception {
        GeometryFactory gf = new GeometryFactory();
        GeometryCollection gc = gf.createGeometryCollection(
            new Geometry[]{
                gf.createPoint( new Coordinate(0,0)),
                gf.createLineString( new Coordinate[]{new Coordinate(0,0), new Coordinate(1,1)}),
                gf.createPolygon(
                    gf.createLinearRing( new Coordinate[] {
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryCollection

            }

            list.add(geom);
        }

        GeometryCollection geoms = gf.createGeometryCollection(toGeometryArray(
                    list));
        geoms.setSRID(SRID);

        return geoms;
    }
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryCollection

    private void validateOGCUnitUsage(double distance, String unit) throws Exception {
        Coordinate coordinate = new Coordinate(3.031, 2.754);
        GeometryFactory factory = new GeometryFactory();
        Point point = factory.createPoint(coordinate);
        Geometry[] geometries = {point};
        GeometryCollection geometry = new GeometryCollection(geometries, factory );

        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);

        PropertyName geomName = ff.property(aname("geom"));
        Literal lit = ff.literal(geometry);
View Full Code Here

Examples of org.geolatte.geom.GeometryCollection

        for (int i = shapeIdx; i < shapes.length; i++) {
            if (shapes[i].parentOffset == shapeIdx) {
                geometries.add(decode(i));
            }
        }
        return new GeometryCollection(geometries.toArray(new Geometry[0]));
    }
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.