Examples of extractPoint()


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

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

    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

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

            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

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

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

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

  }
  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

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

                        int numPoints = ls.getNumPoints();
                        LocationIndexedLine lil = new LocationIndexedLine(ls);
                        int seg = random.nextInt(numPoints);
                        double frac = random.nextDouble();
                        LinearLocation ll = new LinearLocation(seg, frac);
                        c = lil.extractPoint(ll);
                    } else {
                        c = v.getCoordinate();
                    }
                    // perturb
                    double distance = random.nextDouble() * radius;
 
View Full Code Here

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

   
        LocationIndexedLine index = new LocationIndexedLine(line);
   
        LinearLocation location = index.project(point.getCoordinate());
   
        Coordinate snap = index.extractPoint(location);
   
        Point pt = point.getFactory().createPoint(snap);
   
        return Converters.convert(pt, context); // convert to requested format
    }
View Full Code Here

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

      SpatialDatabaseRecord record = records.next();
      Geometry geom = record.getGeometry();
      if (geom instanceof LineString) {
        LocationIndexedLine line = new LocationIndexedLine(geom);
        LinearLocation here = line.project(point.getCoordinate());
        Coordinate snap = line.extractPoint(here);
        double distance = snap.distance(point.getCoordinate());
        results.add(new PointResult(layer.getGeometryFactory()
            .createPoint(snap), record, distance));
      } else if (geom instanceof Point) {
                Point here = (Point) geom;
View Full Code Here

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

    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()));
    System.out.println("Extracting point at end: " + pline.extractPoint(pline.getEndIndex()));
    System.out.println("Extracting point at start offset 0.5: " + pline.extractPoint(pline.getStartIndex(), 0.5));
    System.out.println("Extracting point at end offset 0.5: " + pline.extractPoint(pline.getEndIndex(), 0.5));
  }
View Full Code Here

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

    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()));
    System.out.println("Extracting point at end: " + pline.extractPoint(pline.getEndIndex()));
    System.out.println("Extracting point at start offset 0.5: " + pline.extractPoint(pline.getStartIndex(), 0.5));
    System.out.println("Extracting point at end offset 0.5: " + pline.extractPoint(pline.getEndIndex(), 0.5));
  }

  @Test
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.