MCPcopy Create free account
hub / github.com/OSGeo/gdal / main

Method main

swig/java/apps/GDALContour.java:41–289  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

39 }
40
41 public static void main(String[] args) {
42
43 String sourceFilename = null;
44 String outputFilename = null;
45 int sourceBand = 1;
46 String attributeName = null;
47 boolean threeDimension = false;
48 boolean ignoreNodata = false;
49 boolean hasSourceNodata = false;
50 double sourceNodata = 0.0;
51 String outputFormat = "ESRI Shapefile";
52 double contourInterval = 0.0;
53 double offset = 0.0;
54 String fixedLevels = null;
55 String newLayerName = "contour";
56 boolean quiet = false;
57 ProgressCallback progressCallback = null;
58
59 /*
60 * Register GDAL and OGR format(s)
61 */
62
63 gdal.AllRegister();
64 ogr.RegisterAll();
65
66 /*
67 * Parse arguments
68 */
69
70 args = ogr.GeneralCmdLineProcessor(args);
71
72 if (args.length < 2) {
73 Usage();
74 }
75
76 for (int i = 0; i < args.length; i++) {
77
78 if (args[i].equals("---utility_version")) {
79
80 System.out
81 .println("Running against GDAL " + gdal.VersionInfo());
82 return;
83
84 } else if (args[i].equals("-a") && args.length > i) {
85
86 attributeName = args[++i];
87
88 } else if (args[i].equals("-off") && args.length > i) {
89
90 offset = Float.parseFloat(args[++i]);
91
92 } else if (args[i].equals("-i") && args.length > i) {
93
94 contourInterval = Float.parseFloat(args[++i]);
95
96 } else if (args[i].equals("-fl") && args.length > i) {
97
98 if (fixedLevels == null) {

Callers

nothing calls this directly

Calls 15

UsageMethod · 0.95
lengthMethod · 0.95
AllRegisterMethod · 0.80
VersionInfoMethod · 0.80
GetLastErrorNoMethod · 0.80
GetLastErrorMsgMethod · 0.80
CreateDataSourceMethod · 0.80
deleteMethod · 0.80
OpenMethod · 0.45
GetRasterBandMethod · 0.45
GetNoDataValueMethod · 0.45
GetProjectionMethod · 0.45

Tested by

no test coverage detected