Commit 60fbe89d authored by lafabregue's avatar lafabregue

small fixes (OGR export, Iterative interface fix)

parent 226b3694
......@@ -1148,8 +1148,9 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
//<<
if (classification instanceof HybridClassification) {
FileWriter fw3 = null;
String concordenceFilePath = "concordence.log";
try {
fw3 = new FileWriter("_concordence.log", true);
fw3 = new FileWriter(concordenceFilePath, true);
} catch (IOException e) {
e.printStackTrace();
}
......@@ -1161,6 +1162,8 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
eval.calGamma(((HybridClassification) classification).getAgents(),
((HybridClassification) classification).getConfig(), null);
out3.println(Arrays.deepToString(eval.omega));
File concoredenceFile = new File(concordenceFilePath);
Packager.zipFile(out, name + "/"+concordenceFilePath, concoredenceFile);
}
//>>
......
......@@ -357,13 +357,14 @@ public class HybridClassificationSubParametersPanel extends JPanel {
*/
private void initToClassification() {
if (samarah != null) {
if (samarah.config.nInf < 0 || samarah.config.nSup < 0) {
if (samarah.config.nInf <= 0 && samarah.config.nSup <= 0) {
jCheckBoxNbClasses.setSelected(false);
jTextFieldNInf.setEnabled(false);
jTextFieldNSup.setEnabled(false);
jTextFieldNInf.setText("");
jTextFieldNSup.setText("");
} else {
nbClass = true;
jCheckBoxNbClasses.setSelected(true);
jTextFieldNInf.setEnabled(true);
jTextFieldNSup.setEnabled(true);
......
......@@ -71,10 +71,12 @@ public class DataOGRExchange {
for (int i = 0 ; i < data.getOneDataObject().getAttributes().length ; i++ ) {
Attribute attr = data.getOneDataObject().getAttribute(0);
if (attr instanceof AttributeNumerical) {
layer.CreateField(new FieldDefn("band_"+i, ogr.OFTReal)); //$NON-NLS-1$
layer.CreateField(new FieldDefn("band"+i, ogr.OFTReal)); //$NON-NLS-1$
} else if (attr instanceof AttributeMultiDimSequence) {
for (int j = 0 ; j < ((AttributeMultiDimSequence) attr).getSequence().length ; j++) {
layer.CreateField(new FieldDefn("band_"+i+"im_"+j, ogr.OFTReal)); //$NON-NLS-1$ //$NON-NLS-2$
for (int k = 0 ; k < ((AttributeMultiDimSequence) attr).getSequence()[j].length ; k++) {
layer.CreateField(new FieldDefn(i+"band"+k+"im"+j, ogr.OFTReal)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
}
......@@ -119,6 +121,7 @@ public class DataOGRExchange {
int width = dataset.GetRasterXSize();
int x = k % width;
int y = k / width;
dataset.delete();
return (geoTransform[0] + x*geoTransform[1] + y*geoTransform[2]) + " " + //$NON-NLS-1$
(geoTransform[3] + x*geoTransform[4] + y*geoTransform[5]);
}
......@@ -135,11 +138,11 @@ public class DataOGRExchange {
private static void setField(Feature feature, Attribute attr, int i) {
if (attr instanceof AttributeNumerical) {
feature.SetField("band_"+i, attr.getValue()); //$NON-NLS-1$
feature.SetField("band"+i, attr.getValue()); //$NON-NLS-1$
} else if (attr instanceof AttributeMultiDimSequence) {
for (int j = 0 ; j < ((AttributeMultiDimSequence) attr).getSequence().length ; j++) {
for (int k = 0 ; k < ((AttributeMultiDimSequence) attr).getSequence()[j].length ; k++) {
feature.SetField("band_"+i+"im_"+j, ((AttributeMultiDimSequence) attr).getSequence()[j][k]); //$NON-NLS-1$ //$NON-NLS-2$
feature.SetField(i+"band"+k+"im"+j, ((AttributeMultiDimSequence) attr).getSequence()[j][k]); //$NON-NLS-1$ //$NON-NLS-2$
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment