Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.CoordinateSequence


        CoordinateSequence cs = delegate.getLinearizedCoordinateSequence(delegate.tolerance);
        return getFactory().createLinearRing(cs);
    }

    public LinearRing linearize(double tolerance) {
        CoordinateSequence cs = delegate.getLinearizedCoordinateSequence(delegate.tolerance);
        return getFactory().createLinearRing(cs);
    }
View Full Code Here


            if (t instanceof Coordinate) {
                Coordinate c = (Coordinate) t;
                p = gf.createPoint(c);
            } else {
                CoordinateSequence c = (CoordinateSequence) t;
                p = gf.createPoint(c);
            }

            ElementValue[] ev = new ElementValue[1];
            ev[0] = new DefaultElementValue(element, p);
View Full Code Here

                    throw new SAXException(
                        "Cannot have more than one coordinate sequence per "
                        + getName());
                }

                CoordinateSequence c = (CoordinateSequence) t;
                // TODO -- be forgiving
                if(c.size() == 1){
                    c = DefaultCoordinateSequenceFactory.instance().create(new Coordinate[]{c.getCoordinate(0),c.getCoordinate(0)});
                }
                p = gf.createLineString(c);
            }

            ElementValue[] ev = new ElementValue[1];
View Full Code Here

        boolean isDefaultTolerance = CircularArc.equals(tolerance, this.tolerance);
        if (linearized != null && isDefaultTolerance) {
            return linearized;
        }

        CoordinateSequence cs = getLinearizedCoordinateSequence(tolerance);
        LineString result = new LineString(cs, factory);
        if (isDefaultTolerance) {
            linearized = result;
        }
View Full Code Here

                arc.linearize(tolerance, gar);
            }

        };

        CoordinateSequence cs = gar.toCoordinateSequence(getFactory());
        return cs;
    }
View Full Code Here

    private LineString transformStraightLineString(LineString ls, GeometryFactory gf)
            throws TransformException {
        // if required, init csTransformer using geometry's CSFactory
        init(gf);
       
        CoordinateSequence cs = projectCoordinateSequence(ls.getCoordinateSequence());
        LineString transformed = null;
       
        if (ls instanceof LinearRing) {
            transformed = gf.createLinearRing(cs);
        } else {
View Full Code Here

        throws TransformException {
     
        // if required, init csTransformer using geometry's CSFactory
        init(gf);

        CoordinateSequence cs = projectCoordinateSequence(point.getCoordinateSequence());
        Point transformed = gf.createPoint(cs);
        transformed.setUserData( point.getUserData() );
        return transformed;
    }
View Full Code Here

        boolean isDefaultTolerance = CircularArc.equals(tolerance, this.tolerance);
        if (linearized != null && isDefaultTolerance) {
            return linearized;
        }

        CoordinateSequence cs = getLinearizedCoordinateSequence(tolerance);
        LineString result = new LineString(cs, factory);
        if (isDefaultTolerance) {
            linearized = result;
        }
View Full Code Here

                gar.setSize(gar.size() - 2);
            }
            // linearize with tolerance the circular strings, take the linear ones as is
            if (component instanceof SingleCurvedGeometry<?>) {
                SingleCurvedGeometry<?> curved = (SingleCurvedGeometry<?>) component;
                CoordinateSequence cs = curved
                        .getLinearizedCoordinateSequence(tolerance);
                gar.addAll(cs);
            } else {
                CoordinateSequence cs = component.getCoordinateSequence();
                for (int i = 0; i < cs.size(); i++) {
                    gar.add(cs.getX(i), cs.getY(i));
                }
            }
        }

        CoordinateSequence cs = gar.toCoordinateSequence(getFactory());
        return cs;
    }
View Full Code Here

                if (component instanceof SingleCurvedGeometry<?>) {
                    SingleCurvedGeometry<?> curved = (SingleCurvedGeometry<?>) component;
                    sb.append(curved.toCurvedText());
                } else {
                    sb.append("(");
                    CoordinateSequence cs = component.getCoordinateSequence();
                    for (int i = 0; i < cs.size(); i++) {
                        sb.append(cs.getX(i) + " " + cs.getY(i));
                        if (i < cs.size() - 1) {
                            sb.append(", ");
                        }
                    }
                    sb.append(")");
                }
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.geom.CoordinateSequence

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.