Added additional WCS informations to publish GeoTIFF

This commit is contained in:
Xandros 2015-11-20 13:12:20 +01:00
parent a4268dda60
commit ebae6cf086
2 changed files with 49 additions and 0 deletions

View File

@ -1603,7 +1603,14 @@ public class GeoServerRESTPublisher {
coverageEncoder.setName(coverageName); coverageEncoder.setName(coverageName);
coverageEncoder.setTitle(coverageName); coverageEncoder.setTitle(coverageName);
coverageEncoder.setSRS(srs); coverageEncoder.setSRS(srs);
coverageEncoder.setNativeFormat("GeoTIFF");
coverageEncoder.addSupportedFormats("GEOTIFF");
coverageEncoder.addKeyword("geoTiff");
coverageEncoder.addKeyword("WCS");
coverageEncoder.setNativeCRS(srs);
coverageEncoder.setProjectionPolicy(policy); coverageEncoder.setProjectionPolicy(policy);
coverageEncoder.setRequestSRS(srs);
coverageEncoder.setResponseSRS(srs);
if (bbox != null && bbox.length == 4) { if (bbox != null && bbox.length == 4) {
coverageEncoder.setLatLonBoundingBox(bbox[0], bbox[1], bbox[2], bbox[3], DEFAULT_CRS); 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"; 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"; public final static String DIMENSIONS = "dimensions";
final private Element dimensionsEncoder = new Element(DIMENSIONS); final private Element dimensionsEncoder = new Element(DIMENSIONS);
public GSCoverageEncoder() { public GSCoverageEncoder() {
super("coverage"); super("coverage");
addContent(supportedFormatsListEncoder);
} }
/** /**
@ -69,6 +77,40 @@ public class GSCoverageEncoder extends GSResourceEncoder {
super.setMetadata(key, dimensionInfo); 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 * Adds a CoverageDimensionInfo to the GeoServer Resource
* *