use of com.revolsys.geometry.model.GeometryFactory in project com.revolsys.open by revolsys.
the class BoundingBoxTaskSplitter method run.
@Override
public void run() {
preRun();
try {
if (this.boundingBox != null) {
final GeometryFactory geometryFactory = this.boundingBox.getGeometryFactory();
final double xInc = this.boundingBox.getWidth() / this.numX;
final double yInc = this.boundingBox.getHeight() / this.numY;
double y = this.boundingBox.getMinY();
for (int j = 0; j < this.numX; j++) {
double x = this.boundingBox.getMinX();
for (int i = 0; i < this.numX; i++) {
final BoundingBox cellBoundingBox = geometryFactory.newBoundingBox(x, y, x + xInc, y + yInc);
if (this.preparedBoundary == null || this.preparedBoundary.intersects(cellBoundingBox.toPolygon(50))) {
if (this.logScriptInfo) {
Logs.info(this, "Processing bounding box " + cellBoundingBox.toPolygon(1));
}
execute(cellBoundingBox);
}
x += xInc;
}
y += yInc;
}
}
} finally {
postRun();
}
}
use of com.revolsys.geometry.model.GeometryFactory in project com.revolsys.open by revolsys.
the class WmsClient method getGeometryFactory.
public static GeometryFactory getGeometryFactory(final String srs) {
final int coordinateSystemId = getCoordinateSystemId(srs);
final GeometryFactory geometryFactory = GeometryFactory.floating2d(coordinateSystemId);
return geometryFactory;
}
use of com.revolsys.geometry.model.GeometryFactory in project com.revolsys.open by revolsys.
the class AbstractGeoreferencedImage method setTiePoints.
@Override
public void setTiePoints(final List<MappedLocation> tiePoints) {
if (!DataType.equal(tiePoints, this.tiePoints)) {
for (final MappedLocation mappedLocation : this.tiePoints) {
mappedLocation.removePropertyChangeListener(this);
}
this.tiePoints.clear();
this.tiePoints.addAll(tiePoints);
final GeometryFactory geometryFactory = getGeometryFactory();
for (final MappedLocation mappedLocation : tiePoints) {
mappedLocation.setGeometryFactory(geometryFactory);
mappedLocation.addPropertyChangeListener(this);
}
setHasChanges(true);
}
}
use of com.revolsys.geometry.model.GeometryFactory in project com.revolsys.open by revolsys.
the class AbstractGeoreferencedImage method loadProjectionFile.
protected void loadProjectionFile() {
final Resource resource = getImageResource();
final GeometryFactory geometryFactory = GeometryFactory.floating2d(resource);
setGeometryFactory(geometryFactory);
}
use of com.revolsys.geometry.model.GeometryFactory in project com.revolsys.open by revolsys.
the class GeoreferencedImage method setBoundingBox.
default void setBoundingBox(final double minX, final double maxY, final double pixelWidth, final double pixelHeight) {
final GeometryFactory geometryFactory = getGeometryFactory();
final int imageWidth = getImageWidth();
final double maxX = minX + pixelWidth * imageWidth;
final int imageHeight = getImageHeight();
final double minY = maxY + pixelHeight * imageHeight;
final BoundingBox boundingBox = geometryFactory.newBoundingBox(minX, maxY, maxX, minY);
setBoundingBox(boundingBox);
}
Aggregations