Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ExtendedData and Model to gx:Track #259

Open
cleder opened this issue Oct 30, 2023 · 0 comments
Open

Add ExtendedData and Model to gx:Track #259

cleder opened this issue Oct 30, 2023 · 0 comments

Comments

@cleder
Copy link
Owner

cleder commented Oct 30, 2023

https://developers.google.com/kml/documentation/kmlreference#example-of-track-with-extended-data

    <Schema id="schema">
      <gx:SimpleArrayField name="heartrate" type="int">
        <displayName>Heart Rate</displayName>
      </gx:SimpleArrayField>
      <gx:SimpleArrayField name="cadence" type="int">
        <displayName>Cadence</displayName>
      </gx:SimpleArrayField>
      <gx:SimpleArrayField name="power" type="float">
        <displayName>Power</displayName>
      </gx:SimpleArrayField>
    </Schema>
      <Placemark>
        <name>2010-05-28T01:16:35.000Z</name>
        <styleUrl>#multiTrack</styleUrl>
        <gx:Track>
          <when>2010-05-28T02:02:09Z</when>
          <when>2010-05-28T02:02:35Z</when>
          <when>2010-05-28T02:02:44Z</when>
          <when>2010-05-28T02:02:53Z</when>
          <when>2010-05-28T02:02:54Z</when>
          <when>2010-05-28T02:02:55Z</when>
          <when>2010-05-28T02:02:56Z</when>
          <gx:coord>-122.207881 37.371915 156.000000</gx:coord>
          <gx:coord>-122.205712 37.373288 152.000000</gx:coord>
          <gx:coord>-122.204678 37.373939 147.000000</gx:coord>
          <gx:coord>-122.203572 37.374630 142.199997</gx:coord>
          <gx:coord>-122.203451 37.374706 141.800003</gx:coord>
          <gx:coord>-122.203329 37.374780 141.199997</gx:coord>
          <gx:coord>-122.203207 37.374857 140.199997</gx:coord>
          <ExtendedData>
            <SchemaData schemaUrl="#schema">
              <gx:SimpleArrayData name="cadence">
                <gx:value>86</gx:value>
                <gx:value>103</gx:value>
                <gx:value>108</gx:value>
                <gx:value>113</gx:value>
                <gx:value>113</gx:value>
                <gx:value>113</gx:value>
                <gx:value>113</gx:value>
              </gx:SimpleArrayData>
              <gx:SimpleArrayData name="heartrate">
                <gx:value>181</gx:value>
                <gx:value>177</gx:value>
                <gx:value>175</gx:value>
                <gx:value>173</gx:value>
                <gx:value>173</gx:value>
                <gx:value>173</gx:value>
                <gx:value>173</gx:value>
              </gx:SimpleArrayData>
              <gx:SimpleArrayData name="power">
                <gx:value>327.0</gx:value>
                <gx:value>177.0</gx:value>
                <gx:value>179.0</gx:value>
                <gx:value>162.0</gx:value>
                <gx:value>166.0</gx:value>
                <gx:value>177.0</gx:value>
                <gx:value>183.0</gx:value>
              </gx:SimpleArrayData>
            </SchemaData>
          </ExtendedData>
        </gx:Track>
      </Placemark>

Schema:

<complexType name="TrackType">
    <complexContent>
      <extension base="kml:AbstractGeometryType">
        <sequence>
          <element ref="kml:extrude" minOccurs="0"/>
          <element ref="kml:tessellate" minOccurs="0"/>
          <element ref="kml:altitudeModeGroup" minOccurs="0"/>
          <element ref="kml:when" minOccurs="0" maxOccurs="unbounded"/>
          <element ref="gx:coord" minOccurs="0" maxOccurs="unbounded"/>
          <element ref="gx:angles" minOccurs="0" maxOccurs="unbounded"/>
          <element ref="kml:Model" minOccurs="0"/>
          <element ref="kml:ExtendedData" minOccurs="0"/>
          <element ref="gx:AbstractTrackSimpleExtensionGroup" minOccurs="0"
            maxOccurs="unbounded"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>

  <element name="SimpleArrayField" type="gx:SimpleArrayFieldType"
    substitutionGroup="kml:SchemaExtension"/>

  <complexType name="SimpleArrayFieldType">
    <sequence>
      <element ref="kml:displayName" minOccurs="0"/>
      <element ref="gx:SimpleArrayFieldExtension" minOccurs="0"
        maxOccurs="unbounded"/>
    </sequence>
    <attribute name="type" type="string"/>
    <attribute name="name" type="string"/>
  </complexType>
  <element name="SimpleArrayFieldExtension" abstract="true"/>

  <element name="SimpleArrayData" type="gx:SimpleArrayDataType"
    substitutionGroup="kml:SchemaDataExtension"/>

  <complexType name="SimpleArrayDataType">
    <complexContent>
      <extension base="kml:AbstractObjectType">
        <sequence>
          <element ref="gx:value" minOccurs="0" maxOccurs="unbounded"/>
          <element ref="gx:SimpleArrayDataExtension" minOccurs="0"
            maxOccurs="unbounded"/>
        </sequence>
        <attribute name="name" type="string"/>
      </extension>
    </complexContent>
  </complexType>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant