Search in sources :

Example 76 with BoundingBox

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);
}
Also used : BoundingBox(com.revolsys.geometry.model.BoundingBox)

Example 77 with 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);
}
Also used : BoundingBox(com.revolsys.geometry.model.BoundingBox) WmsClient(com.revolsys.gis.wms.WmsClient)

Example 78 with BoundingBox

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;
}
Also used : MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) BoundingBox(com.revolsys.geometry.model.BoundingBox) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 79 with BoundingBox

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;
}
Also used : BoundingBox(com.revolsys.geometry.model.BoundingBox) Point(com.revolsys.geometry.model.Point) BufferedImage(java.awt.image.BufferedImage)

Example 80 with BoundingBox

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);
}
Also used : GeometryFactory(com.revolsys.geometry.model.GeometryFactory) BoundingBox(com.revolsys.geometry.model.BoundingBox) Point(com.revolsys.geometry.model.Point)

Aggregations

BoundingBox (com.revolsys.geometry.model.BoundingBox)307 Point (com.revolsys.geometry.model.Point)83 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)76 ArrayList (java.util.ArrayList)45 Geometry (com.revolsys.geometry.model.Geometry)41 LineString (com.revolsys.geometry.model.LineString)26 List (java.util.List)26 BoundingBoxDoubleXY (com.revolsys.geometry.model.impl.BoundingBoxDoubleXY)19 Polygon (com.revolsys.geometry.model.Polygon)14 PointDoubleXY (com.revolsys.geometry.model.impl.PointDoubleXY)14 Project (com.revolsys.swing.map.layer.Project)14 CreateListVisitor (com.revolsys.visitor.CreateListVisitor)12 CoordinateSystem (com.revolsys.geometry.cs.CoordinateSystem)11 LayerRecord (com.revolsys.swing.map.layer.record.LayerRecord)11 Edge (com.revolsys.geometry.graph.Edge)10 HashMap (java.util.HashMap)10 Record (com.revolsys.record.Record)9 Graphics2D (java.awt.Graphics2D)9 MapEx (com.revolsys.collection.map.MapEx)8 LinearRing (com.revolsys.geometry.model.LinearRing)8