This commit is contained in:
Gianpaolo Coro 2012-09-26 16:44:26 +00:00
parent a9e26191f8
commit 515fcf41b3
5 changed files with 60 additions and 19 deletions

16
deployDesktop.jardesc Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jardesc>
<jar path="C:/Users/coro/Desktop/ecological-engine-1.3.0-SNAPSHOT.jar"/>
<options buildIfNeeded="true" compress="true" descriptionLocation="/EcologicalEngine/deployDesktop.jardesc" exportErrors="true" exportWarnings="true" includeDirectoryEntries="false" overwrite="true" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
<selectedProjects/>
<manifest generateManifest="true" manifestLocation="" manifestVersion="1.0" reuseManifest="false" saveManifest="false" usesManifest="true">
<sealing sealJar="false">
<packagesToSeal/>
<packagesToUnSeal/>
</sealing>
</manifest>
<selectedElements exportClassFiles="true" exportJavaFiles="false" exportOutputFolder="false">
<javaElement handleIdentifier="=EcologicalEngine/src\/main\/java"/>
</selectedElements>
</jardesc>

View File

@ -36,21 +36,23 @@ public static void main(String[] args) throws Exception {
trans = null;
*/
/*
trans = TransducerersFactory.getTransducerers(testConfigLocal8());
trans.get(0).init();
Regressor.process(trans.get(0));
trans = null;
/*
trans = TransducerersFactory.getTransducerers(testConfigLocal6());
trans.get(0).init();
Regressor.process(trans.get(0));
trans = null;
*/
trans = TransducerersFactory.getTransducerers(testConfigLocal7());
trans.get(0).init();
Regressor.process(trans.get(0));
trans = null;
*/
}
@ -148,11 +150,15 @@ public static void main(String[] args) throws Exception {
config.setParam("scientificNameColumn", "scientificname");
config.setParam("eventDateColumn", "eventdate");
config.setParam("lastModificationColumn", "modified");
config.setParam("OccurrencePointsTableName", "occurrencetestduplicates");
config.setParam("OccurrencePointsTableName", "occurrence_species_id5397d3c4_a7eb_4227_adb4_d9d7d36e8b21");
config.setParam("finalTableName", "occurrencesnoduplicates");
config.setParam("spatialTolerance", "20");
config.setParam("confidence", "60");
config.setParam("spatialTolerance", "0.5");
config.setParam("confidence", "80");
config.setParam("DatabaseUserName","utente");
config.setParam("DatabasePassword","d4science");
config.setParam("DatabaseURL","jdbc:postgresql://dbtest.next.research-infrastructures.eu/testdb");
config.setParam("DatabaseDriver","org.postgresql.Driver");
return config;
}

View File

