Revision 11484 trunk/libraries/libGPE-KML/src/org/gvsig/gpe/kml/writer/geometries/LineStringWriter.java
LineStringWriter.java | ||
---|---|---|
49 | 49 |
* |
50 | 50 |
* $Id$ |
51 | 51 |
* $Log$ |
52 |
* Revision 1.2 2007-05-02 11:46:50 jorpiell |
|
52 |
* Revision 1.3 2007-05-08 07:53:08 jorpiell |
|
53 |
* Add comments to the writers |
|
54 |
* |
|
55 |
* Revision 1.2 2007/05/02 11:46:50 jorpiell |
|
53 | 56 |
* Writing tests updated |
54 | 57 |
* |
55 | 58 |
* Revision 1.1 2007/04/14 16:08:07 jorpiell |
... | ... | |
58 | 61 |
* |
59 | 62 |
*/ |
60 | 63 |
/** |
61 |
* @author Jorge Piera LLodr? (jorge.piera@iver.es) |
|
64 |
* It writes the LineString tag. Example: |
|
65 |
* <p> |
|
66 |
* <pre> |
|
67 |
* <code> |
|
68 |
* <LineString> |
|
69 |
* <coord><X>56.1</X><Y>0.45</Y></coord> |
|
70 |
* <coord><X>67.23</X><Y>0.98</Y></coord> |
|
71 |
* </LineString> |
|
72 |
* </code> |
|
73 |
* </pre> |
|
74 |
* </p> |
|
75 |
* @author Jorge Piera Llodr? (piera_jor@gva.es) |
|
76 |
* @see http://code.google.com/apis/kml/documentation/kml_tags_21.html#linestring |
|
62 | 77 |
*/ |
63 | 78 |
public class LineStringWriter { |
64 |
|
|
65 |
public static void start(Writer writer,String id, double[] x, double[] y, |
|
66 |
double[] z) throws IOException{ |
|
79 |
|
|
80 |
/** |
|
81 |
* It writes the lineString kml init tag |
|
82 |
* @param writer |
|
83 |
* Writer to write the labels |
|
84 |
* @param id |
|
85 |
* LineString id |
|
86 |
* @param longitudes |
|
87 |
* Array of longitudes (>= -180 and <= 180) |
|
88 |
* @param latitudes |
|
89 |
* Array of latitudes (>= -90 and <= 90) |
|
90 |
* @param altitudes |
|
91 |
* Array of altitudes (Meters above sea level) |
|
92 |
* @throws IOException |
|
93 |
*/ |
|
94 |
public static void start(Writer writer,String id, double[] longitudes, double[] latitudes, |
|
95 |
double[] altitudes) throws IOException{ |
|
67 | 96 |
GeometriesWriter.startGeometry(writer, KmlTags.LINESTRING, id); |
68 |
CoordinatesWriter.write(writer, x, y, z);
|
|
97 |
CoordinatesWriter.write(writer, longitudes, latitudes, altitudes);
|
|
69 | 98 |
} |
70 | 99 |
|
100 |
/** |
|
101 |
* It writes the lineString kml end tag |
|
102 |
* @param writer |
|
103 |
* Writer to write the labels |
|
104 |
* @throws IOException |
|
105 |
*/ |
|
71 | 106 |
public static void end(Writer writer) throws IOException{ |
72 | 107 |
GeometriesWriter.endGeometry(writer, KmlTags.LINESTRING); |
73 | 108 |
} |
Also available in: Unified diff