Package com.vividsolutions.jts.linearref

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


    System.out.println("Extracting point at position 0.9: " + line.extractPoint(0.9));
    System.out.println("Extracting point at position 1.0: " + line.extractPoint(1.0));
    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);
View Full Code Here


    System.out.println("Extracting point at position 1.0: " + line.extractPoint(1.0));
    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());
View Full Code Here

            return g.getCoordinate();
        } else if (g instanceof LineString) {
            // make sure the point we return is actually on the line
            LineString line = (LineString) g;
            LengthIndexedLine lil = new LengthIndexedLine(line);
            return lil.extractPoint(line.getLength() / 2.0);
        } else {
            // return the actual centroid
            return g.getCentroid().getCoordinate();
        }
    }
View Full Code Here

public class LinearReferencingFunctions
{
  public static Geometry extractPoint(Geometry g, double index)
  {
    LengthIndexedLine ll = new LengthIndexedLine(g);
    Coordinate p = ll.extractPoint(index);
    return g.getFactory().createPoint(p);
  }
  public static Geometry extractLine(Geometry g, double start, double end)
  {
    LengthIndexedLine ll = new LengthIndexedLine(g);
View Full Code Here

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