use of org.geotoolkit.data.kml.model.AltitudeMode in project geotoolkit by Geomatys.
the class GxReader method readMultiTrack.
public MultiTrack readMultiTrack() throws XMLStreamException, KmlException, URISyntaxException {
AltitudeMode altitudeMode = DEF_ALTITUDE_MODE;
boolean interpolate = DEF_INTERPOLATE;
List<Track> tracks = new ArrayList<Track>();
boucle: while (reader.hasNext()) {
switch(reader.next()) {
case XMLStreamConstants.START_ELEMENT:
final String eName = reader.getLocalName();
final String eUri = reader.getNamespaceURI();
if (URI_GX.equals(eUri)) {
if (TAG_ALTITUDE_MODE.equals(eName)) {
altitudeMode = this.readAltitudeMode();
} else if (TAG_INTERPOLATE.equals(eName)) {
interpolate = parseBoolean(this.reader.getElementText());
} else if (TAG_TRACK.equals(eName)) {
tracks.add(this.readTrack());
}
} else if (this.kmlReader.getVersionUri().equals(eUri)) {
if (KmlConstants.TAG_ALTITUDE_MODE.equals(eName)) {
altitudeMode = kmlReader.readAltitudeMode();
}
}
break;
case XMLStreamConstants.END_ELEMENT:
if (TAG_MULTI_TRACK.equals(reader.getLocalName()) && URI_GX.contains(reader.getNamespaceURI())) {
break boucle;
}
break;
}
}
return GX_FACTORY.createMultiTrack(altitudeMode, interpolate, tracks);
}
Aggregations