From be571cdba881fa82d068bd5a3d89a91a7e1d9407 Mon Sep 17 00:00:00 2001 From: Gianpaolo Coro Date: Fri, 12 Apr 2013 13:04:33 +0000 Subject: [PATCH] git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngineGeoSpatialExtension@73220 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../org/gcube/dataanalysis/geo/meta/OGCFormatter.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/dataanalysis/geo/meta/OGCFormatter.java b/src/main/java/org/gcube/dataanalysis/geo/meta/OGCFormatter.java index cc3404e..3f0fa4e 100644 --- a/src/main/java/org/gcube/dataanalysis/geo/meta/OGCFormatter.java +++ b/src/main/java/org/gcube/dataanalysis/geo/meta/OGCFormatter.java @@ -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); + } }