(String[] args)
| 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++) { |
nothing calls this directly
no test coverage detected