Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.CoordinateSequenceFactory.create()


        coordinates = new Coordinate[3];
        coordinates[0] = new Coordinate(3.5, 1.0);
        coordinates[1] = new Coordinate(5.0, 1.0);
        coordinates[2] = new Coordinate(5.0, 5.0);

        coordinateSequence = coordinateSequenceFactory.create(coordinates);
        geometry = new LineString(coordinateSequence, geometryFactory);

        Vertex vertex = onBoardDepartServiceImpl.setupDepartOnBoard(routingContext);
        Edge edge = vertex.getOutgoing().toArray(new Edge[1])[0];
View Full Code Here


        }
       
        public Object getSimplifiedShape() {
            CoordinateSequenceFactory csf = geometryFactory.getCoordinateSequenceFactory();
            if(type.isPointType()) {
                CoordinateSequence cs = csf.create(1, 2);
                cs.setOrdinate(0, 0, (minX + maxX) / 2);
                cs.setOrdinate(0, 1, (minY + maxY) / 2);
                return geometryFactory.createMultiPoint(new Point[] {geometryFactory.createPoint(cs)});
            } else if(type.isLineType()) {
                CoordinateSequence cs = csf.create(2, 2);
View Full Code Here

                CoordinateSequence cs = csf.create(1, 2);
                cs.setOrdinate(0, 0, (minX + maxX) / 2);
                cs.setOrdinate(0, 1, (minY + maxY) / 2);
                return geometryFactory.createMultiPoint(new Point[] {geometryFactory.createPoint(cs)});
            } else if(type.isLineType()) {
                CoordinateSequence cs = csf.create(2, 2);
                cs.setOrdinate(0, 0, minX);
                cs.setOrdinate(0, 1, minY);
                cs.setOrdinate(1, 0, maxX);
                cs.setOrdinate(1, 1, maxY);
                return geometryFactory.createMultiLineString(new LineString[] {geometryFactory.createLineString(cs)});
View Full Code Here

                cs.setOrdinate(0, 1, minY);
                cs.setOrdinate(1, 0, maxX);
                cs.setOrdinate(1, 1, maxY);
                return geometryFactory.createMultiLineString(new LineString[] {geometryFactory.createLineString(cs)});
            } else if(type.isPolygonType()) {
                CoordinateSequence cs = csf.create(5, 2);
                cs.setOrdinate(0, 0, minX);
                cs.setOrdinate(0, 1, minY);
                cs.setOrdinate(1, 0, minX);
                cs.setOrdinate(1, 1, maxY);
                cs.setOrdinate(2, 0, maxX);
View Full Code Here

    CoordinateSequenceFactory csf = gf.getCoordinateSequenceFactory();

    CoordinateSequence csOrig = lr.getCoordinateSequence();
    int numPoints = csOrig.size();
    int dimensions = csOrig.getDimension();
    CoordinateSequence csNew = csf.create(numPoints, dimensions);

    for (int i = 0; i < numPoints; i++) {
      for (int j = 0; j < dimensions; j++) {
        csNew.setOrdinate(numPoints-1-i, j, csOrig.getOrdinate(i, j));
      }
View Full Code Here

                        segment[1] = y0;
                        segment[2] = x1;
                        segment[3] = y1;
                        double[] clippedSegment = clipSegment(segment);
                        if (clippedSegment != null) {
                            CoordinateSequence cs = csf.create(2, 2);
                            cs.setOrdinate(0, 0, clippedSegment[0]);
                            cs.setOrdinate(0, 1, clippedSegment[1]);
                            cs.setOrdinate(1, 0, clippedSegment[2]);
                            cs.setOrdinate(1, 1, clippedSegment[3]);
                            clipped.add(gf.createLineString(cs));
View Full Code Here

            // the first and last strings might be adjacent, in that case fuse them
            CoordinateSequence cs0 = clipped.get(0).getCoordinateSequence();
            CoordinateSequence cs1 = clipped.get(clipped.size() - 1).getCoordinateSequence();
            if (cs0.getOrdinate(0, 0) == cs1.getOrdinate(cs1.size() - 1, 0)
                    && cs0.getOrdinate(0, 1) == cs1.getOrdinate(cs1.size() - 1, 1)) {
                CoordinateSequence cs = csf.create(cs0.size() + cs1.size() - 1, 2);
                for (int i = 0; i < cs1.size(); i++) {
                    cs.setOrdinate(i, 0, cs1.getOrdinate(i, 0));
                    cs.setOrdinate(i, 1, cs1.getOrdinate(i, 1));
                }
                for (int i = 1; i < cs0.size(); i++) {
View Full Code Here

        double x1 = midx + spanX / 2;
        double y0 = midy - spanY / 2;
        double y1 = midy + spanY / 2;
        if (Point.class.isAssignableFrom(geometryType)
                || MultiPoint.class.isAssignableFrom(geometryType)) {
            CoordinateSequence cs = csf.create(1, 2);
            cs.setOrdinate(0, 0, midx);
            cs.setOrdinate(0, 1, midy);
            if (Point.class.isAssignableFrom(geometryType)) {
                // people should not call this method for a point, but... whatever
                return geometryFactory.createPoint(cs);
View Full Code Here

                return geometryFactory.createMultiPoint(new Point[] { geometryFactory
                        .createPoint(cs) });
            }
        } else if (LineString.class.isAssignableFrom(geometryType)
                || MultiLineString.class.isAssignableFrom(geometryType)) {
            CoordinateSequence cs = csf.create(2, 2);
            cs.setOrdinate(0, 0, x0);
            cs.setOrdinate(0, 1, y0);
            cs.setOrdinate(1, 0, x1);
            cs.setOrdinate(1, 1, y1);
            if (MultiLineString.class.isAssignableFrom(geometryType)) {
View Full Code Here

                        .createLineString(cs) });
            } else {
                return geometryFactory.createLineString(cs);
            }
        } else {
            CoordinateSequence cs = csf.create(5, 2);
            cs.setOrdinate(0, 0, x0);
            cs.setOrdinate(0, 1, y0);
            cs.setOrdinate(1, 0, x0);
            cs.setOrdinate(1, 1, y1);
            cs.setOrdinate(2, 0, x1);
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.