Package com.vividsolutions.jts.linearref

Examples of com.vividsolutions.jts.linearref.LinearLocation


    while (records.hasNext()) {
      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;
                results.add(new PointResult(here,record,here.distance(point)));
            }
    }
    Collections.sort(results);
    return results;
  }
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.linearref.LinearLocation

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.