Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/utils/ShapeFileWriter.java @ 778:9a828e5a2390
Removed trailing whitespace
gnv-artifacts/trunk@851 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 29 Mar 2010 07:58:51 +0000 |
parents | 0b1de7e38907 |
children | b1f5f2a8840f |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/ShapeFileWriter.java Fri Mar 26 15:31:20 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/ShapeFileWriter.java Mon Mar 29 07:58:51 2010 +0000 @@ -67,7 +67,7 @@ parameterId, layer, date, - multiLineStrings, + multiLineStrings, "isolines"); } @@ -97,12 +97,12 @@ } SimpleFeatureType TYPE; - - try { + + try { TYPE = DataUtilities.createType( name, "geom:MultiLineString:srid=4326," + - "PARAMETER:Integer," + + "PARAMETER:Integer," + "LAYER:Integer," + "DATE:Date," + "VALUE:Double," + @@ -116,7 +116,7 @@ SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(TYPE); - FeatureCollection<SimpleFeatureType, SimpleFeature> collection = + FeatureCollection<SimpleFeatureType, SimpleFeature> collection = FeatureCollections.newCollection(); for (Pair<Object, MultiLineString> pair: multiLineStrings) { @@ -155,7 +155,7 @@ featureStore.addFeatures(collection); transaction.commit(); success = true; - } + } catch (IOException ioe) { log.error(ioe.getLocalizedMessage(), ioe); } @@ -181,22 +181,22 @@ Map<Integer, MultiPolygon> multiPolygons ) { return writeMultiPolygonsToFile( - shapeFile, + shapeFile, parameterId, layer, date, - multiPolygons, + multiPolygons, "polygons"); } - + public static String writeDataToFile(File shapeFile, String name, Collection<Result> data){ String geomType = null; - + WKTReader wktReader = new WKTReader(); - + Map<String, Serializable> params = new HashMap<String, Serializable>(); try { @@ -216,7 +216,7 @@ SimpleFeatureType type = null; SimpleFeatureBuilder featureBuilder = null; - FeatureCollection<SimpleFeatureType, SimpleFeature> collection = + FeatureCollection<SimpleFeatureType, SimpleFeature> collection = FeatureCollections.newCollection(); int j = 0; for (Result result: data) { @@ -226,7 +226,7 @@ ResultDescriptor rd = result.getResultDescriptor(); int columns = rd.getColumnCount(); if (type == null){ - try { + try { geomType = g.getGeometryType().toUpperCase(); String schema = "geom:"+g.getGeometryType()+":srid=4326"; for (int i = 1; i < columns; i++){ @@ -279,7 +279,7 @@ featureStore.addFeatures(collection); transaction.commit(); success = true; - } + } catch (IOException ioe) { log.error(ioe.getLocalizedMessage(), ioe); } @@ -295,9 +295,9 @@ } return geomType; - + } - + public static boolean writeMultiPolygonsToFile( File shapeFile, Integer parameterId, @@ -324,12 +324,12 @@ } SimpleFeatureType TYPE; - - try { + + try { TYPE = DataUtilities.createType( name, "geom:MultiPolygon:srid=4326," + - "PARAMETER:Integer," + + "PARAMETER:Integer," + "LAYER:Integer," + "DATE:Date," + "CLASS:Integer"); @@ -342,7 +342,7 @@ SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(TYPE); - FeatureCollection<SimpleFeatureType, SimpleFeature> collection = + FeatureCollection<SimpleFeatureType, SimpleFeature> collection = FeatureCollections.newCollection(); for (Map.Entry<Integer, MultiPolygon> entry: @@ -382,7 +382,7 @@ featureStore.addFeatures(collection); transaction.commit(); success = true; - } + } catch (IOException ioe) { log.error(ioe.getLocalizedMessage(), ioe); }