Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/utils/ShapeFileWriter.java @ 806:2cea76f1112e
Added Javadoc in utils package.
gnv-artifacts/trunk@888 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 08 Apr 2010 13:10:39 +0000 |
parents | feeaf5aec552 |
children | f953c9a559d8 |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/ShapeFileWriter.java Thu Apr 08 11:31:44 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/ShapeFileWriter.java Thu Apr 08 13:10:39 2010 +0000 @@ -46,6 +46,9 @@ private static NumberFormat format = NumberFormat.getInstance(); + /** + * Precision used to format double values. + */ public static final int DOUBLE_PRECISION = 3; static { @@ -55,6 +58,17 @@ private ShapeFileWriter() { } + + /** + * Write multilinestrings to shapefile. + * + * @param shapeFile Shapefile. + * @param parameterId The parameter id. + * @param layer The layer. + * @param date The date. + * @param multiLineStrings The multilinestring. + * @return true, if shapefile writing was successful - otherwise false. + */ public static boolean writeMultiLineStringsToFile( File shapeFile, Integer parameterId, @@ -71,6 +85,18 @@ "isolines"); } + + /** + * Write multilinestrings to shapefile. + * + * @param shapeFile Shapefile. + * @param parameterId The parameter id. + * @param layer The layer. + * @param date The date. + * @param multiLineStrings The multilinestring. + * @param name A name. + * @return true, if shapefile writing was successful - otherwise false. + */ public static boolean writeMultiLineStringsToFile( File shapeFile, Integer parameterId, @@ -173,6 +199,17 @@ return success; } + + /** + * Write multipolygon to file. + * + * @param shapeFile The shapefile. + * @param parameterId The parameter id. + * @param layer The layer. + * @param date The date. + * @param multiPolygons Multipolygons. + * @return true, if shapefile writing was successful - otherwise false. + */ public static boolean writeMultiPolygonsToFile( File shapeFile, Integer parameterId, @@ -190,6 +227,15 @@ } + /** + * Write data to shapefile. + * + * @param shapeFile The shapefile. + * @param name The name. + * @param data The data. + * @param geometryType The geometry type. + * @return true, if shapefile writing was successful - otherwise false. + */ public static boolean writeDataToFile(File shapeFile, String name, Collection<Result> data, @@ -294,9 +340,20 @@ } return true; - } + + /** + * Write multipolygons to file. + * + * @param shapeFile The shapefile. + * @param parameterId The parameter id. + * @param layer The layer. + * @param date The date. + * @param multiPolygons Multipolygons. + * @param name A name. + * @return true, if shapefile writing was successful - otherwise false. + */ public static boolean writeMultiPolygonsToFile( File shapeFile, Integer parameterId, @@ -399,6 +456,13 @@ return success; } + /** + * Returns an object as Double. + * + * @param a An object. + * @return Object <i>a</i> as Double. If <i>a</i> is not a double and no + * number, 0d is returned. + */ private static final Double asDouble(Object a) { if (a instanceof Double) { return (Double)a; @@ -409,6 +473,13 @@ return 0d; } + /** + * Turns a double value into a string representation taking account of the + * locale. + * + * @param value A double value. + * @return The double value formatted as string. + */ private static final String value2description(Double value) { return format.format(value); }