Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.MultiPolygon


                inverted[count] = (LineString) invertGeometryCoordinates(multiLineString
                        .getGeometryN(count));
            }
            return geometryFactory.createMultiLineString(inverted);
        } else if (geom instanceof MultiPolygon) {
            MultiPolygon multiPolygon = (MultiPolygon) geom;
            Polygon[] inverted = new Polygon[multiPolygon.getNumGeometries()];
            for (int count = 0; count < multiPolygon.getNumGeometries(); count++) {
                inverted[count] = (Polygon) invertGeometryCoordinates(multiPolygon
                        .getGeometryN(count));
            }
            return geometryFactory.createMultiPolygon(inverted);
        } else if (geom instanceof GeometryCollection) {
            GeometryCollection collection = (GeometryCollection) geom;
View Full Code Here


        "      ]"+
        "    }");
    }

    MultiPolygon multiPolygon() {
        MultiPolygon mpoly = gf.createMultiPolygon(new Polygon[]{
            gf.createPolygon(gf.createLinearRing(
                array(new double[][]{{102.1, 2.1}, {103.1, 2.1}, {103.1, 3.1}, {102.1, 3.1}, {102.1, 2.1}})),null),
            gf.createPolygon(gf.createLinearRing(
                array(new double[][]{{100.1, 0.1}, {101.1, 0.1}, {101.1, 1.1}, {100.1, 1.1}, {100.1, 0.1}})),
                new LinearRing[]{gf.createLinearRing(
View Full Code Here

        "      ]"+
        "    }");
    }

    MultiPolygon multiPolygon3d() {
        MultiPolygon mpoly = gf.createMultiPolygon(new Polygon[]{
            gf.createPolygon(gf.createLinearRing(
                array(new double[][]{{102.1, 2.1, 10.2}, {103.1, 2.1, 10.2}, {103.1, 3.1, 10.2}, {102.1, 3.1, 10.2}, {102.1, 2.1, 10.2}})),null),
            gf.createPolygon(gf.createLinearRing(
                array(new double[][]{{100.1, 0.1, 10.2}, {101.1, 0.1, 10.2}, {101.1, 1.1, 10.2}, {100.1, 1.1, 10.2}, {100.1, 0.1, 10.2}})),
                new LinearRing[]{gf.createLinearRing(
View Full Code Here

      gfinal = (Polygon) polys.get(0);   //POLYGON
    }
    else
    {
      GeometryFactory gf = ((Polygon) polys.get(0)).getFactory();
      gfinal = new MultiPolygon((Polygon[]) polys.toArray( new Polygon[polys.size()]),   gf    );
    }
   
    gfinal = gfinal.buffer(0); // for topologic problems.
   
     
View Full Code Here

                "geometry:Polygon:srid=4326," + "countryName:String," + "population:Integer,"
                        + "principalMineralResource:String");
        SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(type);

        WKTReader reader = new WKTReader();
        MultiPolygon geometry = (MultiPolygon) reader.read(usaGeometry());

        featureBuilder.add(geometry);
        featureBuilder.add("USA");
        featureBuilder.add(307006550);
        featureBuilder.add("oil");
View Full Code Here

            throws CQLException {

        MultiPolygonBuilder builder = new MultiPolygonBuilder(getStatement(),
                getResultStack());

        MultiPolygon mp = (MultiPolygon) builder.build(polygontextNode);

        return mp;

    }
View Full Code Here

                GeometryAttribute defaultGeometryProperty = feature.getDefaultGeometryProperty();
                assertNotNull(defaultGeometryProperty);
                final Object value = defaultGeometryProperty.getValue();
                assertNotNull(value);
                assertTrue("value: " + value, value instanceof MultiPolygon);
                MultiPolygon mp = (MultiPolygon) value;

                assertEquals(numPolygons, mp.getNumGeometries());
                for (int i = 0; i < numPolygons; i++) {
                    Polygon p = (Polygon) mp.getGeometryN(i);
                    assertEquals(expectedHoles, p.getNumInteriorRing());
                }
            }
        };
View Full Code Here

                GeometryAttribute defaultGeometryProperty = feature.getDefaultGeometryProperty();
                assertNotNull(defaultGeometryProperty);
                final Object value = defaultGeometryProperty.getValue();
                assertNotNull(value);
                assertTrue("value: " + value, value instanceof MultiPolygon);
                MultiPolygon mp = (MultiPolygon) value;

                assertEquals(numPolygons, mp.getNumGeometries());
                for (int i = 0; i < numPolygons; i++) {
                    Polygon p = (Polygon) mp.getGeometryN(i);
                    assertEquals(expectedHoles, p.getNumInteriorRing());
                }
            }
        };
View Full Code Here

    public Geometry build(int polygonNode) throws CQLException {
        List<Geometry> polygonList = popGeometry(polygonNode);

        Polygon[] polygons = polygonList.toArray(new Polygon[polygonList.size()]) ;
       
        MultiPolygon multiPolygon= getGeometryFactory().createMultiPolygon(polygons);
        return multiPolygon;
    }
View Full Code Here

    }

    public Object getProperty(Object object, QName name)
        throws Exception {
        if ("surfaceMember".equals(name.getLocalPart())) {
            MultiPolygon multiSurface = (MultiPolygon) object;
            Polygon[] members = new Polygon[multiSurface.getNumGeometries()];

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

            GML3EncodingUtils.setChildIDs(multiSurface);

            return members;
View Full Code Here

TOP

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

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.