Class RasterRequestParams
- java.lang.Object
-
- RasterRequestParams
-
public class RasterRequestParams extends java.lang.Object
The RasterRequestParams contains the fields received from the browser during a rastering request. This class can either be instantiated through a Spark request query map, or through the Builder class for mocking browser requests during unit testing of Rasterer.getMapRaster.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RasterRequestParams.Builder
-
Field Summary
Fields Modifier and Type Field Description double
h
The height (in pixels) of the browser viewport.double
lrlat
The requested lower-right latitude.double
lrlon
The requested lower-right longitude.private static java.lang.String[]
REQUIRED_PARAMS
Raster requests to the server must have the following keys in the params map.double
ullat
The requested upper-left latitude.double
ullon
The requested upper-left longitude.double
w
The width (in pixels) of the browser viewport.
-
Constructor Summary
Constructors Modifier Constructor Description private
RasterRequestParams()
Constructor with private access to prevent direct instantiation of a RasterRequestParams instance.private
RasterRequestParams(double ullat, double ullon, double lrlat, double lrlon, double w, double h)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RasterRequestParams
from(java.util.Map<java.lang.String,java.lang.String[]> req)
Validate and return a parameter map of the required request parameters.
-
-
-
Field Detail
-
ullat
public final double ullat
The requested upper-left latitude.
-
ullon
public final double ullon
The requested upper-left longitude.
-
lrlat
public final double lrlat
The requested lower-right latitude.
-
lrlon
public final double lrlon
The requested lower-right longitude.
-
w
public final double w
The width (in pixels) of the browser viewport.
-
h
public final double h
The height (in pixels) of the browser viewport.
-
REQUIRED_PARAMS
private static final java.lang.String[] REQUIRED_PARAMS
Raster requests to the server must have the following keys in the params map.
-
-
Constructor Detail
-
RasterRequestParams
private RasterRequestParams()
Constructor with private access to prevent direct instantiation of a RasterRequestParams instance. Use the factory method, from, instead.
-
RasterRequestParams
private RasterRequestParams(double ullat, double ullon, double lrlat, double lrlon, double w, double h)
-
-
Method Detail
-
from
public static RasterRequestParams from(java.util.Map<java.lang.String,java.lang.String[]> req)
Validate and return a parameter map of the required request parameters. Requires that all input parameters are doubles.- Parameters:
req
- HTTP Request- Returns:
- A populated map of input parameter to it's numerical value.
-
-