Gianpaolo Coro 2014-09-05 09:47:29 +00:00
parent b1eb8e9bcc
commit b1bac19530
3 changed files with 214 additions and 0 deletions

View File

@ -43,6 +43,7 @@ public class GeothermalDataMetadataInsertDev {
TrainingCenter();
}
private static void TemperatureIsolineat3kmdepth() throws Exception{
GenericLayerMetadata metadataInserter = new GenericLayerMetadata();
metadataInserter.setGeonetworkUrl(geonetworkurl);

View File

@ -0,0 +1,113 @@
package org.gcube.dataanalysis.geo.batch;
import org.gcube.dataanalysis.geo.meta.GenericLayerMetadata;
import org.opengis.metadata.identification.TopicCategory;
public class GeothermalDataMetadataInsertFrance {
static String geonetworkurl = "http://geonetwork.geothermaldata.d4science.org/geonetwork";
static String geoserverurl = "http://geoserver-dev.d4science-ii.research-infrastructures.eu/geoserver";
static String user = "admin";
static String password = "d4science2014";
public static void main(String[] args) throws Exception{
for (int i=0;i<titles.length;i++){
insertLayer(i);
}
}
static String[] titles = {
"HeatFlowLine",
"License",
"TemperatureLine",
"TemperatureUnit",
"HeatFlowUnit",
"Industry",
"TrainingCenter",
};
static String[] abstracts = {
"The class HeatFlowLine presents a heat flow map. HeatFlowLine is qualified by isolines, featured as discrete heat flow values regularly spaced. These data are based on measurements operated since 1970 and already processed.",
"The class License was created to present a list of exploration and production permits. They are the official permits that allow an organism to start a study or a production on a defined area. License is qualified by the name and type of permit and its area and limits date. For any further information, a link was added.",
"The class TemperatureLine presents a temperature map. TemperatureLine is qualified by isolines, featured as discrete temperature values regularly spaced. These temperature data come from drill holes measurements, mostly from petroleum wells between the years 1978 and 2007, and were processed in 2007.",
"The class TemperatureUnit presents a temperature map. TemperatureUnit is qualified by polygons, featured as intervals between a lower and upper temperature value. These temperature data come from drill holes measurements, mostly from petroleum wells between the years 1978 and 2007, and were processed in 2007.",
"The class HeatFlowUnit presents a heat flow map. HeatFlowUnit is qualified by polygons, featured as intervals between a lower and upper heat flow value. These data are based on measurements operated since 1970 and already processed.",
"The class Industry was created to present a list of industries, which invest in geothermal energy or participate into geothermal projects. Industry is qualified by the name and type of the company and its location. For any further information, a link to the company's website was added.",
"The class TrainingCenter was created to present a list of Education and research institutes, as well as training centers, which offer geothermal education. Education is qualified by the name and type of the institute and its location. For any further information, a link to the institute's website was added."
};
static String[] customTopics = {
"EGIP, HeatFlowLine, France",
"EGIP, License, permits, France",
"EGIP, TemperatureLine, France",
"EGIP, TemperatureUnit, France",
"EGIP, HeatFlowUnit, France",
"EGIP, Industry, France",
"EGIP, TrainingCenter, Education, France"
};
static String[] categoryTypes = {
"_"+TopicCategory.CLIMATOLOGY_METEOROLOGY_ATMOSPHERE.name()+"_"+"_"+TopicCategory.ENVIRONMENT.name()+"_",
"_"+TopicCategory.GEOSCIENTIFIC_INFORMATION.name()+"_"+"_"+TopicCategory.UTILITIES_COMMUNICATION.name()+"_",
"_"+TopicCategory.CLIMATOLOGY_METEOROLOGY_ATMOSPHERE.name()+"_"+"_"+TopicCategory.ENVIRONMENT.name()+"_",
"_"+TopicCategory.CLIMATOLOGY_METEOROLOGY_ATMOSPHERE.name()+"_"+"_"+TopicCategory.ENVIRONMENT.name()+"_",
"_"+TopicCategory.CLIMATOLOGY_METEOROLOGY_ATMOSPHERE.name()+"_"+"_"+TopicCategory.ENVIRONMENT.name()+"_",
"_"+TopicCategory.GEOSCIENTIFIC_INFORMATION.name()+"_"+"_"+TopicCategory.UTILITIES_COMMUNICATION.name()+"_",
"_"+TopicCategory.GEOSCIENTIFIC_INFORMATION.name()+"_"+"_"+TopicCategory.UTILITIES_COMMUNICATION.name()+"_"
};
static String[] layernames = {
"HeatFlowLine",
"License",
"TemperatureLine",
"TemperatureUnit",
"HeatFlowUnit",
"Industry",
"TrainingCenter"
};
static String[] wmsurls= {
"http://egip.brgm-rec.fr/wxs/?service=WMS&layers=HeatFlowLine",
"http://egip.brgm-rec.fr/wxs/?service=WMS&layers=License",
"http://egip.brgm-rec.fr/wxs/?service=WMS&layers=TemperatureLine",
"http://egip.brgm-rec.fr/wxs/?service=WMS&layers=TemperatureUnit",
"http://egip.brgm-rec.fr/wxs/?service=WMS&layers=HeatFlowUnit",
"http://egip.brgm-rec.fr/wxs/?service=WMS&layers=Industry",
"http://egip.brgm-rec.fr/wxs/?service=WMS&layers=TrainingCenter"
};
static String[] wfsurls= {
"http://egip.brgm-rec.fr/wxs/?service=WFS&version=1.1.0&request=GetFeature&typeName=HeatFlowLine&srsName=EPSG:4326",
"http://egip.brgm-rec.fr/wxs/?service=WFS&version=1.1.0&request=GetFeature&typeName=License&srsName=EPSG:4326",
"http://egip.brgm-rec.fr/wxs/?service=WFS&version=1.1.0&request=GetFeature&typeName=TemperatureLine&srsName=EPSG:4326",
"http://egip.brgm-rec.fr/wxs/?service=WFS&version=1.1.0&request=GetFeature&typeName=TemperatureUnit&srsName=EPSG:4326",
"http://egip.brgm-rec.fr/wxs/?service=WFS&version=1.1.0&request=GetFeature&typeName=HeatFlowUnit&srsName=EPSG:4326",
"http://egip.brgm-rec.fr/wxs/?service=WFS&version=1.1.0&request=GetFeature&typeName=Industry&srsName=EPSG:4326",
"http://egip.brgm-rec.fr/wxs/?service=WFS&version=1.1.0&request=GetFeature&typeName=TrainingCenter&srsName=EPSG:4326"
};
private static void insertLayer(int i) throws Exception{
GenericLayerMetadata metadataInserter = new GenericLayerMetadata();
metadataInserter.setGeonetworkUrl(geonetworkurl);
metadataInserter.setGeonetworkUser(user);
metadataInserter.setGeonetworkPwd(password);
metadataInserter.setResolution(0);
metadataInserter.setXLeftLow(-180);
metadataInserter.setYLeftLow(-90);
metadataInserter.setXRightUpper(180);
metadataInserter.setYRightUpper(90);
metadataInserter.setTitle(titles[i]);
metadataInserter.setAbstractField(abstracts[i]);
metadataInserter.setCustomTopics(customTopics[i].split(","));
metadataInserter.setCategoryTypes(categoryTypes[i]);
metadataInserter.setResolution(0);
metadataInserter.setLayerName(layernames[i]);
String [] urls = {
wmsurls[i],
wfsurls[i]
};
String [] protocols = {"WMS","WFS"};
if (titles[i].length()>0)
metadataInserter.customMetaDataInsert(urls,protocols);
}
}

View File

@ -0,0 +1,100 @@
package org.gcube.dataanalysis.geo.batch;
import org.gcube.dataanalysis.geo.meta.GenericLayerMetadata;
import org.opengis.metadata.identification.TopicCategory;
public class GeothermalDataMetadataInsertHungary {
static String geonetworkurl = "http://geonetwork.geothermaldata.d4science.org/geonetwork";
static String geoserverurl = "http://geoserver-dev.d4science-ii.research-infrastructures.eu/geoserver";
static String user = "admin";
static String password = "d4science2014";
public static void main(String[] args) throws Exception{
for (int i=0;i<titles.length;i++){
insertLayer(i);
}
}
static String[] titles = {
//"HeatFlowLine",
"Temperature at 1 km depth, Hungary",
"Temperature at 2 km depth, Hungary",
"Temperature at 3 km depth, Hungary",
"Surface heat flow, Hungary"
};
static String[] abstracts = {
//"The class HeatFlowLine presents a heat flow map. HeatFlowLine is qualified by isolines, featured as discrete heat flow values regularly spaced.",
"Map of temperature at 1 km depth (below ground level), Hungary",
"Map of temperature at 2 km depth (below ground level), Hungary",
"Map of temperature at 3 km depth (below ground level), Hungary",
"Geothermal surface heat flow, Hungary"
};
static String[] customTopics = {
//"",
"geothermal energy, map, Hungary, Energy resources, EGIP, MFGI",
"geothermal energy, map, Hungary, Energy resources, EGIP, MFGI",
"geothermal energy, map, Hungary, Energy resources, EGIP, MFGI",
"geothermal energy, map, Hungary, Energy resources, EGIP, MFGI",
"geothermal energy, map, Hungary, Energy resources, EGIP, MFGI",
};
static String[] categoryTypes = {
//"_"+TopicCategory.CLIMATOLOGY_METEOROLOGY_ATMOSPHERE.name()+"_"+"_"+TopicCategory.ENVIRONMENT.name()+"_",
"_"+TopicCategory.CLIMATOLOGY_METEOROLOGY_ATMOSPHERE.name()+"_"+"_"+TopicCategory.ENVIRONMENT.name()+"_",
"_"+TopicCategory.CLIMATOLOGY_METEOROLOGY_ATMOSPHERE.name()+"_"+"_"+TopicCategory.ENVIRONMENT.name()+"_",
"_"+TopicCategory.CLIMATOLOGY_METEOROLOGY_ATMOSPHERE.name()+"_"+"_"+TopicCategory.ENVIRONMENT.name()+"_",
"_"+TopicCategory.CLIMATOLOGY_METEOROLOGY_ATMOSPHERE.name()+"_"+"_"+TopicCategory.ENVIRONMENT.name()+"_",
};
static String[] layernames = {
//"HeatFlowUnit",
"temp1000",
"temp2000",
"temp3000",
"heatflow"
};
static String[] wmsurls= {
//"http://egip.brgm-rec.fr/wxs/?service=WMS&layers=HeatFlowUnit",
"http://geonetwork.mfgi.hu:8080/geoserver/egip/ows?service=WMS&version=1.1.1&bbox=16.18993,45.71316,22.93481,48.54140&request=GetMap&layers=temp1000&styles=&width=512&height=453&srs=EPSG:4326&format=application/openlayers",
"http://geonetwork.mfgi.hu:8080/geoserver/egip/ows?service=WMS&version=1.1.1&bbox=16.18993,45.71316,22.93481,48.54140&request=GetMap&layers=temp2000&styles=&width=512&height=453&srs=EPSG:4326&format=application/openlayers",
"http://geonetwork.mfgi.hu:8080/geoserver/egip/ows?service=WMS&version=1.1.1&bbox=16.18993,45.71316,22.93481,48.54140&request=GetMap&layers=temp3000&styles=&width=512&height=453&srs=EPSG:4326&format=application/openlayers",
"http://geonetwork.mfgi.hu:8080/geoserver/egip/ows?service=WMS&version=1.1.1&bbox=16.18993,45.71316,22.93481,48.54140&request=GetMap&layers=heatflow&styles=&width=512&height=453&srs=EPSG:4326&format=application/openlayers",
};
static String[] wfsurls= {
//"http://egip.brgm-rec.fr/wxs/?service=WFS&version=1.1.0&request=GetFeature&typeName=HeatFlowUnit&srsName=EPSG:4326",
"http://geonetwork.mfgi.hu:8080/geoserver/egip/ows?service=WFS&version=1.1.0&request=GetFeature&srsName=urn:x-ogc:def:crs:EPSG:4326&typeName=temp1000",
"http://geonetwork.mfgi.hu:8080/geoserver/egip/ows?service=WFS&version=1.1.0&request=GetFeature&srsName=urn:x-ogc:def:crs:EPSG:4326&typeName=temp2000",
"http://geonetwork.mfgi.hu:8080/geoserver/egip/ows?service=WFS&version=1.1.0&request=GetFeature&srsName=urn:x-ogc:def:crs:EPSG:4326&typeName=temp3000",
"http://geonetwork.mfgi.hu:8080/geoserver/egip/ows?service=WFS&version=1.1.0&request=GetFeature&srsName=urn:x-ogc:def:crs:EPSG:4326&typeName=heatflow"
};
private static void insertLayer(int i) throws Exception{
GenericLayerMetadata metadataInserter = new GenericLayerMetadata();
metadataInserter.setGeonetworkUrl(geonetworkurl);
metadataInserter.setGeonetworkUser(user);
metadataInserter.setGeonetworkPwd(password);
metadataInserter.setResolution(0);
metadataInserter.setXLeftLow(-180);
metadataInserter.setYLeftLow(-90);
metadataInserter.setXRightUpper(180);
metadataInserter.setYRightUpper(90);
metadataInserter.setTitle(titles[i]);
metadataInserter.setAbstractField(abstracts[i]);
metadataInserter.setCustomTopics(customTopics[i].split(","));
metadataInserter.setCategoryTypes(categoryTypes[i]);
metadataInserter.setResolution(0);
metadataInserter.setLayerName(layernames[i]);
String [] urls = {
wmsurls[i],
wfsurls[i]
};
String [] protocols = {"WMS","WFS"};
if (titles[i].length()>0)
metadataInserter.customMetaDataInsert(urls,protocols);
}
}