Search in sources :

Example 6 with LocationIndexedLine

use of com.revolsys.geometry.linearref.LocationIndexedLine 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 LocationIndexedLine

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

the class LocationIndexedLineTest method runExtractLine.

private void runExtractLine(final String wkt, final LinearLocation start, final LinearLocation end, final String expected) {
    final Geometry geom = read(wkt);
    final LocationIndexedLine lil = new LocationIndexedLine(geom);
    final Geometry result = lil.extractLine(start, end);
    // System.out.println(result);
    checkExpected(result, expected);
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) LocationIndexedLine(com.revolsys.geometry.linearref.LocationIndexedLine)

Example 8 with LocationIndexedLine

use of com.revolsys.geometry.linearref.LocationIndexedLine 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 9 with LocationIndexedLine

use of com.revolsys.geometry.linearref.LocationIndexedLine 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

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