Merge pull request #157 from xandros6/master

Added additional WCS informations to publish GeoTIFF
This commit is contained in:
mbarto 2015-11-23 17:03:21 +01:00
commit bde93118d2
2 changed files with 49 additions and 0 deletions

View File

@ -1603,7 +1603,14 @@ public class GeoServerRESTPublisher {
coverageEncoder.setName(coverageName);
coverageEncoder.setTitle(coverageName);
coverageEncoder.setSRS(srs);
coverageEncoder.setNativeFormat("GeoTIFF");
coverageEncoder.addSupportedFormats("GEOTIFF");
coverageEncoder.addKeyword("geoTiff");
coverageEncoder.addKeyword("WCS");
coverageEncoder.setNativeCRS(srs);
coverageEncoder.setProjectionPolicy(policy);
coverageEncoder.setRequestSRS(srs);
coverageEncoder.setResponseSRS(srs);
if (bbox != null && bbox.length == 4) {
coverageEncoder.setLatLonBoundingBox(bbox[0], bbox[1], bbox[2], bbox[3], DEFAULT_CRS);
}

View File

@ -43,12 +43,20 @@ public class GSCoverageEncoder extends GSResourceEncoder {
public final static String NATIVECOVERAGENAME = "nativeCoverageName";
private final static String NATIVE_FORMAT="nativeFormat";
private final static String SUPPORTED_FORMATS="supportedFormats";
private final static String REQUEST_SRS="requestSRS";
private final static String RESPONSE_SRS="responseSRS";
private final Element supportedFormatsListEncoder = new Element(SUPPORTED_FORMATS);
public final static String DIMENSIONS = "dimensions";
final private Element dimensionsEncoder = new Element(DIMENSIONS);
public GSCoverageEncoder() {
super("coverage");
addContent(supportedFormatsListEncoder);
}
/**
@ -69,6 +77,40 @@ public class GSCoverageEncoder extends GSResourceEncoder {
super.setMetadata(key, dimensionInfo);
}
/**
* Add the 'nativeFormat' node with a text value
*/
public void setNativeFormat(String format) {
set(NATIVE_FORMAT, format);
}
/**
* Add the 'supportedFormat' node with a text value
*/
public void addSupportedFormats(String format) {
final Element el = new Element("string");
el.setText(format);
supportedFormatsListEncoder.addContent(el);
}
/**
* Add the 'requestSRS' node with a text value
*/
public void setRequestSRS(String srs) {
final Element el = new Element("string");
el.setText(srs);
set(REQUEST_SRS, el);
}
/**
* Add the 'responseSRS' node with a text value
*/
public void setResponseSRS(String srs) {
final Element el = new Element("string");
el.setText(srs);
set(RESPONSE_SRS, el);
}
/**
* Adds a CoverageDimensionInfo to the GeoServer Resource
*