Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/raster/JTSMultiPolygonProducer.java @ 498:4080b57dcb52
Upgraded to Geotools 2.5.8. Write polygons and line strings to
shape files.
gnv-artifacts/trunk@578 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 19 Jan 2010 21:23:28 +0000 |
parents | 6e8364e766fa |
children | e065a72f6b62 |
comparison
equal
deleted
inserted
replaced
497:75306d856004 | 498:4080b57dcb52 |
---|---|
64 this.geometryFactory = geometryFactory; | 64 this.geometryFactory = geometryFactory; |
65 valueToPolygons = new HashMap<Integer, ArrayList<Polygon>>(); | 65 valueToPolygons = new HashMap<Integer, ArrayList<Polygon>>(); |
66 } | 66 } |
67 | 67 |
68 public static GeometryFactory createDefaultGeometryFactory() { | 68 public static GeometryFactory createDefaultGeometryFactory() { |
69 return createDefaultGeometryFactory(2); | |
70 } | |
71 | |
72 public static GeometryFactory createDefaultGeometryFactory(int dim) { | |
69 return new GeometryFactory( | 73 return new GeometryFactory( |
70 new PrecisionModel( | 74 new PrecisionModel( |
71 PrecisionModel.FLOATING), | 75 PrecisionModel.FLOATING), |
72 SRID_WGS84, | 76 SRID_WGS84, |
73 new PackedCoordinateSequenceFactory( | 77 new PackedCoordinateSequenceFactory( |
74 PackedCoordinateSequenceFactory.DOUBLE, | 78 PackedCoordinateSequenceFactory.DOUBLE, |
75 2)); | 79 dim)); |
76 } | 80 } |
77 | 81 |
78 public void handleRings( | 82 public void handleRings( |
79 List<Edge> rings, | 83 List<Edge> rings, |
80 int value, | 84 int value, |
139 if (shell == null) { | 143 if (shell == null) { |
140 log.error("polygon has no shell"); | 144 log.error("polygon has no shell"); |
141 return; | 145 return; |
142 } | 146 } |
143 | 147 |
144 log.debug("polygon has a shell"); | |
145 | |
146 Polygon polygon = geometryFactory.createPolygon( | 148 Polygon polygon = geometryFactory.createPolygon( |
147 shell, | 149 shell, |
148 holes.toArray(new LinearRing[holes.size()])); | 150 holes.toArray(new LinearRing[holes.size()])); |
149 | 151 |
150 polygons.add(polygon); | 152 polygons.add(polygon); |