Gianpaolo Coro 2015-01-07 11:59:26 +00:00
parent 1ac49fecf4
commit 0ec883c920
5 changed files with 136 additions and 4 deletions

View File

@ -35,7 +35,7 @@ public class ThreddsFetcher {
for (String filename : filesURL) {
if (!filename.endsWith(".nc"))
continue;
// if (!filename.equalsIgnoreCase("geo_filt_070620-070725-sim_HDR_4rlks_CLIMATOLOGY_METEOROLOGY_ATMOSPHERE_.nc"))
// if (!filename.equalsIgnoreCase("bathymetrycf2_CLIMATOLOGY_METEOROLOGY_ATMOSPHERE_.nc"))
// continue;
String url = OGCFormatter.getOpenDapURL(threddsCatalogURL, filename);

View File

@ -0,0 +1,87 @@
package org.gcube.dataanalysis.geo.test.infra;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.List;
import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger;
import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
import org.gcube.dataanalysis.geo.infrastructure.GeoNetworkInspector;
import org.gcube.dataanalysis.geo.matrixmodel.MatrixExtractor;
import org.opengis.metadata.Metadata;
public class RetrieveOGCLinks {
static String scope = "/d4science.research-infrastructures.eu/gCubeApps/BiodiversityLab";
public static void main(String[] args) throws Exception{
AlgorithmConfiguration config = new AlgorithmConfiguration();
AnalysisLogger.setLogger("./cfg/ALog.properties");
config.setConfigPath("./cfg/");
config.setPersistencePath("./");
config.setParam("DatabaseUserName", "gcube");
config.setParam("DatabasePassword", "d4science2");
config.setParam("DatabaseURL", "jdbc:postgresql://localhost/testdb");
config.setParam("DatabaseDriver", "org.postgresql.Driver");
config.setGcubeScope("/gcube/devsec/devVRE");
MatrixExtractor extractor = new MatrixExtractor(config);
extractor.getConnector("http://geoserver.d4science-ii.research-infrastructures.eu/geoserver/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=lluidiamaculata20121218223748535cet&format=json&maxfeatures=1", 0.5);
}
public static void main1(String[] args) throws Exception{
AnalysisLogger.setLogger("./cfg/ALog.properties");
GeoNetworkInspector gnInspector = new GeoNetworkInspector();
gnInspector.setScope(scope);
BufferedReader br = new BufferedReader(new FileReader(new File("AquamapsSpecies.txt")));
String line = br.readLine();
BufferedWriter bw = new BufferedWriter(new FileWriter(new File("AquamapsSpeciesLinks.csv")));
System.out.println("speciesname,WMS,WFS,algorithm,abstract");
bw.write("speciesname,WMS,WFS,algorithm,abstract\n");
while (line!=null){
String speciesname = line;
List<Metadata> metadts = gnInspector.getAllGNInfobyTitle(speciesname, "1");
for (Metadata meta:metadts){
String abstractS = ""+meta.getIdentificationInfo().iterator().next().getAbstract();
String WFS = gnInspector.getWFSLink(meta);
String WMS = gnInspector.getWFSLink(meta);
String algoritm = "OTHER";
if (abstractS.contains("AquaMaps NativeRange2050 algorithm")){
algoritm = "NATIVE 2050";
}
else if (abstractS.contains("AquaMaps SuitableRange algorithm")){
algoritm = "SUITABLE";
}
else if (abstractS.contains("AquaMaps SuitableRange2050 algorithm")){
algoritm = "SUITABLE 2050";
}
else if (abstractS.contains("AquaMaps NativeRange algorithm")){
algoritm = "NATIVE";
}
String outstring = speciesname+",\""+WMS+"\",\""+WFS+"\","+algoritm+",\""+abstractS.replace("\"", "")+"\"";
// System.out.println(abstractS);
System.out.println(outstring);
bw.write(outstring+"\n");
//System.out.println("WFS = "+gnInspector.getWFSLink(meta));
//System.out.println("ABSTRACT = "+meta.getIdentificationInfo().iterator().next().getAbstract());
}
line = br.readLine();
}
bw.close();
br.close();
}
}

View File

@ -32,9 +32,13 @@ public class TestMapsComparison {
//String layertitle = "Sarda orientalis";
//String layertitle2 = "FAO aquatic species distribution map of Sarda chiliensis";
String layertitle2 = "4e5c1bbf-f5ce-4b66-a67c-14d7d9920aa0";
String layertitle = "38b2eb74-1c07-4569-8a81-36ac2f973146";
// String layertitle2 = "4e5c1bbf-f5ce-4b66-a67c-14d7d9920aa0";
// String layertitle = "38b2eb74-1c07-4569-8a81-36ac2f973146";
String layertitle = "http://geoserver.d4science-ii.research-infrastructures.eu/geoserver/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=lluidiamaculata20121218223748535cet&format=json&maxfeatures=1";
String layertitle2 = "http://geoserver.d4science-ii.research-infrastructures.eu/geoserver/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=lluidiamaculata20121218223748535cet&format=json&maxfeatures=1";
AnalysisLogger.setLogger(cfg+AlgorithmConfiguration.defaultLoggerFile);
AlgorithmConfiguration config = new AlgorithmConfiguration();
config.setConfigPath(cfg);

View File

@ -0,0 +1,39 @@
package org.gcube.dataanalysis.geo.test.maps;
import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger;
import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
import org.gcube.dataanalysis.geo.algorithms.MapsComparator;
import org.gcube.dataanalysis.geo.matrixmodel.MatrixExtractor;
import org.gcube.dataanalysis.geo.matrixmodel.RasterTable;
public class TestMapsComparisonArchiteuthis {
static String cfg = "./cfg/";
public static void main(String[] args) throws Exception{
String layertitle = "96575f38-583c-4b6c-926f-e804156c7baa";
String layertitle2 = "f9a831c0-143f-4792-a5d9-896d72db73f6";
AnalysisLogger.setLogger(cfg+AlgorithmConfiguration.defaultLoggerFile);
AlgorithmConfiguration config = new AlgorithmConfiguration();
config.setConfigPath(cfg);
config.setPersistencePath("./");
config.setParam("DatabaseUserName","utente");
config.setParam("DatabasePassword","d4science");
config.setParam("DatabaseURL","jdbc:postgresql://statistical-manager.d.d4science.org/testdb");
config.setParam("DatabaseDriver","org.postgresql.Driver");
config.setParam("Layer_1",layertitle);
config.setParam("Layer_2",layertitle2);
config.setParam("ValuesComparisonThreshold","0.5");
config.setParam("KThreshold","0.5");
config.setParam("Z","0");
config.setGcubeScope("/gcube/devsec/devVRE");
MapsComparator mc = new MapsComparator();
mc.setConfiguration(config);
mc.init();
mc.compute();
mc.getOutput();
}
}

View File

@ -55,7 +55,9 @@ public class TestXYExtractionConnectors {
static String[] urlToTest_ = { "https://dl.dropboxusercontent.com/u/12809149/layer1.asc", "http://thredds.research-infrastructures.eu/thredds/fileServer/public/netcdf/ph.asc", "http://thredds.research-infrastructures.eu/thredds/fileServer/public/netcdf/calcite.asc",
"https://dl.dropboxusercontent.com/u/12809149/wind1.tif",
"http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/WOA2005TemperatureAnnual_CLIMATOLOGY_METEOROLOGY_ATMOSPHERE_.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/salinity_annual_1deg_ENVIRONMENT_OCEANS_.nc", "http://thredds.d4science.org/thredds/fileServer/public/netcdf/global-reanalysis-phys-001-004-b-ref-fr-mjm95-icemod_ENVIRONMENT_OCEANS_CLIMATOLOGY_METEOROLOGY_ATMOSPHERE_1366211441189.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/CERSAT-GLO-CLIM_WIND_L4-OBS_FULL_TIME_SERIE_CLIMATOLOGY_METEOROLOGY_ATMOSPHERE_1366217956317.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/phosphate_seasonal_5deg_ENVIRONMENT_BIOTA_.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/global-analysis-bio-001-008-_a_BIOTA_ENVIRONMENT_1366217546908.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/dissolved_oxygen_annual_1deg_ENVIRONMENT_BIOTA_.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/global-reanalysis-phys-001-004-b-ref-fr-mjm95-gridv_OCEANS_CLIMATOLOGY_METEOROLOGY_ATMOSPHERE_1366211498692.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/nitrate_seasonal_5deg_ENVIRONMENT_BIOTA_.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/global-analysis-bio-001-008-a_BIOTA_ENVIRONMENT_1366217608283.nc", "http://thredds.research-infrastructures.eu/thredds/fileServer/public/netcdf/cloudmean.asc", "http://geoserver-dev.d4science-ii.research-infrastructures.eu/geoserver/wcs/wcs?service=wcs&version=1.0.0&request=GetCoverage&coverage=aquamaps:WorldClimBio2&CRS=EPSG:4326&bbox=-180,0,180,90&width=1&height=1&format=geotiff&RESPONSE_CRS=EPSG:4326", "http://geoserver2.d4science.research-infrastructures.eu/geoserver"
"http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/WOA2005TemperatureAnnual_CLIMATOLOGY_METEOROLOGY_ATMOSPHERE_.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/salinity_annual_1deg_ENVIRONMENT_OCEANS_.nc", "http://thredds.d4science.org/thredds/fileServer/public/netcdf/global-reanalysis-phys-001-004-b-ref-fr-mjm95-icemod_ENVIRONMENT_OCEANS_CLIMATOLOGY_METEOROLOGY_ATMOSPHERE_1366211441189.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/CERSAT-GLO-CLIM_WIND_L4-OBS_FULL_TIME_SERIE_CLIMATOLOGY_METEOROLOGY_ATMOSPHERE_1366217956317.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/phosphate_seasonal_5deg_ENVIRONMENT_BIOTA_.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/global-analysis-bio-001-008-_a_BIOTA_ENVIRONMENT_1366217546908.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/dissolved_oxygen_annual_1deg_ENVIRONMENT_BIOTA_.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/global-reanalysis-phys-001-004-b-ref-fr-mjm95-gridv_OCEANS_CLIMATOLOGY_METEOROLOGY_ATMOSPHERE_1366211498692.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/nitrate_seasonal_5deg_ENVIRONMENT_BIOTA_.nc", "http://thredds.research-infrastructures.eu/thredds/dodsC/public/netcdf/global-analysis-bio-001-008-a_BIOTA_ENVIRONMENT_1366217608283.nc", "http://thredds.research-infrastructures.eu/thredds/fileServer/public/netcdf/cloudmean.asc",
"http://geoserver-dev.d4science-ii.research-infrastructures.eu/geoserver/wcs/wcs?service=wcs&version=1.0.0&request=GetCoverage&coverage=aquamaps:WorldClimBio2&CRS=EPSG:4326&bbox=-180,0,180,90&width=1&height=1&format=geotiff&RESPONSE_CRS=EPSG:4326",
"http://geoserver2.d4science.research-infrastructures.eu/geoserver"
};