use of com.revolsys.geometry.model.BoundingBox in project com.revolsys.open by revolsys.
the class Nts1000000RectangularMapGrid method getTileByName.
@Override
public RectangularMapTile getTileByName(final String mapTileName) {
final BoundingBox boundingBox = getBoundingBox(mapTileName);
final double lon = boundingBox.getMaxX();
final double lat = boundingBox.getMinY();
final String name = getMapTileName(lon, lat);
final String formattedMapTileName = getFormattedMapTileName(mapTileName);
return new SimpleRectangularMapTile(this, formattedMapTileName, name, boundingBox);
}
use of com.revolsys.geometry.model.BoundingBox in project com.revolsys.open by revolsys.
the class WmsLayerDefinition method getMapImage.
public GeoreferencedImage getMapImage(final BoundingBox boundingBox, final int imageWidth, final int imageHeight) {
final BoundingBox queryBoundingBox = boundingBox.intersection(getLatLonBoundingBox());
final String srs = "EPSG:" + queryBoundingBox.getCoordinateSystemId();
final WmsClient wmsClient = getWmsClient();
return wmsClient.getMapImage(this.name, getDefaultStyleName(), srs, queryBoundingBox, "image/png", imageWidth, imageHeight);
}
use of com.revolsys.geometry.model.BoundingBox in project com.revolsys.open by revolsys.
the class AbstractGeoreferencedImage method toMap.
@Override
public MapEx toMap() {
final MapEx map = new LinkedHashMapEx();
addTypeToMap(map, "bufferedImage");
final BoundingBox boundingBox = getBoundingBox();
if (boundingBox != null) {
addToMap(map, "boundingBox", boundingBox.toString());
}
final List<MappedLocation> tiePoints = getTiePoints();
addToMap(map, "tiePoints", tiePoints);
return map;
}
use of com.revolsys.geometry.model.BoundingBox in project com.revolsys.open by revolsys.
the class AbstractGeoreferencedImage method getImage.
@Override
public AbstractGeoreferencedImage getImage(final CoordinateSystem coordinateSystem, final double resolution) {
final int imageSrid = getGeometryFactory().getCoordinateSystemId();
if (imageSrid > 0 && imageSrid != coordinateSystem.getCoordinateSystemId()) {
final BoundingBox boundingBox = getBoundingBox();
final ProjectionImageFilter filter = new ProjectionImageFilter(boundingBox, coordinateSystem, resolution);
final BufferedImage newImage = filter.filter(getBufferedImage());
final BoundingBox destBoundingBox = filter.getDestBoundingBox();
return new BufferedGeoreferencedImage(destBoundingBox, newImage);
}
return this;
}
use of com.revolsys.geometry.model.BoundingBox 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