惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
IT之家
IT之家
博客园 - Franky
博客园_首页
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
量子位
阮一峰的网络日志
阮一峰的网络日志
月光博客
月光博客
V
V2EX
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
M
MIT News - Artificial intelligence
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
小众软件
小众软件
Jina AI
Jina AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog RSS Feed

博客园 - Xuemin_Zhang

Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. 国外7个源代码/库搜索引擎网站 【转】屏蔽优酷、土豆等视频网站15秒广告的最全最简单方法 QT编译之错--”Basic XLib functionality test failed!” [转]国内地图服务可用性比较 Ubuntu下安装jdk Linux下解压缩命令汇总 SlickEdit 2010破解 C++ std::pair 与 std::make_pair NetBeans IDE 配置qmake在qvfb下开发 - Xuemin_Zhang Navit学习笔记(六)-- Navit的attr模型 Navit学习笔记(五) Navit学习笔记(四) C语言宏定义中#与##的用法 - Xuemin_Zhang - 博客园 Navit学习笔记(三) Navit学习笔记(一) 论文答辩PPT制作攻略 Qt乱码问题 - Xuemin_Zhang - 博客园 [转]gcc交叉编译错误之一: multiple definition of - Xuemin_Zhang
Navit学习笔记(二)
Xuemin_Zhang · 2010-09-05 · via 博客园 - Xuemin_Zhang

  上一篇《Navit学习笔记(一)》主要简要阐述了Navit的一些特征,怎样下载源代码、怎样在Unbuntu 10.04下进行安装的准备并进行默认安装。因为Navit是模块化设计的,根据安装平台的不同需求对其进行配置。本文的主要目的是讲述Navit的配置问题。

  Navit的设置是通过编辑navit.xml文件实现的。当登入Navit是,程序会加载navit.xml文件设置程序。如果是SVN获取的源代码navit.xml文件在主目录下,如果是安装程序,配置文件在/usr/shared/navit 或者 /etc/navit文件夹下。

  1、用户图形接口

  Navit通过插件形式提供多种用户图形接口。下面简要的介绍一下两种已经成功地嵌入于Navit的GUI。

  Internal GUI:它是当前最新的GUI主要是用于触摸屏设备的,这个GUI现在还在不同的开发完善中。由于本学习笔记针对Navit的核心模块和功能,对于触摸屏设置这部分还请大家参考《Internal GUI》,那里有这部分的具体实现新式和最新进展。

  GTK GUI:在本文中,我们将简要介绍GTK,更详细的介绍请查阅《Custom GTK Tutorial》 GTK是Navit默认的GUI,其一般设置如下:

* menubar="0" will disable the menu bar. Useful on devices with small screens
* toolbar="0" will disable the tool bar. Useful on devices with small screens
* statusbar="0" will disable the status bar. Useful on devices with small screens 

  2、一些可以更改的设置

  加载起始点(起始经纬值)

  GSP 模块可以为 Navit 提供当地的经纬度值,也就是说可以为Navit提供起始位置。但我们也可以手动设置,特别是没有GPS模块时。当地的经纬度信息可以从http://maps.google.com/上获取,也可以从http://itouchmap.com/latlong.html 获取,在navit.xml 文件中设置如下:

<navit gui="..." graphics="..." center="3957 N 11618 E" zoom="128" >

  注:设置中的经纬度的值是实际经纬度值 x 100,并取整。

  地图设置

  在使用Navit前,要在navit.xml 添加我们的地图。Navit 能够使用多种地图格式。以下是一些能在Navit上使用的地图格式设置向导链接,大家可以根据自己的关注点查看详细信息,本文将以Open Street Maps 地图格式为例阐述Navit的地图设置。

*For a guide on using Open Street aps please go to the Open Street Maps Guide
*For a guide on using European maps please go to the European Maps Guide
*For a guide on using Garmin aps please go to the Garmin Maps Guide
*For information regarding US/Tiger Data aps please go to Tiger Maps Guide
*For other maps not included please refer to the Other Maps Guide 

  我们可以从“Navit Planet Extractor”上获取你想要的OSM地图(这里是北京市区的地图)。然后在navit.xml文件添加

<map type="binfile" enabled="yes" data="/path/to/beijing.bin" />

  车辆导航

  这一节设置Navit的GPS数据源,Navit支持三种数据源获取方式:网络、文件和GPS设备。

* source="file://mynmea.log" : here, navit will replay the nmea logfile mynmea.log
* source="file:/dev/ttyS0" - /dev/ttyS0 for serial GPS connected to the first serial port
* source="file:/dev/rfcomm0" - BlueTooth GPS, /dev/rfcomm0 must be configured in /etc/bluetooth/rfcomm.conf
* source="pipe:/usr/bin/gpspipe -r" - any executable that produces NMEA output - gpsbabel, gpspipe, ... 

  调试

  当Navit程序崩溃时,它能够自动的启动gdb进行调式。但需要对navit.xml进行设置。

<debug name="segv" level="0" />

  如果想要得到更多的关于系统错误的信息

<debug name=osd_core level="1" /><debug name=osd_core:osd_nav_next_turn_draw level="1" />

  其中level的设置值如下:

    * level="0" : just let navit crash
    
* level="1" : let navit display a backtrace with gdb. This is the default setting.
    
* level="2" : let navit enter an interactive gdb session 

3、深入学习配置文件

配置文件构造

配置的文件的构造可以通过主目录下的navit.dtd文件查看。查看配置文件,最先出现的是<plugins>节,这一节的说明我们稍候阐述。接下来,我们可以看到Navit的初始化设置。

*gui 默认设置

*一辆或者多辆车辆的跟踪(GPS数据)

*地图设置,使用一个或者多个地图数据

<mapset>
<map type="mg" enabled="yes" data="/opt/reiseplaner/travel/DE.map" />
<map type="mg" enabled="yes" data="/opt/reiseplaner/travel/DE.map/smp2.smp" />
</mapset>

*最后添加显示的层数。