Skip to content

Commit

Permalink
Fixing some style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
WeatherGod committed Jul 2, 2024
1 parent 1a8970c commit c648962
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 5 additions & 1 deletion tds/src/main/java/thredds/server/wcs/Request.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ enum RequestEncoding {
}

enum Format {
NONE(""), GeoTIFF("image/tiff"), GeoTIFF_Float("image/tiff"), NetCDF3("application/x-netcdf"), GeoTIFF_Palette("image/tiff");
NONE(""),
GeoTIFF("image/tiff"),
GeoTIFF_Float("image/tiff"),
NetCDF3("application/x-netcdf"),
GeoTIFF_Palette("image/tiff");

private String mimeType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ public File writeCoverageDataToFile(Request.Format format, LatLonRect bboxLatLon

/////////
try {
if (format == Request.Format.GeoTIFF || format == Request.Format.GeoTIFF_Float || format == Request.Format.GeoTIFF_Palette) {
if (format == Request.Format.GeoTIFF || format == Request.Format.GeoTIFF_Float
|| format == Request.Format.GeoTIFF_Palette) {
File dir = new File(getDiskCache().getRootDirectory());
File tifFile = File.createTempFile("WCS", ".tif", dir);
if (log.isDebugEnabled())
Expand All @@ -166,8 +167,8 @@ public File writeCoverageDataToFile(Request.Format format, LatLonRect bboxLatLon
}
if (!flag_colors_attr.isString()) {
log.error("Invalid flag_colors attribute");
throw new WcsException(WcsException.Code.UNKNOWN, "",
"Invalid flag_colors attribute for coverage [" + this.coverage.getName() + "] for format GeoTIFF_Palette.");
throw new WcsException(WcsException.Code.UNKNOWN, "", "Invalid flag_colors attribute for coverage ["
+ this.coverage.getName() + "] for format GeoTIFF_Palette.");
}

int[] flag_values = new int[flag_values_attr.getLength()];
Expand All @@ -180,7 +181,7 @@ public File writeCoverageDataToFile(Request.Format format, LatLonRect bboxLatLon
writer.setColorTable(GeotiffWriter.createColorMap(flag_values, flag_colors), Color.white);
}
writer.writeGrid(array, format == Request.Format.GeoTIFF,
format == Request.Format.GeoTIFF_Palette ? DataType.UBYTE : null);
format == Request.Format.GeoTIFF_Palette ? DataType.UBYTE : null);

} catch (Throwable e) {
log.error("writeCoverageDataToFile(): Failed to write file for requested coverage <" + this.coverage.getName()
Expand Down

0 comments on commit c648962

Please sign in to comment.