这是我到目前为止所提出的.首先,您需要某种图形库.我去了gnuplot,因为我找到了Ruby binding,但R这些天看起来很热.我创建了一个小脚本,用于转换GPX文件并将数据提供给gnuplot,结果如下:alt text http://dl.dropbox.com/u/45672/gpslog.png
这看起来很好,但gnuplot似乎真的是一个创建图形的工具,而不是空间数据.这是做到这一点的方式还是有更好的解决方案?
这是另一个example,你知道如何构建这样的东西吗?
解决方法
既然你说你“想在Ruby中做这件事……如果这是一个可以接受的工具”,那么我会假装你可以接受一个非Ruby解决方案,如果它满足你所有的其他需求.
我推荐Python主要是因为在Beginning Python Visualization的第一章中,作者Shai Vaingast通过一个从GPS接收器读取GPS数据然后绘制结果的例子.如果您对基于Python的解决方案持开放态度,那么本书将是一本很好的资源.
以下是用于读取和绘制GPS数据的Python包:
> pySerial从串口读取GPS数据
> matplotlib绘制数据. “matplotlib是一个用Python制作2D图形的库.虽然它起源于模拟MATLAB®图形命令,但它独立于MATLAB,可以以Pythonic,面向对象的方式使用.”
以下是Shai Vaingast创建的示例图,展示了绘制GPS数据的matplotlib的一些不同功能.
如果您不熟悉Python解决方案,并且更喜欢Ruby,无论出于何种原因 – 我理解.我试图在Ruby中搜索相当于matplotlib,但我找不到相同的包.
回答最后一个问题
Here is another 07007,any idea how you build stuff like this?
看着右下角,看起来DISLIN用于创建该图像.虽然DISLIN可用于很多编程语言,但DISLIN software requirements页面并未显示支持Ruby.
根据DISLIN网站,
DISLIN is a high-level plotting library for displaying data as curves,polar plots,bar graphs,pie charts,3D-color plots,surfaces,contours and maps.
The software is available for several C,Fortran 77 and Fortran 90/95 compilers on the operating systems UNIX,Linux,FreeBSD,OpenVMS,Windows,Mac OSX and MS-DOS. DISLIN programs are very system-independent,they can be ported from one operating system to another without any changes.
For some operating systems,the programming languages Perl,Python,Java and the C/C++ interpreter Ch are also supported by DISLIN. The DISLIN interpreter DISGCL is availble for all supported operating systems. See a complete list of the supported operating systems and compilers.