Search in sources :

Example 11 with AltitudeMode

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);
}
Also used : ArrayList(java.util.ArrayList) EnumAltitudeMode(org.geotoolkit.data.gx.model.EnumAltitudeMode) AltitudeMode(org.geotoolkit.data.kml.model.AltitudeMode) Track(org.geotoolkit.data.gx.model.Track) MultiTrack(org.geotoolkit.data.gx.model.MultiTrack)

Aggregations

ArrayList (java.util.ArrayList)11 AltitudeMode (org.geotoolkit.data.kml.model.AltitudeMode)11 Entry (java.util.Map.Entry)9 EnumAltitudeMode (org.geotoolkit.data.kml.model.EnumAltitudeMode)9 Extensions (org.geotoolkit.data.kml.model.Extensions)9 IdAttributes (org.geotoolkit.data.kml.model.IdAttributes)9 LineString (org.geotoolkit.data.kml.model.LineString)9 SimpleTypeContainer (org.geotoolkit.data.kml.xsd.SimpleTypeContainer)9 CoordinateSequence (org.locationtech.jts.geom.CoordinateSequence)4 AtomLink (org.geotoolkit.atom.model.AtomLink)2 EnumAltitudeMode (org.geotoolkit.data.gx.model.EnumAltitudeMode)2 Color (java.awt.Color)1 URI (java.net.URI)1 Calendar (java.util.Calendar)1 AtomPersonConstruct (org.geotoolkit.atom.model.AtomPersonConstruct)1 Angles (org.geotoolkit.data.gx.model.Angles)1 MultiTrack (org.geotoolkit.data.gx.model.MultiTrack)1 Track (org.geotoolkit.data.gx.model.Track)1 AbstractLatLonBox (org.geotoolkit.data.kml.model.AbstractLatLonBox)1 AbstractStyleSelector (org.geotoolkit.data.kml.model.AbstractStyleSelector)1