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

Method main

swig/java/apps/GDALProximity.java:77–253  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

75 }
76
77 public static void main(String[] args) {
78
79 String SourceFilename = null;
80 String OutputFilename = null;
81
82 /*
83 * Parse arguments
84 */
85
86 int SourceBand = 1;
87 int DestinyBand = 1;
88 float MaxDistance = -1.0F;
89 boolean GeoUnits = false;
90 float Nodata = 0.0F;
91 float BufferValue = 0.0F;
92 boolean hasBufferValue = false;
93 String OutputFormat = "GTiff";
94 String OutputType = "Float32";
95 int TargetValues[] = new int[0];
96 float DistMult = 1.0F;
97 String Options = "";
98
99 for (int i = 0; i < args.length; i++) {
100 if (args[i].equals("-of")) {
101 i++;
102 OutputFormat = args[i];
103 } else if (args[i].equals("-ot")) {
104 i++;
105 OutputType = args[i];
106 } else if (args[i].equals("-maxdist")) {
107 i++;
108 MaxDistance = Float.parseFloat(args[i]);
109 } else if (args[i].equals("-srcband")) {
110 i++;
111 SourceBand = Integer.parseInt(args[i]);
112 } else if (args[i].equals("-dstband")) {
113 i++;
114 DestinyBand = Integer.parseInt(args[i]);
115 } else if (args[i].equals("-distunits")) {
116 i++;
117 if( args[i].equals("geo") ) {
118 GeoUnits = true;
119 } else if ( args[i].equals("pixel") ) {
120 GeoUnits = false;
121 } else {
122 Usage();
123 }
124 } else if (args[i].equals("-nodata")) {
125 i++;
126 Nodata = Float.parseFloat(args[i]);
127 } else if (args[i].equals("-co")) {
128 i++;
129 Options += args[i] + ';';
130 } else if (args[i].equals("-values")) {
131 i++;
132 String valStr[] = args[i].split(",");
133 TargetValues = new int[valStr.length];
134 for (int j = 0; j < valStr.length; j++) {

Callers

nothing calls this directly

Calls 15

UsageMethod · 0.95
RunMethod · 0.95
AllRegisterMethod · 0.80
GetLastErrorNoMethod · 0.80
GetLastErrorMsgMethod · 0.80
IdentifyDriverMethod · 0.80
getRasterXSizeMethod · 0.80
getRasterYSizeMethod · 0.80
getRasterCountMethod · 0.80
GetDataTypeByNameMethod · 0.80
absMethod · 0.80
deleteMethod · 0.80

Tested by

no test coverage detected