Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/utils/GeometryUtils.java @ 1641:eb3ab28d1c21
The extent of the WSPLGEN facets are now determined by the extent of the start and end CrossSectionTrack of the WSPLGEN calculation.
flys-artifacts/trunk@2827 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 26 Sep 2011 15:35:46 +0000 |
parents | 0398c2b8dbaf |
children | 092e1e5020bc |
comparison
equal
deleted
inserted
replaced
1640:fb296bdf815f | 1641:eb3ab28d1c21 |
---|---|
74 | 74 |
75 return "" + c[0].x + " " + c[1].y + " " + c[1].x + " " + c[0].y; | 75 return "" + c[0].x + " " + c[1].y + " " + c[1].x + " " + c[0].y; |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 public static String createOLBounds(Geometry a, Geometry b) { | |
80 Coordinate[] ca = a.getCoordinates(); | |
81 Coordinate[] cb = b.getCoordinates(); | |
82 | |
83 double lowerX = Double.MAX_VALUE; | |
84 double lowerY = Double.MAX_VALUE; | |
85 double upperX = -Double.MAX_VALUE; | |
86 double upperY = -Double.MAX_VALUE; | |
87 | |
88 for (Coordinate c: ca) { | |
89 lowerX = lowerX < c.x ? lowerX : c.x; | |
90 lowerY = lowerY < c.y ? lowerY : c.y; | |
91 | |
92 upperX = upperX > c.x ? upperX : c.x; | |
93 upperY = upperY > c.y ? upperY : c.y; | |
94 } | |
95 | |
96 for (Coordinate c: cb) { | |
97 lowerX = lowerX < c.x ? lowerX : c.x; | |
98 lowerY = lowerY < c.y ? lowerY : c.y; | |
99 | |
100 upperX = upperX > c.x ? upperX : c.x; | |
101 upperY = upperY > c.y ? upperY : c.y; | |
102 } | |
103 | |
104 return "" + lowerX + " " + lowerY + " " + upperX + " " + upperY; | |
105 } | |
106 | |
107 | |
79 public static SimpleFeatureType buildFeatureType( | 108 public static SimpleFeatureType buildFeatureType( |
80 String name, String srs, Class geometryType) | 109 String name, String srs, Class geometryType) |
81 { | 110 { |
82 return buildFeatureType(name, srs, geometryType, null); | 111 return buildFeatureType(name, srs, geometryType, null); |
83 } | 112 } |