Search in sources :

Example 6 with LinearLocation

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

the class LocationIndexedLineTest method indexOfAfterCheck.

@Override
protected boolean indexOfAfterCheck(final Geometry linearGeom, final Point testPt, final Point afterPt) {
    final LocationIndexedLine indexedLine = new LocationIndexedLine(linearGeom);
    // check that computed location is after check location
    final LinearLocation afterLoc = indexedLine.indexOf(afterPt);
    final LinearLocation testLoc = indexedLine.indexOfAfter(testPt, afterLoc);
    if (testLoc.compareTo(afterLoc) < 0) {
        return false;
    }
    return true;
}
Also used : LocationIndexedLine(com.revolsys.geometry.linearref.LocationIndexedLine) LinearLocation(com.revolsys.geometry.linearref.LinearLocation)

Example 7 with LinearLocation

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

the class LocationIndexedLineTest method extractOffsetAt.

@Override
protected Point extractOffsetAt(final Geometry linearGeom, final Point testPt, final double offsetDistance) {
    final LocationIndexedLine indexedLine = new LocationIndexedLine(linearGeom);
    final LinearLocation index = indexedLine.indexOf(testPt);
    return indexedLine.extractPoint(index, offsetDistance);
}
Also used : LocationIndexedLine(com.revolsys.geometry.linearref.LocationIndexedLine) LinearLocation(com.revolsys.geometry.linearref.LinearLocation)

Example 8 with LinearLocation

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

the class LocationIndexedLineTest method indicesOfThenExtract.

@Override
protected Geometry indicesOfThenExtract(final Geometry input, final Geometry subLine) {
    final LocationIndexedLine indexedLine = new LocationIndexedLine(input);
    final LinearLocation[] loc = indexedLine.indicesOf(subLine);
    final Geometry result = indexedLine.extractLine(loc[0], loc[1]);
    return result;
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) LocationIndexedLine(com.revolsys.geometry.linearref.LocationIndexedLine) LinearLocation(com.revolsys.geometry.linearref.LinearLocation)

Aggregations

LinearLocation (com.revolsys.geometry.linearref.LinearLocation)8 LocationIndexedLine (com.revolsys.geometry.linearref.LocationIndexedLine)8 Geometry (com.revolsys.geometry.model.Geometry)6 PointDoubleXY (com.revolsys.geometry.model.impl.PointDoubleXY)5 LineSegment (com.revolsys.geometry.model.segment.LineSegment)1 LineSegmentDouble (com.revolsys.geometry.model.segment.LineSegmentDouble)1