We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
这个问题太老了,答案也太老了。
感谢开源世界,我们现在在 google 代码上有了 jgpx (在 github 上分叉多次)和 GPXParser,位于 sourceforge.net。 Github 上的搜索。
我不确定哪一个更成熟(其中一个被标记为 Alpha),但您可以尝试一下并在这里告诉我们。
编辑
看看 processing-gpx ,看起来很有希望。
这是一个简单的例子
This question is too old and so do the answers.
Thanks to the open source world, we have now jgpx, on google code (forked multiple times on github) and GPXParser, on sourceforge.net. There are also a lot of results for a search on Github.
I'm not sure which one is more mature (one of them is marked as Alpha) but you can try them and let us know here.
Edit
Have a look at processing-gpx, it seems promising.
Here is a quick example
经过一番研究,确实没有用于解析 GPX 文件的 Java API/Lib,但我找到了一种使用 JAXB 解析它的好方法
使用本教程:http://www.oracle.com /technetwork/articles/javase/index-140168.html
步骤:
1.下载GPX 1.0和1.1架构文件(xsd)
2. 使用 Eclipse 插件< br>
3.使用生成的GPX java文件的包名初始化JAXBContext(我的是“topografix.gpx.schema10”)
4.解析GPX文件
After some research, there is really no Java API/Lib for parsing GPX files, but I found a nice approach for parsing it using JAXB
Using this Tutorial: http://www.oracle.com/technetwork/articles/javase/index-140168.html
Steps:
1. Download GPX 1.0 and 1.1 Schema file (xsd)
2. Generate Java File from it using Eclipse Plugin
3. Init JAXBContext with package name of generated GPX java files (mine was "topografix.gpx.schema10")
4. Parse GPX File
很不错。但是,我需要这样做:
顺便说一句,我使用了 http://www.topografix.com/GPX/ 1/1。
-肯
Very nice. However, I needed to do:
BTW I used http://www.topografix.com/GPX/1/1.
-Ken
即用型、开源且功能齐全的 java GpxParser(以及更多)在这里
https://sourceforge.net/projects/geokarambola/
详细信息请参见此处
https://plus.google.com/u/0/communities/110606810455751902142
有了上面的库,解析 GPX 文件就很简单了:
获取它的点、路线或轨迹也很简单:
Ready to use, open source, and fully functional java GpxParser (and much more) here
https://sourceforge.net/projects/geokarambola/
Details here
https://plus.google.com/u/0/communities/110606810455751902142
With the above library parsing a GPX file is a one liner:
Getting its points, routes or tracks trivial too:
我不知道有任何专门用于解析 GPX 文件的库,但由于 GPX 是 XML,因此您可以使用您首选的 Java XML 解析器来读取它。
GPX 格式记录在此处(包括 XSD 架构):
http://www.topografix.com/gpx.asp
I'm not aware of any library specialized in parsing GPX files, but since GPX is XML you can use your preferred Java XML parser for reading it.
The GPX format is documented here (includes XSD schema):
http://www.topografix.com/gpx.asp