Gianpaolo Coro 2013-04-12 13:04:33 +00:00
parent 7b2e24c705
commit be571cdba8
1 changed files with 9 additions and 2 deletions

View File

@ -10,7 +10,7 @@ public class OGCFormatter {
}
public static String getWcsUrl(String geoServerUrl, String layerName, String bbox) {
return geoServerUrl + "/wcs?service=wcs&version=1.0.0" + "&request=GetCoverage&layers=" + layerName + "&CRS=EPSG:4326" + "&bbox=" + bbox + "&width=676&height=330&srs=EPSG:4326&format=geotiff";
return geoServerUrl + "/wcs?service=wcs&version=1.0.0" + "&request=GetCoverage&coverage=" + layerName + "&CRS=EPSG:4326" + "&bbox=" + bbox + "&width=676&height=330&format=geotiff";
}
public static String getWmsNetCDFUrl(String fileUrl, String layerName, String bbox) {
@ -18,7 +18,7 @@ public class OGCFormatter {
}
public static String getWcsNetCDFUrl(String fileUrl, String layerName, String bbox) {
return fileUrl.replace("dodsC", "wcs") + "?service=wcs&version=1.0.0" + "&request=GetCoverage&layers=" + layerName + "&CRS=EPSG:4326" + "&bbox=" + bbox + "&srs=EPSG:4326&format=geotiff";
return fileUrl.replace("dodsC", "wcs") + "?service=wcs&version=1.0.0" + "&request=GetCoverage&coverage=" + layerName + "&CRS=EPSG:4326" + "&bbox=" + bbox + "&width=676&height=330&format=geotiff";
}
public static String buildBoundingBox(double x1, double y1, double x2, double y2) {
@ -34,4 +34,11 @@ public class OGCFormatter {
double y22 = y1 + tolerance;
return OGCFormatter.buildBoundingBox(x11, y11, x22, y22);
}
public static void main(String [] args){
//http://geoserver-dev.d4science-ii.research-infrastructures.eu/geoserver/wcs?service=WCS&version=1.0.0&request=GetCoverage&COVERAGE=aquamaps:WorldClimBio2&CRS=EPSG:4326&BBOX=-180,-90,180,90&WIDTH=640&HEIGHT=480&FORMAT=geotiff
String wcs = getWcsUrl("http://geoserver-dev.d4science-ii.research-infrastructures.eu/geoserver", "aquamaps:WorldClimBio2", buildBoundingBox(-180, -85.5,180, 90));
System.out.println(wcs);
}
}