Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.GeometryFactory.createPolygon()


        tempCoordinates[1] = new Coordinate(xMax, yMin);
        tempCoordinates[2] = new Coordinate(xMax, yMax);
        tempCoordinates[3] = new Coordinate(xMin, yMax);
        tempCoordinates[4] = tempCoordinates[0];
        LinearRing linearRing = geomFactory.createLinearRing(tempCoordinates);
        Polygon polygon = geomFactory.createPolygon(linearRing, null);
        return polygon;
    }

    // this test verifies if the Illegal argument exception is thrown when a MultiPointCollection is given as first collection
    @Test(expected = IllegalArgumentException.class)
View Full Code Here


            array[1] = new Coordinate(1, 0);
            array[2] = new Coordinate(1, 1);
            array[3] = new Coordinate(0, 1);
            array[4] = new Coordinate(0, 0);
            LinearRing shell = new LinearRing(array, new PrecisionModel(), 0);
            b.add(gf.createPolygon(shell, null));
            b.add(0);
            firstArrayGeometry[0] = gf.createPolygon(shell, null);
            features.add(b.buildFeature(numFeatures + ""));
        }
        for (int numFeatures = 0; numFeatures < 1; numFeatures++) {
View Full Code Here

            array[3] = new Coordinate(0, 1);
            array[4] = new Coordinate(0, 0);
            LinearRing shell = new LinearRing(array, new PrecisionModel(), 0);
            b.add(gf.createPolygon(shell, null));
            b.add(0);
            firstArrayGeometry[0] = gf.createPolygon(shell, null);
            features.add(b.buildFeature(numFeatures + ""));
        }
        for (int numFeatures = 0; numFeatures < 1; numFeatures++) {
            Coordinate array[] = new Coordinate[5];
            Coordinate centre = ((Polygon) features.features().next().getDefaultGeometry())
View Full Code Here

            array[1] = new Coordinate(centre.x + 1, centre.y);
            array[2] = new Coordinate(centre.x + 1, centre.y + 1);
            array[3] = new Coordinate(centre.x, centre.y + 1);
            array[4] = new Coordinate(centre.x, centre.y);
            LinearRing shell = new LinearRing(array, new PrecisionModel(), 0);
            b.add(gf.createPolygon(shell, null));
            b.add(0);
            secondArrayGeometry[0] = gf.createPolygon(shell, null);
            secondFeatures.add(b.buildFeature(numFeatures + ""));
        }
View Full Code Here

            array[3] = new Coordinate(centre.x, centre.y + 1);
            array[4] = new Coordinate(centre.x, centre.y);
            LinearRing shell = new LinearRing(array, new PrecisionModel(), 0);
            b.add(gf.createPolygon(shell, null));
            b.add(0);
            secondArrayGeometry[0] = gf.createPolygon(shell, null);
            secondFeatures.add(b.buildFeature(numFeatures + ""));
        }

        SimpleFeatureCollection output3 = process.execute(features,secondFeatures, null, null, null, false, false);
View Full Code Here

                faceFeature = null;
            }
        }

        if (innerRings.isEmpty()) {
            result = geometryFactory.createPolygon(outerRing, null);
        } else {
            LinearRing[] ringArray = new LinearRing[innerRings.size()];

            for (int cnx = 0; cnx < innerRings.size(); cnx++) {
                ringArray[cnx] = (LinearRing) innerRings.get(cnx);
View Full Code Here

            for (int cnx = 0; cnx < innerRings.size(); cnx++) {
                ringArray[cnx] = (LinearRing) innerRings.get(cnx);
            }

            result = geometryFactory.createPolygon(outerRing, ringArray);
        }

        values.setDefaultGeometry(result);
    }
}
View Full Code Here

                new Coordinate(0,0),
                new Coordinate(10,0),
                new Coordinate(0,10),
                new Coordinate(0,0)
            });
        Polygon polygon = factory.createPolygon(ring, new LinearRing[0]);
        polygon.setUserData("EPSG:4326");
        MultiPolygon geom = factory.createMultiPolygon(new Polygon[]{polygon});
        geom.setUserData("EPSG:4326");
        final StringWriter writer = new StringWriter();
//        DocumentWriter.writeDocument(geom, schema, writer, new HashMap());
View Full Code Here

        coords2[2] = new Coordinate(15, 15);
        coords2[3] = new Coordinate(10, 15);
        coords2[4] = new Coordinate(10, 10);

        GeometryFactory gf = new GeometryFactory(new PrecisionModel());
        Literal right = fac.literal(gf.createPolygon(
                    gf.createLinearRing(coords2), null));
        DWithin filter = fac.dwithin(fac.property("testGeometry"), right, 10, "m");

        assertAttributeName(filter, "testGeometry");
    }
View Full Code Here

                new Coordinate(0, 0),
                new Coordinate(6, 0),
                new Coordinate(6, 7),
                new Coordinate(0, 7),
                new Coordinate(0, 0)};               
        Polygon geom1 = gf.createPolygon(gf.createLinearRing(coords1), new LinearRing[0]);
       
        Coordinate[] coords2 = new Coordinate[] {
                new Coordinate(2, 2),
                new Coordinate(6, 0),
                new Coordinate(6, 7),
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.