Package armyc2.c5isr.web.render
Class WebRenderer
java.lang.Object
armyc2.c5isr.web.render.WebRenderer
Main class for rendering multi-point graphics such as Control Measures, Atmospheric, and Oceanographic.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSinglePointAnchor
(String symbolID) Deprecated.static byte[]
getSinglePointByteArray
(String symbolID) Deprecated.static String
getSinglePointInfo
(String symbolID) Deprecated.static void
static MilStdSymbol
RenderMultiPointAsMilStdSymbol
(String id, String name, String description, String symbolCode, String controlPoints, String altitudeMode, double scale, String bbox, Map<String, String> modifiers, Map<String, String> attributes) Renders all MilStd 2525 multi-point symbols, creating MilStdSymbol that contains the information needed to draw the symbol on the map.static String
RenderSymbol
(String id, String name, String description, String symbolCode, String controlPoints, String altitudeMode, double scale, String bbox, Map<String, String> modifiers, Map<String, String> attributes, int format) Renders all multi-point symbols, creating KML that can be used to draw it on a Google map.static String
RenderSymbol2D
(String id, String name, String description, String symbolCode, String controlPoints, int pixelWidth, int pixelHeight, String bbox, Map<String, String> modifiers, Map<String, String> attributes, int format) Renders all multi-point symbols, creating KML or JSON for the user to parse and render as they like.static void
setLoggingLevel
(int level) \ Set minimum level at which an item can be logged.static void
setLoggingLevel
(Level level) \ Set minimum level at which an item can be logged.static void
setTacticalGraphicPointSize
(int size) Single Point Tactical Graphics are rendered from font files.static void
setUnitPointSize
(int size) Units are rendered from font files.static String
ShouldClipMultipointSymbol
(String symbolID) Returns true if we recommend clipping a particular symbol.
-
Field Details
-
OUTPUT_FORMAT_KML
- See Also:
-
OUTPUT_FORMAT_JSON
Deprecated.- See Also:
-
OUTPUT_FORMAT_GEOJSON
- See Also:
-
OUTPUT_FORMAT_GEOSVG
- See Also:
-
MIN_ALT_DEFAULT
- See Also:
-
MAX_ALT_DEFAULT
- See Also:
-
RADIUS1_DEFAULT
- See Also:
-
RADIUS2_DEFAULT
- See Also:
-
LEFT_AZIMUTH_DEFAULT
- See Also:
-
RIGHT_AZIMUTH_DEFAULT
- See Also:
-
ERR_ATTRIBUTES_NOT_FORMATTED
- See Also:
-
DEFAULT_ATTRIBUTES
- See Also:
-
-
Constructor Details
-
WebRenderer
public WebRenderer()
-
-
Method Details
-
init
-
setLoggingLevel
\ Set minimum level at which an item can be logged. In descending order: OFF = Integer.MAX_VALUE Severe = 1000 Warning = 900 Info = 800 Config = 700 Fine = 500 Finer = 400 Finest = 300 All = Integer.MIN_VALUE Use like WebRenderer.setLoggingLevel(Level.INFO); or Use like WebRenderer.setLoggingLevel(800);- Parameters:
level
- java.util.logging.level
-
setLoggingLevel
\ Set minimum level at which an item can be logged. In descending order: OFF = Integer.MAX_VALUE Severe = 1000 Warning = 900 Info = 800 Config = 700 Fine = 500 Finer = 400 Finest = 300 All = Integer.MIN_VALUE Use like WebRenderer.setLoggingLevel(Level.INFO); or Use like WebRenderer.setLoggingLevel(800);- Parameters:
level
- int
-
setTacticalGraphicPointSize
Single Point Tactical Graphics are rendered from font files. The font size you specify here determines how big the symbols will be rendered. This should be set once at startup.- Parameters:
size
-
-
setUnitPointSize
Units are rendered from font files. The font size you specify here determines how big the symbols will be rendered. This should be set once at startup.- Parameters:
size
-
-
RenderSymbol
public static String RenderSymbol(String id, String name, String description, String symbolCode, String controlPoints, String altitudeMode, double scale, String bbox, Map<String, String> modifiers, Map<String, String> attributes, int format) Renders all multi-point symbols, creating KML that can be used to draw it on a Google map. Multipoint symbols cannot be draw the same at different scales. For instance, graphics with arrow heads will need to redraw arrowheads when you zoom in on it. Similarly, graphics like a Forward Line of Troops drawn with half circles can improve performance if clipped when the parts of the graphic that aren't on the screen. To help readjust graphics and increase performance, this function requires the scale and bounding box to help calculate the new locations.- Parameters:
id
- A unique identifier used to identify the symbol by Google map. The id will be the folder name that contains the graphic.name
- a string used to display to the user as the name of the graphic being created.description
- a brief description about the graphic being made and what it represents.symbolCode
- A 20-30 digit symbolID corresponding to one of the graphics in the MIL-STD-2525DcontrolPoints
- The vertices of the graphics that make up the graphic. Passed in the format of a string, using decimal degrees separating lat and lon by a comma, separating coordinates by a space. The following format shall be used "x1,y1[,z1] [xn,yn[,zn]]..."altitudeMode
- Indicates whether the symbol should interpret altitudes as above sea level or above ground level. Options are "clampToGround", "relativeToGround" (from surface of earth), "absolute" (sea level), "relativeToSeaFloor" (from the bottom of major bodies of water).scale
- A number corresponding to how many meters one meter of our map represents. A value "50000" would mean 1:50K which means for every meter of our map it represents 50000 meters of real world distance.bbox
- The viewable area of the map. Passed in the format of a string "lowerLeftX,lowerLeftY,upperRightX,upperRightY." Not required but can speed up rendering in some cases. example: "-50.4,23.6,-42.2,24.2"modifiers
- keyed using constants from Modifiers. Pass in comma delimited String for modifiers with multiple values like AM, AN & Xattributes
- keyed using constants from MilStdAttributes.format
- An enumeration: 2 for GeoJSON.- Returns:
- A JSON string representation of the graphic.
-
RenderSymbol2D
public static String RenderSymbol2D(String id, String name, String description, String symbolCode, String controlPoints, int pixelWidth, int pixelHeight, String bbox, Map<String, String> modifiers, Map<String, String> attributes, int format) Renders all multi-point symbols, creating KML or JSON for the user to parse and render as they like. This function requires the bounding box to help calculate the new locations.- Parameters:
id
- A unique identifier used to identify the symbol by Google map. The id will be the folder name that contains the graphic.name
- a string used to display to the user as the name of the graphic being created.description
- a brief description about the graphic being made and what it represents.symbolCode
- A 20-30 digit symbolID corresponding to one of the graphics in the MIL-STD-2525DcontrolPoints
- The vertices of the graphics that make up the graphic. Passed in the format of a string, using decimal degrees separating lat and lon by a comma, separating coordinates by a space. The following format shall be used "x1,y1 [xn,yn]..."pixelWidth
- pixel dimensions of the viewable map areapixelHeight
- pixel dimensions of the viewable map areabbox
- The viewable area of the map. Passed in the format of a string "lowerLeftX,lowerLeftY,upperRightX,upperRightY." example: "-50.4,23.6,-42.2,24.2"modifiers
- keyed using constants from Modifiers. Pass in comma delimited String for modifiers with multiple values like AM, AN & Xattributes
- keyed using constants from MilStdAttributes.format
- An enumeration: 2 for GeoJSON.- Returns:
- A JSON (1) or KML (0) string representation of the graphic.
-
RenderMultiPointAsMilStdSymbol
public static MilStdSymbol RenderMultiPointAsMilStdSymbol(String id, String name, String description, String symbolCode, String controlPoints, String altitudeMode, double scale, String bbox, Map<String, String> modifiers, Map<String, String> attributes) Renders all MilStd 2525 multi-point symbols, creating MilStdSymbol that contains the information needed to draw the symbol on the map. DOES NOT support RADARC, CAKE, TRACK etc... ArrayList<Point2D> milStdSymbol.getSymbolShapes.get(index).getPolylines() and ShapeInfo = milStdSymbol.getModifierShapes.get(index).- Parameters:
id
- A unique identifier used to identify the symbol by Google map. The id will be the folder name that contains the graphic.name
- a string used to display to the user as the name of the graphic being created.description
- a brief description about the graphic being made and what it represents.symbolCode
- A 20-30 digit symbolID corresponding to one of the graphics in the MIL-STD-2525DcontrolPoints
- The vertices of the graphics that make up the graphic. Passed in the format of a string, using decimal degrees separating lat and lon by a comma, separating coordinates by a space. The following format shall be used "x1,y1[,z1] [xn,yn[,zn]]..."altitudeMode
- Indicates whether the symbol should interpret altitudes as above sea level or above ground level. Options are "clampToGround", "relativeToGround" (from surface of earth), "absolute" (sea level), "relativeToSeaFloor" (from the bottom of major bodies of water).scale
- A number corresponding to how many meters one meter of our map represents. A value "50000" would mean 1:50K which means for every meter of our map it represents 50000 meters of real world distance.bbox
- The viewable area of the map. Passed in the format of a string "lowerLeftX,lowerLeftY,upperRightX,upperRightY." Not required but can speed up rendering in some cases. example: "-50.4,23.6,-42.2,24.2"modifiers
- Used like: modifiers.put(Modifiers.T_UNIQUE_DESIGNATION_1, "T"); Or modifiers.put(Modifiers.AM_DISTANCE, "1000,2000,3000");attributes
- Used like: attributes.put(MilStdAttributes.LineWidth, "3"); Or attributes.put(MilStdAttributes.LineColor, "#00FF00");- Returns:
- MilStdSymbol
-
getSinglePointAnchor
Deprecated.Given a symbol code meant for a single point symbol, returns the anchor point at which to display that image based off the image returned from the URL of the SinglePointServer.- Parameters:
symbolID
- - the 20-30 digit symbolID of a single point MilStd2525 symbol.- Returns:
- A pixel coordinate of the format "x,y". Returns an empty string if an error occurs.
-
getSinglePointInfo
Deprecated.Given a symbol code meant for a single point symbol, returns the anchor point at which to display that image based off the image returned from the URL of the SinglePointServer.- Parameters:
symbolID
- - the 20-30 digit symbolID of a single point MilStd2525 symbol.- Returns:
- A pixel coordinate of the format "anchorX,anchorY,SymbolBoundsX, SymbolBoundsY,SymbolBoundsWidth,SymbolBoundsHeight,IconWidth,IconHeight". Anchor, represents the center point of the core symbol within the image. The image should be centered on this point. Symbol bounds represents the bounding rectangle of the core symbol within the image. IconWidth/Height represents the height and width of the image in its entirety. Returns an empty string if an error occurs.
-
ShouldClipMultipointSymbol
Returns true if we recommend clipping a particular symbol. Would return false for and Ambush but would return true for a Line of Contact due to the decoration on the line.- Parameters:
symbolID
-- Returns:
-
getSinglePointByteArray
Deprecated.Given a symbol code meant for a single point symbol, returns the symbol as a byte array.- Parameters:
symbolID
- - the 20-30 digit symbolID of a single point MilStd2525 symbol.- Returns:
- byte array.
-