Search in sources :

Example 11 with LengthIndexedLine

use of com.revolsys.geometry.linearref.LengthIndexedLine in project com.revolsys.open by revolsys.

the class LinearReferencingFunctions method project.

public static Geometry project(final Geometry g, final Geometry g2) {
    final LengthIndexedLine ll = new LengthIndexedLine(g);
    final double index = ll.project(g2.getPoint());
    final Point p = ll.extractPoint(index);
    return g.getGeometryFactory().point(p);
}
Also used : LengthIndexedLine(com.revolsys.geometry.linearref.LengthIndexedLine) Point(com.revolsys.geometry.model.Point)

Aggregations

LengthIndexedLine (com.revolsys.geometry.linearref.LengthIndexedLine)11 Geometry (com.revolsys.geometry.model.Geometry)7 Point (com.revolsys.geometry.model.Point)6 PointDoubleXY (com.revolsys.geometry.model.impl.PointDoubleXY)5 PointDoubleXYZ (com.revolsys.geometry.model.impl.PointDoubleXYZ)1