Package com.vividsolutions.jts.geom

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


        LinearRing shell = gf.createLinearRing(csf.create(new double[] { 1, 1, 99, 10, 1, 33,
                10, 10, 66,    1, 10, 66,       1, 1, 99 }, 3));
        LinearRing hole = gf.createLinearRing(csf.create(new double[] { 2, 2, 99, 8, 2, 44, 8, 8,
                99, 2, 8, 99, 2, 2, 99 }, 3));
        Polygon poly = gf.createPolygon(shell, new LinearRing[] { hole });

        checkCreateSchemaAndInsert(poly);
    }

    /**
 
View Full Code Here


        GeometryFactory factory = new GeometryFactory();
        Coordinate[] coords = new Coordinate[] {
            new Coordinate(minx, miny), new Coordinate(minx, maxy),
            new Coordinate(maxx, maxy), new Coordinate(maxx, miny),
            new Coordinate(minx, miny) };
        Polygon poly = factory.createPolygon(factory
            .createLinearRing(coords), new LinearRing[0]);
        currentGeom = factory
            .createMultiPolygon(new Polygon[] { poly });

        return true;
View Full Code Here

    double maxy = uly;
    GeometryFactory factory = new GeometryFactory();
    Coordinate[] coords = new Coordinate[] { new Coordinate(minx, miny),
        new Coordinate(minx, maxy), new Coordinate(maxx, maxy),
        new Coordinate(maxx, miny), new Coordinate(minx, miny) };
    Polygon poly = factory.createPolygon(factory.createLinearRing(coords),
        new LinearRing[0]);
    return factory.createMultiPolygon(new Polygon[] { poly });

  }
View Full Code Here

                new Coordinate(env.getMinimum(0), env.getMaximum(1)),
                new Coordinate(env.getMaximum(0), env.getMaximum(1)),
                new Coordinate(env.getMaximum(0), env.getMinimum(1)),
                new Coordinate(env.getMinimum(0), env.getMinimum(1)) };

        return factory.createPolygon(factory.createLinearRing(coords), new LinearRing[0]);
    }

    /**
     * creates a thread pool
     *
 
View Full Code Here

            } else {
                holes[t] = (LinearRing) p.getInteriorRingN(t);
            }
        }

        return factory.createPolygon(outer, holes);
    }

    /**
     * Like makeGoodShapePolygon, but applied towards a multi polygon.
     *
 
View Full Code Here

        new Coordinate(env.getMinimum(0), env.getMaximum(1)),
        new Coordinate(env.getMaximum(0), env.getMaximum(1)),
        new Coordinate(env.getMaximum(0), env.getMinimum(1)),
        new Coordinate(env.getMinimum(0), env.getMinimum(1)) };

    return factory.createPolygon(factory.createLinearRing(coords),
        new LinearRing[0]);
  }

  /**
   *
 
View Full Code Here

                    double maxX = minX + 180;
                    double maxY = minY + 180;
                    LinearRing ring = gf.createLinearRing(new Coordinate[] {new Coordinate(minX, minY),
                            new Coordinate(minX, maxY), new Coordinate(maxX, maxY), new Coordinate(maxX, minY),
                            new Coordinate(minX, minY)});
                    Polygon p = gf.createPolygon(ring, null);
                    Geometry intersection = p.intersection(ls);
                    if (!intersection.isEmpty()) {
                        if (intersection instanceof LineString) {
                            LineString ils = ((LineString) intersection);
                            double d = getGeodeticSegmentLength(ils);
View Full Code Here

        Id startingFeatures = createFidFilter(fs);
        FilterFactory2 filterFac = CommonFactoryFinder
                .getFilterFactory2(GeoTools.getDefaultHints());
        try {
            GeometryFactory gf = new GeometryFactory();
            MultiPolygon mp = gf.createMultiPolygon(new Polygon[] { gf.createPolygon(gf
                    .createLinearRing(new Coordinate[] { new Coordinate(-88.071564, 37.51099),
                            new Coordinate(-88.467644, 37.400757),
                            new Coordinate(-90.638329, 42.509361),
                            new Coordinate(-89.834618, 42.50346),
                            new Coordinate(-88.071564, 37.51099) }), new LinearRing[] {}) });
View Full Code Here

            for (int j = 0; j < 4; j++) {
                firstArray[j] = new Coordinate(j + numFeatures, j + numFeatures);
            }
            firstArray[4] = new Coordinate(0 + numFeatures, 0 + numFeatures);
            LinearRing shell = new LinearRing(firstArray, new PrecisionModel(), 0);
            b.add(gf.createPolygon(shell, null));
            b.add(0);
            firstArrayGeometry[numFeatures] = gf.createPolygon(shell, null);
            features.add(b.buildFeature(numFeatures + ""));

        }
View Full Code Here

            }
            firstArray[4] = new Coordinate(0 + numFeatures, 0 + numFeatures);
            LinearRing shell = new LinearRing(firstArray, new PrecisionModel(), 0);
            b.add(gf.createPolygon(shell, null));
            b.add(0);
            firstArrayGeometry[numFeatures] = gf.createPolygon(shell, null);
            features.add(b.buildFeature(numFeatures + ""));

        }
        for (int numFeatures = 0; numFeatures < 5; numFeatures++) {
            Coordinate array[] = new Coordinate[5];
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.