public class GeoUtils extends Object
Constructor and Description |
---|
GeoUtils() |
Modifier and Type | Method and Description |
---|---|
static List<GeneralPath> |
areaToSubPaths(Area area,
double deltaX)
Turns an area into one or multiple paths.
|
static org.locationtech.jts.geom.Geometry |
computeGeometryUsingPixelRegion(GeoCoding rasterGeoCoding,
Rectangle pixelRegion) |
static Rectangle |
computePixelRegionUsingGeometry(GeoCoding rasterGeoCoding,
int rasterWidth,
int rasterHeight,
org.locationtech.jts.geom.Geometry geometryRegion,
int numBorderPixels,
boolean roundPixelRegion,
boolean multiSize) |
static org.locationtech.jts.geom.Geometry |
computeRasterGeometry(GeoCoding rasterGeoCoding,
int rasterWidth,
int rasterHeight) |
static org.locationtech.jts.geom.Geometry |
computeRasterGeometry(GeoCoding rasterGeoCoding,
int rasterWidth,
int rasterHeight,
boolean usePixelCenter,
boolean multiSize) |
static GeoPos[] |
createGeoBoundary(Product product,
int step)
Creates the geographical boundary of the given product and returns it as a list of geographical coordinates.
|
static GeoPos[] |
createGeoBoundary(Product product,
Rectangle region,
int step,
boolean usePixelCenter)
Creates the geographical boundary of the given region within the given product and returns it as a list of
geographical coordinates.
|
static GeoPos[] |
createGeoBoundary(RasterDataNode raster,
Rectangle region,
int step)
Creates the geographical boundary of the given region within the given raster and returns it as a list of
geographical coordinates.
|
static GeoPos[] |
createGeoBoundary(RasterDataNode rasterDataNode,
Rectangle region,
int step,
boolean usePixelCenter)
Creates the geographical boundary of the given region within the given RasterDataNode and returns it as a list of
geographical coordinates.
|
static GeneralPath[] |
createGeoBoundaryPaths(Product product)
Converts the geographic boundary entire product into one, two or three shape objects.
|
static GeneralPath[] |
createGeoBoundaryPaths(Product product,
Rectangle region,
int step)
Converts the geographic boundary of the region within the given product into one, two or three shape objects.
|
static GeneralPath[] |
createGeoBoundaryPaths(Product product,
Rectangle region,
int step,
boolean usePixelCenter)
Converts the geographic boundary of the region within the given product into one, two or three shape objects.
|
static GeneralPath[] |
createGeoBoundaryPaths(RasterDataNode rasterDataNode)
Converts the geographic boundary entire raster data node into one, two or three shape objects.
|
static GeneralPath[] |
createGeoBoundaryPaths(RasterDataNode rasterDataNode,
Rectangle region,
int step,
boolean usePixelCenter)
Converts the geographic boundary of the region within the given rastrer data node into one, two or three shape objects.
|
static PixelPos[] |
createPixelBoundary(int rasterWidth,
int rasterHeight,
Rectangle rect,
int step)
Creates a rectangular boundary expressed in pixel positions for the given source rectangle.
|
static PixelPos[] |
createPixelBoundary(RasterDataNode raster,
Rectangle rect,
int step)
Creates a rectangular boundary expressed in pixel positions for the given source rectangle.
|
static PixelPos[] |
createPixelBoundaryFromRect(Rectangle rect,
int step)
Creates a rectangular boundary expressed in pixel positions for the given source rectangle.
|
public static GeoPos[] createGeoBoundary(Product product, int step)
product
- the input product, must not be nullstep
- the step given in pixelsIllegalArgumentException
- if product is null or if the product's GeoCoding
is nullpublic static GeoPos[] createGeoBoundary(Product product, Rectangle region, int step, boolean usePixelCenter)
product
- the input product, must not be nullregion
- the region rectangle in product pixel coordinates, can be null for entire productstep
- the step given in pixelsusePixelCenter
- true
if the pixel center should be used to create the boundaryIllegalArgumentException
- if product is null or if the product's GeoCoding
is nullpublic static GeoPos[] createGeoBoundary(RasterDataNode raster, Rectangle region, int step)
raster
- the input raster, must not be nullregion
- the region rectangle in raster pixel coordinates, can be null for entire rasterstep
- the step given in pixelsIllegalArgumentException
- if raster is null or if the raster has no GeoCoding
is nullcreatePixelBoundary(RasterDataNode, java.awt.Rectangle, int)
public static GeoPos[] createGeoBoundary(RasterDataNode rasterDataNode, Rectangle region, int step, boolean usePixelCenter)
rasterDataNode
- the input rasterDataNode, must not be nullregion
- the region rectangle in product pixel coordinates, can be null for entire productstep
- the step given in pixelsusePixelCenter
- true
if the pixel center should be used to create the boundaryIllegalArgumentException
- if product is null or if the product's GeoCoding
is nullpublic static GeneralPath[] createGeoBoundaryPaths(Product product)
The geographic boundary of the given product are returned as shapes comprising (longitude,latitude) pairs.
product
- the input productIllegalArgumentException
- if product is null or if the product's GeoCoding
is nullcreateGeoBoundary(Product, int)
public static GeneralPath[] createGeoBoundaryPaths(RasterDataNode rasterDataNode)
The geographic boundary of the given raster data node are returned as shapes comprising (longitude,latitude) pairs.
rasterDataNode
- the input raster data nodeIllegalArgumentException
- if product is null or if the product's GeoCoding
is nullcreateGeoBoundary(Product, int)
public static GeneralPath[] createGeoBoundaryPaths(Product product, Rectangle region, int step)
This method delegates to createGeoBoundaryPaths(Product, Rectangle, int, boolean)
and the additional parameter usePixelCenter
is true
.
The geographic boundary of the given product are returned as shapes comprising (longitude,latitude) pairs.
product
- the input productregion
- the region rectangle in product pixel coordinates, can be null for entire productstep
- the step given in pixelsIllegalArgumentException
- if product is null or if the product's GeoCoding
is nullpublic static GeneralPath[] createGeoBoundaryPaths(Product product, Rectangle region, int step, boolean usePixelCenter)
The geographic boundary of the given product are returned as shapes comprising (longitude,latitude) pairs.
product
- the input productregion
- the region rectangle in product pixel coordinates, can be null for entire productstep
- the step given in pixelsusePixelCenter
- true
if the pixel center should be used to create the pathesIllegalArgumentException
- if product is null or if the product's GeoCoding
is nullcreateGeoBoundary(Product, java.awt.Rectangle, int, boolean)
public static GeneralPath[] createGeoBoundaryPaths(RasterDataNode rasterDataNode, Rectangle region, int step, boolean usePixelCenter)
The geographic boundary of the given raster data node are returned as shapes comprising (longitude,latitude) pairs.
rasterDataNode
- the input raster data noderegion
- the region rectangle in product pixel coordinates, can be null for entire productstep
- the step given in pixelsusePixelCenter
- true
if the pixel center should be used to create the pathesIllegalArgumentException
- if product is null or if the product's GeoCoding
is nullcreateGeoBoundary(Product, java.awt.Rectangle, int, boolean)
public static PixelPos[] createPixelBoundary(RasterDataNode raster, Rectangle rect, int step)
rect
is 100 x 50 pixels and step
is 10 the returned array will countain exactly 2 * 10
+ 2 * (5 - 2) = 26 pixel positions.
This method is used for an intermediate step when determining a raster boundary expressed in geographical co-ordinates.
raster
- the rasterrect
- the source rectanglestep
- the mean distance from one pixel position to the other in the returned arraypublic static PixelPos[] createPixelBoundary(int rasterWidth, int rasterHeight, Rectangle rect, int step)
rect
is 100 x 50 pixels and step
is 10 the returned array will contain exactly 2 * 10
+ 2 * (5 - 2) = 26 pixel positions.
This method is used for an intermediate step when determining a raster boundary expressed in geographical co-ordinates.
rasterWidth
- the raster width in pixelsrasterHeight
- the raster height in pixelsrect
- the source rectanglestep
- the mean distance from one pixel position to the other in the returned arraypublic static PixelPos[] createPixelBoundaryFromRect(Rectangle rect, int step)
rect
is 100 x 50 pixels and step
is 10 the returned array will contain exactly 2 * 10
+ 2 * (5 - 2) = 26 pixel positions.
This method is used for an intermediate step when determining a product boundary expressed in geographical co-ordinates.
This method delegates to createPixelBoundaryFromRect(Rectangle, int, boolean)
and the additional boolean parameter usePixelCenter
is true
.
rect
- the source rectanglestep
- the mean distance from one pixel position to the other in the returned arraypublic static List<GeneralPath> areaToSubPaths(Area area, double deltaX)
area
- the area to convertdeltaX
- the value is used to translate the x-cordinatespublic static Rectangle computePixelRegionUsingGeometry(GeoCoding rasterGeoCoding, int rasterWidth, int rasterHeight, org.locationtech.jts.geom.Geometry geometryRegion, int numBorderPixels, boolean roundPixelRegion, boolean multiSize)
public static org.locationtech.jts.geom.Geometry computeGeometryUsingPixelRegion(GeoCoding rasterGeoCoding, Rectangle pixelRegion)
public static org.locationtech.jts.geom.Geometry computeRasterGeometry(GeoCoding rasterGeoCoding, int rasterWidth, int rasterHeight)
public static org.locationtech.jts.geom.Geometry computeRasterGeometry(GeoCoding rasterGeoCoding, int rasterWidth, int rasterHeight, boolean usePixelCenter, boolean multiSize)
Copyright © 2014–2022 European Space Agency (ESA). All rights reserved.