changed algorithms definitions

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngineGeoSpatialExtension@83060 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Gianpaolo Coro 2013-10-11 15:45:22 +00:00
parent af929ed1f1
commit 4e48d971f5
3 changed files with 58 additions and 63 deletions

70
pom.xml
View File

@ -9,7 +9,7 @@
</parent> </parent>
<groupId>org.gcube.dataanalysis</groupId> <groupId>org.gcube.dataanalysis</groupId>
<artifactId>ecological-engine-geospatial-extensions</artifactId> <artifactId>ecological-engine-geospatial-extensions</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.1.0-SNAPSHOT</version>
<name>ecological-engine-geospatial-extension</name> <name>ecological-engine-geospatial-extension</name>
<description>ecological-engine-geospatial-extension</description> <description>ecological-engine-geospatial-extension</description>
<properties> <properties>
@ -19,12 +19,12 @@
<dependency> <dependency>
<groupId>org.gcube.dataanalysis</groupId> <groupId>org.gcube.dataanalysis</groupId>
<artifactId>ecological-engine</artifactId> <artifactId>ecological-engine</artifactId>
<version>1.7.0-SNAPSHOT</version> <version>1.7.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.spatial.data</groupId> <groupId>org.gcube.spatial.data</groupId>
<artifactId>geonetwork</artifactId> <artifactId>geonetwork</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>2.0.0-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jdom</groupId> <groupId>org.jdom</groupId>
@ -32,25 +32,30 @@
<version>1.1</version> <version>1.1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.externals</groupId> <groupId>geoutils-custom</groupId>
<artifactId>geo-utils-custom-opendap</artifactId> <artifactId>bounce</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.gcube.externals</groupId>
<artifactId>geo-utils-custom-netcdfui</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>org.gcube.externals</groupId>
<artifactId>geo-utils-custom-netcdf</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>org.gcube.externals</groupId>
<artifactId>geo-utils-custom-bounce</artifactId>
<version>0.14.0</version> <version>0.14.0</version>
</dependency> </dependency>
<dependency>
<groupId>geoutils-custom</groupId>
<artifactId>geopeo</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>geoutils-custom</groupId>
<artifactId>netcdf</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>geoutils-custom</groupId>
<artifactId>netcdfUI</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>geoutils-custom</groupId>
<artifactId>opendap</artifactId>
<version>2.2.0</version>
</dependency>
<dependency> <dependency>
<groupId>commons-codec</groupId> <groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId> <artifactId>commons-codec</artifactId>
@ -81,31 +86,6 @@
<artifactId>common-utils-encryption</artifactId> <artifactId>common-utils-encryption</artifactId>
<version>[1.0.2-SNAPSHOT,2.0.0-SNAPSHOT)</version> <version>[1.0.2-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<dependency>
<groupId>org.gcube.externals</groupId>
<artifactId>geo-utils-custom-opendap</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>org.gcube.externals</groupId>
<artifactId>geo-utils-custom-netcdfui</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>org.gcube.externals</groupId>
<artifactId>geo-utils-custom-netcdf</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>org.gcube.externals</groupId>
<artifactId>geo-utils-custom-bounce</artifactId>
<version>0.14.0</version>
</dependency>
<dependency>
<groupId>org.gcube.externals</groupId>
<artifactId>geo-utils-custom-geopeo</artifactId>
<version>1.0.2-min</version>
</dependency>
</dependencies> </dependencies>
<repositories> <repositories>
<!-- <repository> <id>GeoSolutions</id> <url>http://maven.research-infrastructures.eu:8081/nexus/content/repositories/geo-solutions/</url> <!-- <repository> <id>GeoSolutions</id> <url>http://maven.research-infrastructures.eu:8081/nexus/content/repositories/geo-solutions/</url>

View File

@ -60,7 +60,7 @@ public class MapsComparator extends DataAnalysis {
@Override @Override
public String getDescription() { public String getDescription() {
return "An algorithm for comparing two OGC/NetCDF maps in seamless way to the user. Supported maps can only be in WFS, Opendap or ASC formats."; return "An algorithm for comparing two OGC/NetCDF maps in seamless way to the user. Supported maps can only be in WFS, Opendap or ASC formats. The algorithm assesses the similarities between two geospatial maps by comparing them in a point-to-point fashion. It accepts as input the two geospatial maps (via their UUIDs in the infrastructure spatial data repository - recoverable through the Geoexplorer portlet) and some parameters affecting the comparison such as the z-index, the time index, the comparison threshold.";
} }
@Override @Override

View File

@ -4,12 +4,15 @@ import it.geosolutions.geonetwork.util.GNSearchRequest;
import it.geosolutions.geonetwork.util.GNSearchResponse; import it.geosolutions.geonetwork.util.GNSearchResponse;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import org.gcube.common.scope.api.ScopeProvider; import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger; import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger;
import org.gcube.spatial.data.geonetwork.GeoNetwork; import org.gcube.spatial.data.geonetwork.GeoNetwork;
import org.gcube.spatial.data.geonetwork.GeoNetworkReader; import org.gcube.spatial.data.geonetwork.GeoNetworkReader;
import org.gcube.spatial.data.geonetwork.LoginLevel;
import org.gcube.spatial.data.geonetwork.configuration.Configuration; import org.gcube.spatial.data.geonetwork.configuration.Configuration;
import org.gcube.spatial.data.geonetwork.configuration.ConfigurationManager; import org.gcube.spatial.data.geonetwork.configuration.ConfigurationManager;
import org.geotoolkit.metadata.iso.identification.DefaultDataIdentification; import org.geotoolkit.metadata.iso.identification.DefaultDataIdentification;
@ -204,27 +207,39 @@ public class FeaturesManager {
return (httplink!=null && (httplink.endsWith(".asc")||httplink.endsWith(".ASC"))); return (httplink!=null && (httplink.endsWith(".asc")||httplink.endsWith(".ASC")));
} }
Configuration gnconfiguration;
public GeoNetworkReader initGeoNetworkReader() throws Exception { public GeoNetworkReader initGeoNetworkReader() throws Exception {
AnalysisLogger.getLogger().debug("Features Manager: configuring GeoNetwork"); AnalysisLogger.getLogger().debug("Features Manager: configuring GeoNetwork");
if (scope!=null) if (scope!=null)
ScopeProvider.instance.set(scope); ScopeProvider.instance.set(scope);
else{ else{
AnalysisLogger.getLogger().debug("Features Manager: Using manual configuration of GeoNetwork"); AnalysisLogger.getLogger().debug("Features Manager: Using manual configuration of GeoNetwork");
ConfigurationManager.setConfiguration(new Configuration() { class CustomConfiguration implements Configuration{
@Override
public String getGeoNetworkUser() {
return geonetworkUser;
}
@Override
public String getGeoNetworkPassword() {
return geonetworkPwd;
}
@Override @Override
public String getGeoNetworkEndpoint() { public String getGeoNetworkEndpoint() {
return geonetworkUrl; return geonetworkUrl;
} }
}); @Override
public Map<LoginLevel, String> getGeoNetworkPasswords() {
HashMap<LoginLevel, String> map = new HashMap<LoginLevel, String>();
map.put(LoginLevel.DEFAULT, geonetworkPwd);
return map;
}
@Override
public Map<LoginLevel, String> getGeoNetworkUsers() {
HashMap<LoginLevel, String> map = new HashMap<LoginLevel, String>();
map.put(LoginLevel.DEFAULT, geonetworkUser);
return map;
}
@Override
public int getScopeGroup() {
return 0;
}
}
ConfigurationManager.setConfiguration(CustomConfiguration.class);
} }
AnalysisLogger.getLogger().debug("Initializing GeoNetwork"); AnalysisLogger.getLogger().debug("Initializing GeoNetwork");
GeoNetworkReader gn = GeoNetwork.get(); GeoNetworkReader gn = GeoNetwork.get();
@ -241,19 +256,19 @@ public class FeaturesManager {
public String getGeonetworkUserFromScope() throws Exception { public String getGeonetworkUserFromScope() throws Exception {
GeoNetworkReader gn = initGeoNetworkReader(); GeoNetworkReader gn = initGeoNetworkReader();
return gn.getConfiguration().getGeoNetworkUser(); return gn.getConfiguration().getGeoNetworkUsers().get(LoginLevel.DEFAULT);
} }
public String getGeonetworkPasswordFromScope() throws Exception { public String getGeonetworkPasswordFromScope() throws Exception {
GeoNetworkReader gn = initGeoNetworkReader(); GeoNetworkReader gn = initGeoNetworkReader();
return gn.getConfiguration().getGeoNetworkPassword(); return gn.getConfiguration().getGeoNetworkPasswords().get(LoginLevel.DEFAULT);
} }
private Metadata getGNInfobyTitle(String info) throws Exception { private Metadata getGNInfobyTitle(String info) throws Exception {
GeoNetworkReader gn = initGeoNetworkReader(); GeoNetworkReader gn = initGeoNetworkReader();
// Form query object // Form query object
gn.login(); gn.login(LoginLevel.DEFAULT);
GNSearchRequest req = new GNSearchRequest(); GNSearchRequest req = new GNSearchRequest();
req.addParam(GNSearchRequest.Param.title, info); req.addParam(GNSearchRequest.Param.title, info);
// req.addConfig(GNSearchRequest.Config.similarity, "1"); // req.addConfig(GNSearchRequest.Config.similarity, "1");
@ -276,7 +291,7 @@ public class FeaturesManager {
GeoNetworkReader gn = initGeoNetworkReader(); GeoNetworkReader gn = initGeoNetworkReader();
// Form query object // Form query object
gn.login(); gn.login(LoginLevel.DEFAULT);
GNSearchRequest req = new GNSearchRequest(); GNSearchRequest req = new GNSearchRequest();
req.addParam(GNSearchRequest.Param.title, info); req.addParam(GNSearchRequest.Param.title, info);
req.addConfig(GNSearchRequest.Config.similarity, tolerance); req.addConfig(GNSearchRequest.Config.similarity, tolerance);
@ -300,7 +315,7 @@ public class FeaturesManager {
GeoNetworkReader gn = initGeoNetworkReader(); GeoNetworkReader gn = initGeoNetworkReader();
// Form query object // Form query object
gn.login(); gn.login(LoginLevel.DEFAULT);
GNSearchRequest req = new GNSearchRequest(); GNSearchRequest req = new GNSearchRequest();
req.addParam(GNSearchRequest.Param.any, info); req.addParam(GNSearchRequest.Param.any, info);
req.addConfig(GNSearchRequest.Config.similarity, tolerance); req.addConfig(GNSearchRequest.Config.similarity, tolerance);
@ -324,7 +339,7 @@ public class FeaturesManager {
GeoNetworkReader gn = initGeoNetworkReader(); GeoNetworkReader gn = initGeoNetworkReader();
// Form query object // Form query object
gn.login(); gn.login(LoginLevel.DEFAULT);
GNSearchRequest req = new GNSearchRequest(); GNSearchRequest req = new GNSearchRequest();
req.addParam(GNSearchRequest.Param.title, info); req.addParam(GNSearchRequest.Param.title, info);
req.addConfig(GNSearchRequest.Config.similarity, tolerance); req.addConfig(GNSearchRequest.Config.similarity, tolerance);
@ -358,7 +373,7 @@ public class FeaturesManager {
GeoNetworkReader gn = initGeoNetworkReader(); GeoNetworkReader gn = initGeoNetworkReader();
// Form query object // Form query object
gn.login(); gn.login(LoginLevel.DEFAULT);
Metadata meta = gn.getById(UUID); Metadata meta = gn.getById(UUID);
AnalysisLogger.getLogger().debug("Layer with UUID: "+UUID+" successfully Retrieved!"); AnalysisLogger.getLogger().debug("Layer with UUID: "+UUID+" successfully Retrieved!");