从 GPX 文件创建 XSD 文件
Posted
技术标签:
【中文标题】从 GPX 文件创建 XSD 文件【英文标题】:Create XSD file from GPX file 【发布时间】:2021-02-16 17:44:43 【问题描述】:我有一个 GPX 文件,我想将它解组为 java 类。 首先,我需要创建一个 XSD 文件,这将帮助我解组。 我不知道如何从 GPX 文件创建 XSD,请帮助。 以下是我尝试为其生成 XSD 的示例 GPX 文件内容。
<?xml version="1.0"?>
<gpx version="1.1" creator="AMG Track Pace" xmlns="http://www.topografix.com/GPX/1/1" xmlns:amg="https://www.mercedes-amg.com/xsd/gpx-ext">
<metadata>
<name>Sandown International Raceway</name>
<time>2019-10-21T22:51:10</time>
<extensions>
<trackMeta>
<amg:name>Sandown International Raceway</amg:name>
<amg:guid>00000000-27bc-b800-f7c2-000000a1ae9b</amg:guid>
<amg:rec>1</amg:rec>
<amg:length>3131.9</amg:length>
<amg:bestRaceNumber>0</amg:bestRaceNumber>
<amg:bestLapNumber>0</amg:bestLapNumber>
</trackMeta>
</extensions>
</metadata>
<trk>
<trkseg>
<trkpt lat="-37.9493280" lon="145.1643630">
<ele>53.9</ele>
<extensions>
<heading>176.001</heading>
<distanceFromStart>0</distanceFromStart>
</extensions>
</trkpt>
<trkpt lat="-37.9493284" lon="145.1643630">
<ele>53.9</ele>
<extensions>
<heading>175.972</heading>
<distanceFromStart>0.0452761</distanceFromStart>
</extensions>
</trkpt>
<trkpt lat="-37.9493286" lon="145.1643630">
<ele>53.9</ele>
<extensions>
<heading>175.961</heading>
<distanceFromStart>0.0689919</distanceFromStart>
</extensions>
</trkpt>
<trkpt lat="-37.9493287" lon="145.1643630">
<ele>53.9</ele>
<extensions>
<heading>175.949</heading>
<distanceFromStart>0.0797715</distanceFromStart>
</extensions>
</trkpt>
<trkpt lat="-37.9493288" lon="145.1643630">
<ele>53.9</ele>
<extensions>
<heading>175.926</heading>
<distanceFromStart>0.0883952</distanceFromStart>
</extensions>
</trkpt>
<trkpt lat="-37.9493288" lon="145.1643630">
<ele>53.9</ele>
<extensions>
<heading>175.886</heading>
<distanceFromStart>0.0905511</distanceFromStart>
</extensions>
</trkpt>
<trkpt lat="-37.9493289" lon="145.1643630">
<ele>53.9</ele>
<extensions>
<heading>175.864</heading>
<distanceFromStart>0.0970189</distanceFromStart>
</extensions>
</trkpt>
</trkseg>
</trk>
</gpx>
【问题讨论】:
【参考方案1】:没有必要创建一个GPX XSD,因为已经有一个official GPX 1.1 XSD。
【讨论】:
以上是关于从 GPX 文件创建 XSD 文件的主要内容,如果未能解决你的问题,请参考以下文章