@ -23,6 +23,7 @@ public class ExperimentsForLatimeria {
static String absenceRandomTable = "absence_data_latimeria_random";
static String absenceStaticTable = "absence_data_latimeria";
static String presenceTable = "presence_data_latimeria";
static String presenceTableNoEarth = "presence_data_latimeria_sea";
static String envelopeTable = "hspen_latimeria";
static String aquamapsSuitableTable = "hspec_suitable_latimeria_chalumnae";
@ -215,7 +216,7 @@ public class ExperimentsForLatimeria {
trans = null;
}
public static void calcHRS(String hcaf,String absenceTable) throws Exception{
public static void calcHRS(String hcaf,String absenceTable,String presenceTable) throws Exception{
System.out.println("*****************************HRS: "+absenceTable+","+presenceTable+" vs "+hcaf+"************************************");
List<Evaluator> evaluators = null;
evaluators = EvaluatorsFactory.getEvaluators(PresetConfigGenerator.configHRSAnalysis(filteredhcaf, absenceTable, presenceTable));
@ -263,7 +264,7 @@ public class ExperimentsForLatimeria {
//filter the hcaf on Indonesia
calcHRS(filteredhcaf,absenceStaticTable);
// calcHRS(filteredhcaf,absenceStaticTable);
// calcHRS(filteredhcaf,absenceRandomTable);
}
@ -285,6 +286,10 @@ public class ExperimentsForLatimeria {
// generateAquamapsNativeSuitableNeuralNetwokrs();
//Analysis
calcdiscrepancy(aquamapsSuitableTable, nnsuitableTable);
calcdiscrepancy(aquamapsNativeTable, nnnativeTable);
/*
calcdiscrepancy(aquamapsSuitableTable, nnsuitableTable);
calcdiscrepancy(aquamapsNativeTable, nnnativeTable);
@ -292,12 +297,14 @@ public class ExperimentsForLatimeria {
calcquality(aquamapsSuitableTable, presenceTable, absenceStaticTable);
calcquality(nnsuitableTable, presenceTable, absenceStaticTable);
calcHRS(filteredhcaf,absenceStaticTable);
calcHRS(filteredhcaf,null);
*/
calcquality(aquamapsNativeTable, presenceTable, absenceStaticTable);
calcquality(nnnativeTable, presenceTable, absenceStaticTable);
calcHRS(filteredhcaf,absenceStaticTable,presenceTableNoEarth);
calcHRS(filteredhcaf,null,presenceTableNoEarth);
*/
}
}

View File

@ -176,6 +176,7 @@ public class OccurrencePointsDuplicatesDeleter extends OccurrencePointsMerger{
persist();
// close DB connection
} catch (Exception e) {
AnalysisLogger.getLogger().trace("An error occurred "+e.getLocalizedMessage());
throw e;
} finally {
if (dbconnection != null)

View File

@ -146,33 +146,44 @@ public class OccurrencePointsMerger implements Transducerer {
for (Object name : columnsNames) {
String name$ = "" + name;
String value$ = "''";
String value$ = "NULL";
if (name$.equalsIgnoreCase(lonFld)) {
value$ = "'" + record.x + "'";
} else if (name$.equalsIgnoreCase(latFld)) {
value$ = "'" + record.y + "'";
} else if (name$.equalsIgnoreCase(recordedByFld)) {
if (record.recordedby != null)
value$ = "'" + record.recordedby + "'";
value$ = "'" + record.recordedby.replace("'", "") + "'";
} else if (name$.equalsIgnoreCase(scientificNameFld)) {
if (record.scientificName != null)
value$ = "'" + record.scientificName + "'";
value$ = "'" + record.scientificName.replace("'", "") + "'";
} else if (name$.equalsIgnoreCase(eventDatFld)) {
if (record.eventdate != null) {
value$ = "'" + convert2conventionalFormat(record.eventdate) + "'";
String dat = convert2conventionalFormat(record.eventdate);
if ((dat!=null)&&(dat.length()>0))
value$ = "'" + convert2conventionalFormat(record.eventdate) + "'";
else
value$ = "NULL";
// value$="'"+record.eventdate.getTimeInMillis()+"'";
}
} else if (name$.equalsIgnoreCase(modifDatFld)) {
if (record.modifdate != null) {
value$ = "'" + convert2conventionalFormat(record.modifdate) + "'";
String dat = convert2conventionalFormat(record.modifdate) ;
if ((dat!=null)&&(dat.length()>0))
value$ = "'" + convert2conventionalFormat(record.modifdate) + "'";
else
value$ = "NULL";
// value$="'"+record.modifdate.getTimeInMillis()+"'";
}
} else {
if (record.otherValues != null) {
value$ = "'" + record.otherValues.get(k) + "'";
value$ = "'" + record.otherValues.get(k).replace("'", "") + "'";
k++;
}
}
if (value$.equals("'null'"))
value$ = "NULL";
buffer.append(value$);
if (index < nNames - 1) {
buffer.append(",");
@ -404,7 +415,7 @@ public class OccurrencePointsMerger implements Transducerer {
}
String updateQ = DatabaseUtils.insertFromBuffer(finalTableName, columns.toString(), buffer);
// System.out.println("Update:\n"+updateQ);
System.out.println("Update:\n"+updateQ);
AnalysisLogger.getLogger().debug("Update:\n"+updateQ);
DatabaseFactory.executeSQLUpdate(updateQ, dbconnection);
AnalysisLogger.getLogger().debug("Objects inserted");