(Layer srcLayer, Dataset dstDS,
Geometry clipSrc, int sizeX, int sizeY, int bandIndex,
boolean[] isXExtentSet, boolean[] isYExtentSet, double[] minX,
double[] maxX, double[] minY, double[] maxY, String burnAttribute,
int type, String algorithmAndOptions, boolean quiet,
ProgressCallback progressCallback)
| 120 | * burn values. |
| 121 | */ |
| 122 | public static void ProcessLayer(Layer srcLayer, Dataset dstDS, |
| 123 | Geometry clipSrc, int sizeX, int sizeY, int bandIndex, |
| 124 | boolean[] isXExtentSet, boolean[] isYExtentSet, double[] minX, |
| 125 | double[] maxX, double[] minY, double[] maxY, String burnAttribute, |
| 126 | int type, String algorithmAndOptions, boolean quiet, |
| 127 | ProgressCallback progressCallback) { |
| 128 | |
| 129 | /* |
| 130 | * Get field index, and check. |
| 131 | */ |
| 132 | |
| 133 | int burnFieldIndex = -1; |
| 134 | |
| 135 | if (burnAttribute != null) { |
| 136 | |
| 137 | burnFieldIndex = srcLayer.GetLayerDefn().GetFieldIndex( |
| 138 | burnAttribute); |
| 139 | |
| 140 | if (burnFieldIndex == -1) { |
| 141 | |
| 142 | System.out.println("Failed to find field " + burnAttribute |
| 143 | + " on layer " + srcLayer.GetLayerDefn().GetName()); |
| 144 | return; |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | /* |
| 149 | * Collect the geometries from this layer, and build list of values to |
| 150 | * be interpolated. |
| 151 | */ |
| 152 | |
| 153 | Feature feature; |
| 154 | |
| 155 | List<Double> X = new ArrayList<Double>(); |
| 156 | List<Double> Y = new ArrayList<Double>(); |
| 157 | List<Double> Z = new ArrayList<Double>(); |
| 158 | |
| 159 | srcLayer.ResetReading(); |
| 160 | |
| 161 | while ((feature = srcLayer.GetNextFeature()) != null) { |
| 162 | |
| 163 | Geometry geometry = feature.GetGeometryRef(); |
| 164 | |
| 165 | if (geometry != null) { |
| 166 | |
| 167 | int geomtype = geometry.GetGeometryType() |
| 168 | & (~ogrConstants.wkb25DBit); |
| 169 | |
| 170 | double burnValue = 0.0; |
| 171 | |
| 172 | if (burnFieldIndex >= 0) { |
| 173 | |
| 174 | burnValue = feature.GetFieldAsDouble(burnFieldIndex); |
| 175 | } |
| 176 | |
| 177 | if (geomtype == ogr.wkbMultiPoint) { |
| 178 | |
| 179 | int geomIndex = 0; |
no test coverage detected