ExportParameter { public String toAreaWKT() { final StringBuilder wktBuilder = new StringBuilder(128); wktBuilder.append("POLYGON(("); appendCoordinate(wktBuilder, westBound, northBound, true); appendCoordinate(wktBuilder, eastBound, northBound, true); appendCoordinate(wktBuilder, eastBound, southBound, true); appendCoordinate(wktBuilder, westBound, southBound, true); appendCoordinate(wktBuilder, westBound, northBound, false); wktBuilder.append("))"); return wktBuilder.toString(); } ExportParameter(); void setUseSelectedProduct(boolean useSelectedProduct); boolean isUseSelectedProduct(); void setSourceDirectory(File sourceDirectory); File getSourceDirectory(); void setOpenFileDialog(boolean openFileDialog); boolean isOpenFileDialog(); void setRegion(Geometry region); Geometry getRegion(); void setRoiType(int roiType); int getRoiType(); void setTargetDirectory(File targetDirectory); File getTargetDirectory(); String toAreaWKT(); void setNorthBound(double northBound); double getNorthBound(); void setEastBound(double eastBound); double getEastBound(); void setSouthBound(double southBound); double getSouthBound(); void setWestBound(double westBound); double getWestBound(); void setOverwriteTarget(boolean overwriteTarget); boolean isOverwriteTarget(); void setContact(String contact); String getContact(); void setInstitution(String institution); String getInstitution(); void setVariableNames(String[] variableNames); String[] getVariableNames(); void setCompressionLevel(int compressionLevel); int getCompressionLevel(); static final String PRODUCT_TYPE_REGEX; }
@Test public void testToAreaWKT() { parameter.setNorthBound(2.0); parameter.setEastBound(25.0); parameter.setSouthBound(1.0); parameter.setWestBound(24.0); assertEquals("POLYGON((24.0 2.0,25.0 2.0,25.0 1.0,24.0 1.0,24.0 2.0))", parameter.toAreaWKT()); }