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;
}
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);
}
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);
}
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;
}
Aggregations