use of org.locationtech.jts.algorithm.locate.SimplePointInAreaLocator in project qupath by qupath.
the class PathObjectTileCache method getLocator.
PointOnGeometryLocator getLocator(ROI roi, boolean addToCache) {
var locator = locatorMap.get(roi);
if (locator == null) {
var geometry = getGeometry(roi);
if (geometry instanceof Polygonal || geometry instanceof LinearRing)
locator = new IndexedPointInAreaLocator(geometry);
else
locator = new SimplePointInAreaLocator(geometry);
// Workaround for multithreading bug in JTS 1.17.0 - see https://github.com/locationtech/jts/issues/571
locator.locate(new Coordinate());
locatorMap.put(roi, locator);
}
return locator;
}
Aggregations