Gianpaolo Coro 2013-04-19 13:53:24 +00:00
parent b44640be23
commit 0af25aa211
4 changed files with 16 additions and 10 deletions

View File

@ -143,7 +143,7 @@ public class ThreddsFetcher {
else
dateString = " from [" + startDate + "] to [" + endDate + "]";
}
return description.replaceAll("( )+", " ") + dateString+" (" + numberOfDimensions+ "D)";//+" (" + filename + ")";
return description.replaceAll("( )+", " ") + dateString+" (" + numberOfDimensions+ "D) {" + filename + "}";
}
public static String generateAbstractField(String layername, String filename, String description, String unit, String startDate, String endDate, String duration, String timeInstants, int numberOfDimensions) {

View File

@ -4,8 +4,6 @@ import it.geosolutions.geonetwork.util.GNSearchRequest;
import it.geosolutions.geonetwork.util.GNSearchResponse;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import org.gcube.common.scope.api.ScopeProvider;
@ -14,14 +12,11 @@ import org.gcube.spatial.data.geonetwork.GeoNetwork;
import org.gcube.spatial.data.geonetwork.GeoNetworkReader;
import org.gcube.spatial.data.geonetwork.configuration.Configuration;
import org.gcube.spatial.data.geonetwork.configuration.ConfigurationManager;
import org.geotoolkit.metadata.iso.identification.DefaultKeywords;
import org.geotoolkit.util.DefaultInternationalString;
import org.opengis.metadata.Metadata;
import org.opengis.metadata.citation.OnlineResource;
import org.opengis.metadata.distribution.DigitalTransferOptions;
import org.opengis.metadata.identification.Identification;
import org.opengis.metadata.identification.Keywords;
import org.opengis.util.InternationalString;
public class FeaturesManager {
private String geonetworkUrl = "http://geoserver-dev2.d4science-ii.research-infrastructures.eu/geonetwork/";
@ -181,7 +176,10 @@ public class FeaturesManager {
return metadatalist;
}
public Metadata checkForMetadatabyTitle(String searchString, String completetitle) throws Exception {
return checkForMetadatabyTitle(searchString, completetitle, "");
}
public Metadata checkForMetadatabyTitle(String searchString, String completetitle, String filename) throws Exception {
AnalysisLogger.getLogger().debug("Searching for: "+searchString);
List<Metadata> mlist = getAllGNInfobyTitle(searchString, "1");
@ -191,6 +189,7 @@ public class FeaturesManager {
Identification id = m.getIdentificationInfo().iterator().next();
String title = id.getCitation().getTitle().toString();
if (completetitle.equalsIgnoreCase(title)) {
/*
Iterator<? extends Keywords> it = id.getDescriptiveKeywords().iterator();
while (it.hasNext()){
Keywords keys = (Keywords)it.next();
@ -207,6 +206,10 @@ public class FeaturesManager {
}
if (mfound!=null)
break;
*/
mfound = m;
break;
}
}
return mfound;

View File

@ -26,7 +26,8 @@ public class GeoIntersector {
public LinkedHashMap<String, Double> getFeaturesInTime(String layerTitle, double x, double y, double z) throws Exception {
LinkedHashMap<String, Double> features = new LinkedHashMap<String, Double>();
// get the layer
Metadata meta = featurer.getGNInfobyTitle(layerTitle);
// Metadata meta = featurer.getGNInfobyTitle(layerTitle);
Metadata meta = featurer.checkForMetadatabyTitle(FeaturesManager.treatTitleForGN(layerTitle),layerTitle);
// if the layer is good
if (meta != null) {
String layer = featurer.getLayerName(meta);
@ -70,7 +71,7 @@ public class GeoIntersector {
GeoIntersector inters = new GeoIntersector(null);
// System.out.println(inters.getFeaturesInTime("temperature (04091217ruc.nc)", 0.1, 0.1));
System.out.println(inters.getFeaturesInTime("Temperature", 0.1, 0.1,3000));
System.out.println(inters.getFeaturesInTime("wind stress from [05-01-07 14:00] to [04-01-12 14:00] (2D) {CERSAT-GLO-CLIM_WIND_L4-OBS_FULL_TIME_SERIE_CLIMATOLOGY_METEOROLOGY_ATMOSPHERE_1366217956317.nc}", 0.1, 0.1,3000));
}
}

View File

@ -104,7 +104,9 @@ public class ThreddsDataExplorer {
CoordinateAxis zAxis = gdt.getCoordinateSystem().getVerticalAxis();
double resolutionZ = Math.abs((double) (zAxis.getMaxValue() - zAxis.getMinValue()) / (double) zAxis.getShape()[0]);
int zint = (int) Math.round(z / resolutionZ);
int zint = 0;
if (resolutionZ>0)
zint = (int) Math.round(z / resolutionZ);
AnalysisLogger.getLogger().debug("Z index to take: " + zint);