Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java @ 1845:06c157848c8f
Made the floodmap compatible with an Oracle database.
flys-artifacts/trunk@3189 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 09 Nov 2011 10:48:51 +0000 |
parents | 93fe7debd687 |
children | ccf2235035d6 |
comparison
equal
deleted
inserted
replaced
1844:06cf1009301d | 1845:06c157848c8f |
---|---|
8 import java.util.List; | 8 import java.util.List; |
9 | 9 |
10 import com.vividsolutions.jts.geom.Coordinate; | 10 import com.vividsolutions.jts.geom.Coordinate; |
11 import com.vividsolutions.jts.geom.Geometry; | 11 import com.vividsolutions.jts.geom.Geometry; |
12 import com.vividsolutions.jts.geom.LineString; | 12 import com.vividsolutions.jts.geom.LineString; |
13 import com.vividsolutions.jts.geom.MultiPolygon; | |
14 import com.vividsolutions.jts.geom.Polygon; | 13 import com.vividsolutions.jts.geom.Polygon; |
15 | 14 |
16 import org.apache.log4j.Logger; | 15 import org.apache.log4j.Logger; |
17 | 16 |
18 import org.opengis.feature.simple.SimpleFeature; | 17 import org.opengis.feature.simple.SimpleFeature; |
587 String srs = "EPSG:" + srid; | 586 String srs = "EPSG:" + srid; |
588 | 587 |
589 Floodplain plain = Floodplain.getFloodplain(river); | 588 Floodplain plain = Floodplain.getFloodplain(river); |
590 | 589 |
591 SimpleFeatureType ft = GeometryUtils.buildFeatureType( | 590 SimpleFeatureType ft = GeometryUtils.buildFeatureType( |
592 "talaue", srs, MultiPolygon.class); | 591 "talaue", srs, Polygon.class); |
593 | 592 |
594 SimpleFeatureBuilder builder = new SimpleFeatureBuilder(ft); | 593 SimpleFeatureBuilder builder = new SimpleFeatureBuilder(ft); |
595 builder.add(plain.getGeom()); | 594 builder.add(plain.getGeom()); |
596 | 595 |
597 FeatureCollection collection = FeatureCollections.newCollection(); | 596 FeatureCollection collection = FeatureCollections.newCollection(); |
599 | 598 |
600 File talaueShape = new File(dir, WSPLGEN_FLOODPLAIN); | 599 File talaueShape = new File(dir, WSPLGEN_FLOODPLAIN); |
601 | 600 |
602 boolean t = GeometryUtils.writeShapefile( | 601 boolean t = GeometryUtils.writeShapefile( |
603 talaueShape, | 602 talaueShape, |
604 GeometryUtils.buildFeatureType("talaue", srs, MultiPolygon.class), | 603 GeometryUtils.buildFeatureType("talaue", srs, Polygon.class), |
605 collection); | 604 collection); |
606 | 605 |
607 if (t) { | 606 if (t) { |
608 job.setArea(talaueShape.getAbsolutePath()); | 607 job.setArea(talaueShape.getAbsolutePath()); |
609 } | 608 } |