Package com.vividsolutions.jts.geom

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


    public void testCreateSchemaAndInsertPolyWithHoleCW() throws Exception {
        LiteCoordinateSequenceFactory csf = new LiteCoordinateSequenceFactory();
        GeometryFactory gf = new GeometryFactory(csf);

        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 });
View Full Code Here


        LiteCoordinateSequenceFactory csf = new LiteCoordinateSequenceFactory();
        GeometryFactory gf = new GeometryFactory(csf);

        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

      for (int j = 0; j < dimensions; j++) {
        csNew.setOrdinate(numPoints-1-i, j, csOrig.getOrdinate(i, j));
      }
    }
   
    return gf.createLinearRing(csNew);
    }

    /**
     * Create a nice Polygon from the given Polygon. Will ensure that shells are
     * clockwise and holes are counter-clockwise. Capiche?
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

                for (int j = qMinY; j < qMaxY; j++) {
                    double minX = i * 180.0;
                    double minY = j * 180.0 - 90;
                    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()) {
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

        GeometryFactory gf = new GeometryFactory();

        Coordinate[] coords = { new Coordinate(minX, minY),
                new Coordinate(minX, maxY), new Coordinate(maxX, maxY),
                new Coordinate(maxX, minY), new Coordinate(minX, minY) };
        LinearRing shell = gf.createLinearRing(coords);
        Polygon bbox = gf.createPolygon(shell, null);
        bbox.setUserData(DefaultGeographicCRS.WGS84);

        Literal literal = filterFactory.literal(bbox);
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.