Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/raster/DemuxRingsHandler.java @ 852:b5f4b6073cde
Calculate the depth in an odv export of a 'Profilschnitt' properly (issue217).
gnv-artifacts/trunk@968 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 22 Apr 2010 08:54:36 +0000 |
parents | feae2f9d6c6f |
children | f953c9a559d8 |
rev | line source |
---|---|
465
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.gnv.raster; |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
2 |
779
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
3 import de.intevation.gnv.raster.Vectorizer.Edge; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
4 import de.intevation.gnv.raster.Vectorizer.RingsHandler; |
b1f5f2a8840f
Ordered imports. Removed needless imports. Removed empty headers.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
778
diff
changeset
|
5 |
465
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
6 import java.util.ArrayList; |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
7 import java.util.List; |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
8 |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 /** |
802
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
10 * Ring Handler that demultiplexes to a list of other ring handlers. |
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
11 * Handy if you want to pipe the polygons and line strings produced |
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
12 * by the Vectorize to more than one handler at once. |
803
feae2f9d6c6f
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
802
diff
changeset
|
13 * |
780
c4156275c1e1
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
779
diff
changeset
|
14 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> |
465
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 */ |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 public class DemuxRingsHandler |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 implements RingsHandler |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 { |
802
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
19 /** |
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
20 * The list of internal ring handlers. |
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
21 */ |
465
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 protected ArrayList<RingsHandler> handlers; |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 |
802
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
24 /** |
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
25 * Default constructor. |
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
26 */ |
465
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 public DemuxRingsHandler() { |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 handlers = new ArrayList<RingsHandler>(); |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 } |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 |
802
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
31 /** |
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
32 * Add a ring handler to the list of handlers. |
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
33 * @param handler The handler to add to the internal list. |
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
34 */ |
465
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 public void addHandler(RingsHandler handler) { |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 handlers.add(handler); |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 } |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 public void handleRings( |
778
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
465
diff
changeset
|
40 List<Edge> rings, |
9a828e5a2390
Removed trailing whitespace
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
465
diff
changeset
|
41 int value, |
465
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 int width, |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 int height |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 ) { |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 for (RingsHandler handler: handlers) { |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 handler.handleRings(rings, value, width, height); |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 } |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 } |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
49 |
802
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
50 /** |
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
51 * Empties the internal list of ring handlers. |
4abe172be970
Finished Javadoc of the raster package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
780
diff
changeset
|
52 */ |
465
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
53 public void clear() { |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
54 handlers.clear(); |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
55 } |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
56 } |
f7038820df2e
Added support to trace rasters to JTS multi polygons and multi line strings.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
57 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |