Class RenderingCLI
- java.lang.Object
-
- org.openstreetmap.josm.gui.mappaint.RenderingCLI
-
- All Implemented Interfaces:
CLIModule
public class RenderingCLI extends java.lang.Object implements CLIModule
Command line interface for rendering osm data to an image file.- Since:
- 12906
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
RenderingCLI.Option
(package private) static class
RenderingCLI.RenderingArea
Data class to hold return values fordetermineRenderingArea(DataSet)
.
-
Field Summary
Fields Modifier and Type Field Description private LatLon
argAnchor
private Bounds
argBounds
private RenderingHelper.StyleData
argCurrentStyle
private boolean
argDebug
private java.lang.Double
argHeightM
private java.lang.Integer
argHeightPx
private java.lang.String
argInput
private java.lang.Integer
argMaxImageSize
private java.lang.String
argOutput
private java.lang.String
argProjection
private java.lang.Double
argScale
private java.util.List<RenderingHelper.StyleData>
argStyles
private boolean
argTrace
private java.lang.Double
argWidthM
private java.lang.Integer
argWidthPx
private java.lang.Integer
argZoom
private static int
DEFAULT_MAX_IMAGE_SIZE
static RenderingCLI
INSTANCE
The singleton instance of this class.private static double
PIXEL_PER_METER
-
Constructor Summary
Constructors Constructor Description RenderingCLI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkPreconditions(RenderingHelper rh)
(package private) RenderingCLI.RenderingArea
determineRenderingArea(DataSet ds)
Find the area to render and the scale, given certain command line options and the dataset.java.lang.String
getActionKeyword()
Get the action keyword that the user needs to provide as first command line argument to invoke this module.private static java.lang.String
getHelp()
private java.util.logging.Level
getLogLevel()
private void
handleOption(RenderingCLI.Option o)
private void
handleOption(RenderingCLI.Option o, java.lang.String arg)
(package private) void
initialize()
Initialization.private DataSet
loadDataset()
(package private) void
parseArguments(java.lang.String[] argArray)
Parse command line arguments and do some low-level error checking.void
processArguments(java.lang.String[] argArray)
Process the remaining command line arguments and run any of the requested actions.static void
showHelp()
Displays help on the consoleprivate void
writeImageToFile(java.awt.image.BufferedImage image)
-
-
-
Field Detail
-
INSTANCE
public static final RenderingCLI INSTANCE
The singleton instance of this class.
-
PIXEL_PER_METER
private static final double PIXEL_PER_METER
- See Also:
- Constant Field Values
-
DEFAULT_MAX_IMAGE_SIZE
private static final int DEFAULT_MAX_IMAGE_SIZE
- See Also:
- Constant Field Values
-
argDebug
private boolean argDebug
-
argTrace
private boolean argTrace
-
argInput
private java.lang.String argInput
-
argOutput
private java.lang.String argOutput
-
argStyles
private java.util.List<RenderingHelper.StyleData> argStyles
-
argZoom
private java.lang.Integer argZoom
-
argScale
private java.lang.Double argScale
-
argWidthM
private java.lang.Double argWidthM
-
argHeightM
private java.lang.Double argHeightM
-
argWidthPx
private java.lang.Integer argWidthPx
-
argHeightPx
private java.lang.Integer argHeightPx
-
argProjection
private java.lang.String argProjection
-
argMaxImageSize
private java.lang.Integer argMaxImageSize
-
argCurrentStyle
private RenderingHelper.StyleData argCurrentStyle
-
-
Constructor Detail
-
RenderingCLI
RenderingCLI()
-
-
Method Detail
-
getActionKeyword
public java.lang.String getActionKeyword()
Description copied from interface:CLIModule
Get the action keyword that the user needs to provide as first command line argument to invoke this module.- Specified by:
getActionKeyword
in interfaceCLIModule
- Returns:
- the action keyword of this module
-
processArguments
public void processArguments(java.lang.String[] argArray)
Description copied from interface:CLIModule
Process the remaining command line arguments and run any of the requested actions.- Specified by:
processArguments
in interfaceCLIModule
- Parameters:
argArray
- command line arguments without the initial action keyword
-
parseArguments
void parseArguments(java.lang.String[] argArray)
Parse command line arguments and do some low-level error checking.- Parameters:
argArray
- the arguments array
-
handleOption
private void handleOption(RenderingCLI.Option o)
-
handleOption
private void handleOption(RenderingCLI.Option o, java.lang.String arg)
-
showHelp
public static void showHelp()
Displays help on the console
-
getHelp
private static java.lang.String getHelp()
-
initialize
void initialize()
Initialization. Requires arguments to be parsed already (parseArguments(java.lang.String[])
).
-
getLogLevel
private java.util.logging.Level getLogLevel()
-
determineRenderingArea
RenderingCLI.RenderingArea determineRenderingArea(DataSet ds)
Find the area to render and the scale, given certain command line options and the dataset.- Parameters:
ds
- the dataset- Returns:
- area to render and the scale
-
loadDataset
private DataSet loadDataset() throws java.io.IOException, IllegalDataException
- Throws:
java.io.IOException
IllegalDataException
-
checkPreconditions
private void checkPreconditions(RenderingHelper rh)
-
writeImageToFile
private void writeImageToFile(java.awt.image.BufferedImage image) throws java.io.IOException
- Throws:
java.io.IOException
-
-