24{
25 TCLAP::CmdLine cmd(
26 "Create a raster of specified size at specified origin where every "
27 "pixel has the value zero.\n\n"
28 "OpenGeoSys-6 software, version " +
30 ".\n"
31 "Copyright (c) 2012-2024, OpenGeoSys Community "
32 "(http://www.opengeosys.org)",
34
35 TCLAP::ValueArg<std::string> output_arg("o", "output",
36 "Name of the output raster (*.asc)",
37 true, "", "output file name");
38 cmd.add(output_arg);
39 TCLAP::ValueArg<std::size_t> n_rows("r", "n_rows", "number of rows", false,
40 1000, "positive integer value");
41 cmd.add(n_rows);
42 TCLAP::ValueArg<std::size_t> n_cols("c",
43 "n_cols",
44 "number of columns",
45 false,
46 1000,
47 "positive integer value");
48 cmd.add(n_cols);
49 TCLAP::ValueArg<double> cell_size("s", "cell_size", "cell size", false,
50 10.0, "double value");
51 cmd.add(cell_size);
52 TCLAP::ValueArg<double> ll_y_arg(
53 "",
54 "ll_y",
55 "y coordinate of lower left point of axis aligned rectangular region",
56 false,
57 0,
58 "double value");
59 cmd.add(ll_y_arg);
60 TCLAP::ValueArg<double> ll_x_arg(
61 "",
62 "ll_x",
63 "x coordinate of lower left point of axis aligned rectangular region",
64 false,
65 0,
66 "double value");
67 cmd.add(ll_x_arg);
68
69 cmd.parse(argc, argv);
70
72
74 n_cols.getValue(),
75 n_rows.getValue(),
76 0,
78 cell_size.getValue(),
79 -9999};
80 std::vector<double> raster_data(header.n_cols * header.n_rows, 0.0);
82
84 output_arg.getValue());
85
86 return EXIT_SUCCESS;
87}
static void writeRasterAsASC(GeoLib::Raster const &raster, std::string const &file_name)
Writes an Esri asc-file.
Class Raster is used for managing raster data.
std::vector< double >::const_iterator begin() const
GITINFOLIB_EXPORT const std::string ogs_version