Package com.vividsolutions.jts.linearref

Examples of com.vividsolutions.jts.linearref.LengthIndexedLine.extractLine()


     */
    LineString getSubLineString(LineString ls, double fraction) {
        if (fraction >= 1)
            return ls;
        LengthIndexedLine linRefLine = new LengthIndexedLine(ls);
        LineString subLine = (LineString) linRefLine.extractLine(0, fraction * ls.getLength());
        return subLine;
    }

    /**
     * Filters all input edges and returns all those as LineString geometries, that have at least one end point within the time limits. If they have
View Full Code Here


                                    double stopOffset = toMeasure - featureFromMeasure;
                                    double calcLength = ((Geometry) feature
                                            .getDefaultGeometryProperty().getValue()).getLength();
                                    if (calcLength == 0 || featureLength == 0)
                                        continue;
                                    Geometry extracted = lengthIndexedLine.extractLine(startOffset
                                            * calcLength / featureLength, stopOffset * calcLength
                                            / featureLength);
                                    if (!extracted.isEmpty())
                                        lineMerger.add(extracted);
                                } else if (fromMeasure > featureFromMeasure) {
View Full Code Here

                                    double startOffset = fromMeasure - featureFromMeasure;
                                    double calcLength = ((Geometry) feature
                                            .getDefaultGeometryProperty().getValue()).getLength();
                                    if (calcLength == 0 || featureLength == 0)
                                        continue;
                                    Geometry extracted = lengthIndexedLine.extractLine(startOffset
                                            * calcLength / featureLength, calcLength);
                                    if (!extracted.isEmpty())
                                        lineMerger.add(extracted);
                                } else {
                                    LengthIndexedLine lengthIndexedLine = new LengthIndexedLine(
View Full Code Here

                                    double stopOffset = toMeasure - featureFromMeasure;
                                    double calcLength = ((Geometry) feature
                                            .getDefaultGeometryProperty().getValue()).getLength();
                                    if (calcLength == 0 || featureLength == 0)
                                        continue;
                                    Geometry extracted = lengthIndexedLine.extractLine(0,
                                            stopOffset * calcLength / featureLength);
                                    if (extracted.isEmpty() || extracted.getLength() == 0.0) {
                                        LOGGER.info("Empty segment: featureFromMeasure="
                                                + featureFromMeasure + " featureToMeasure:"
                                                + featureToMeasure + " toMeasure:" + toMeasure
View Full Code Here

    System.out.println("Extracting point at position 1.5: " + line.extractPoint(1.5));
    System.out.println("Extracting point at position 1.5 offset 0.5: " + line.extractPoint(1.5, 0.5));
    System.out.println("Extracting point at position 1.5 offset -0.5: " + line.extractPoint(1.5, -0.5));
    System.out.println("Extracting point at position " + length + ": " + line.extractPoint(length));
    System.out.println("Extracting point at position " + (length / 2) + ": " + line.extractPoint(length / 2));
    System.out.println("Extracting line from position 0.1 to 0.2: " + line.extractLine(0.1, 0.2));
    System.out.println("Extracting line from position 0.0 to " + (length / 2) + ": " + line.extractLine(0, length / 2));
    LocationIndexedLine pline = new LocationIndexedLine(geometry);
    System.out.println("Have LocationIndexedLine: " + pline);
    System.out.println("Have start index: " + pline.getStartIndex());
    System.out.println("Have end index: " + pline.getEndIndex());
View Full Code Here

    System.out.println("Extracting point at position 1.5 offset 0.5: " + line.extractPoint(1.5, 0.5));
    System.out.println("Extracting point at position 1.5 offset -0.5: " + line.extractPoint(1.5, -0.5));
    System.out.println("Extracting point at position " + length + ": " + line.extractPoint(length));
    System.out.println("Extracting point at position " + (length / 2) + ": " + line.extractPoint(length / 2));
    System.out.println("Extracting line from position 0.1 to 0.2: " + line.extractLine(0.1, 0.2));
    System.out.println("Extracting line from position 0.0 to " + (length / 2) + ": " + line.extractLine(0, length / 2));
    LocationIndexedLine pline = new LocationIndexedLine(geometry);
    System.out.println("Have LocationIndexedLine: " + pline);
    System.out.println("Have start index: " + pline.getStartIndex());
    System.out.println("Have end index: " + pline.getEndIndex());
    System.out.println("Extracting point at start: " + pline.extractPoint(pline.getStartIndex()));
View Full Code Here

    return g.getFactory().createPoint(p);
  }
  public static Geometry extractLine(Geometry g, double start, double end)
  {
    LengthIndexedLine ll = new LengthIndexedLine(g);
    return ll.extractLine(start, end);
  }
  public static Geometry project(Geometry g, Geometry g2)
  {
    LengthIndexedLine ll = new LengthIndexedLine(g);
    double index = ll.project(g2.getCoordinate());
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.