Package com.vividsolutions.jts.geom.impl

Examples of com.vividsolutions.jts.geom.impl.CoordinateArraySequence


    protected static Polygon createPolygon() {
        Coordinate[] coords = new Coordinate[] {
                new Coordinate(200, 210), new Coordinate(200, 500), new Coordinate(2000, 2100),
                new Coordinate(500, 510), new Coordinate(200, 210)
            };
        CoordinateArraySequence seq = new CoordinateArraySequence(coords);
        LinearRing ls = new LinearRing(seq, new GeometryFactory());
        Polygon ret = new Polygon(ls, null, new GeometryFactory());

        return ret;
    }
View Full Code Here


        Coordinate[] coords = new Coordinate[] {
                new Coordinate(205, 455), new Coordinate(205, 500),
                new Coordinate(210, 500),
                new Coordinate(210, 455), new Coordinate(205, 455)
            };
        CoordinateArraySequence seq = new CoordinateArraySequence(coords);
        LinearRing ls = new LinearRing(seq, new GeometryFactory());
        Polygon ret = new Polygon(ls, null, new GeometryFactory());
        Filter intersects = ((FilterFactoryImpl) ff).intersects(ff.property("geom"), ff.literal(ret));

        and = ff.and(intersects, bbox);
View Full Code Here

        coords[1] = new Coordinate(x_max, y_min);
        coords[2] = new Coordinate(x_max, y_max);
        coords[3] = new Coordinate(x_min, y_max);
        coords[4] = coords[0];

        CoordinateSequence cs = new CoordinateArraySequence(coords);

        return new LineString(cs, gfact);
    }
View Full Code Here

            coords[k] = new Coordinate(x, y);
        }

        coords[n_vertices] = coords[0];

        CoordinateSequence cs = new CoordinateArraySequence(coords);

        return new LineString(cs, gfact);
    }
View Full Code Here

        double[] linearized = arc.linearize(Double.MAX_VALUE);
        Coordinate[] coords = new Coordinate[linearized.length / 2];
        for (int i = 0; i < coords.length; i++) {
            coords[i] = new Coordinate(linearized[i * 2], linearized[i * 2 + 1]);
        }
        CoordinateArraySequence cs = new CoordinateArraySequence(coords);
        return new LineString(cs, new GeometryFactory());
    }
View Full Code Here

            DerivedLine(CoordinateSequence seq, GeometryFactory gf) {
                super(seq, gf);
            }
        }

        DerivedLine p = new DerivedLine(new CoordinateArraySequence(coords), geomFactory);
        assertEquals(Geometries.LINESTRING, Geometries.getForBinding(DerivedLine.class));
    }
View Full Code Here

    @Test
    public void testCompoundCurve() {
        double[] halfCircle = new double[] { 10, 10, 0, 20, -10, 10 };
        CircularString cs = new CircularString(halfCircle, GEOMETRY_FACTORY, Double.MAX_VALUE);
        LineString ls = new LineString(new CoordinateArraySequence(new Coordinate[] {
                new Coordinate(-10, 10), new Coordinate(-10, 0), new Coordinate(10, 0),
                new Coordinate(10, 10) }), GEOMETRY_FACTORY);
        CompoundCurve curve = new CompoundCurve(Arrays.asList(cs, ls), GEOMETRY_FACTORY,
                Double.MAX_VALUE);
View Full Code Here

    @Test
    public void testCompoundRing() {
        double[] halfCircle = new double[] { 10, 10, 0, 20, -10, 10 };
        CircularString cs = new CircularString(halfCircle, GEOMETRY_FACTORY, Double.MAX_VALUE);
        LineString ls = new LineString(new CoordinateArraySequence(new Coordinate[] {
                new Coordinate(-10, 10), new Coordinate(-10, 0), new Coordinate(10, 0),
                new Coordinate(10, 10) }), GEOMETRY_FACTORY);
        CompoundRing ring = new CompoundRing(Arrays.asList(cs, ls), GEOMETRY_FACTORY,
                Double.MAX_VALUE);
View Full Code Here

        return this.endArray();
    }

    private JSONBuilder writeCoordinates(Coordinate[] coords)
        throws JSONException {
        return writeCoordinates(new CoordinateArraySequence(coords));
    }
View Full Code Here

    performances.put(performance.name,performance);
    System.out.println("Point search took "+performance.duration()+" seconds to find "+results.size()+" results");

    // Faster tests with LineString and MultiPoint
    GeometryFactory geometryFactory = new GeometryFactory();
    CoordinateArraySequence cseq = new CoordinateArraySequence(coordinates.toArray(new Coordinate[0]));
    HashMap<String,Geometry> testGeoms = new LinkedHashMap<String,Geometry>();
    testGeoms.put("LineString", geometryFactory.createLineString(cseq));
    testGeoms.put("LineString.buffer(0.001)",   testGeoms.get("LineString").buffer(0.001));
    testGeoms.put("LineString.buffer(0.0001)",  testGeoms.get("LineString").buffer(0.0001));
    testGeoms.put("LineString.buffer(0.00001)",  testGeoms.get("LineString").buffer(0.00001));
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.geom.impl.CoordinateArraySequence

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.