summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjkoan <jkoan@users.noreply.github.com>2019-10-28 14:36:01 +0100
committerGitHub <noreply@github.com>2019-10-28 14:36:01 +0100
commitade44b6247202adb53a89d114d35e36353a19532 (patch)
tree693ee0f3b9df9918eb9b06f1ee43c178a29c0f0c
parent6c468813a9070f1566e7d07102bb8b5d02905ff9 (diff)
parent0b0a073e5f4197120dccf2a8097f4f10388fafd0 (diff)
downloadnavit-ade44b6247202adb53a89d114d35e36353a19532.tar.gz
Merge branch 'trunk' into aerostitch/docs
-rw-r--r--docs/basic_configuration.rst16
-rw-r--r--docs/configuration/advanced.rst3
-rw-r--r--docs/configuration/display.rst19
-rw-r--r--docs/configuration/general.rst27
-rw-r--r--docs/configuration/index.rst152
-rw-r--r--docs/configuration/layout.rst40
-rw-r--r--docs/configuration/vehicle.rst41
-rw-r--r--docs/development/android_development.rst16
-rw-r--r--docs/development/linux_development.rst31
-rw-r--r--docs/development/programming_guidelines.rst2
-rw-r--r--docs/development/wince_development.rst22
-rw-r--r--docs/development/windows_development.rst24
-rw-r--r--docs/index.rst4
-rw-r--r--docs/maps.rst1
-rw-r--r--docs/navit.pngbin367957 -> 367917 bytes
-rw-r--r--docs/osm.rst42
-rw-r--r--navit/maptool/CMakeLists.txt4
-rw-r--r--navit/maptool/boundaries.c2
-rw-r--r--navit/maptool/buffer.c2
-rw-r--r--navit/maptool/ch.c2
-rw-r--r--navit/maptool/coastline.c2
-rw-r--r--navit/maptool/itembin.c33
-rw-r--r--navit/maptool/itembin_buffer.c2
-rw-r--r--navit/maptool/itembin_slicer.c856
-rw-r--r--navit/maptool/maptool.c2
-rw-r--r--navit/maptool/maptool.h15
-rw-r--r--navit/maptool/misc.c2
-rw-r--r--navit/maptool/osm.c27
-rw-r--r--navit/maptool/osm_protobuf.c2
-rw-r--r--navit/maptool/osm_protobufdb.c2
-rw-r--r--navit/maptool/osm_psql.c2
-rw-r--r--navit/maptool/osm_relations.c2
-rw-r--r--navit/maptool/osm_xml.c2
-rw-r--r--navit/maptool/sourcesink.c2
-rw-r--r--navit/maptool/tempfile.c2
-rw-r--r--navit/maptool/tile.c13
-rw-r--r--navit/maptool/zip.c2
37 files changed, 1152 insertions, 266 deletions
diff --git a/docs/basic_configuration.rst b/docs/basic_configuration.rst
index 250a6686f..5fa20f6e3 100644
--- a/docs/basic_configuration.rst
+++ b/docs/basic_configuration.rst
@@ -1,10 +1,11 @@
There are much more options, see [[configuration]].
+***********
Preparation
-===========
+***********
Get a supported map package
---------------------------
-Navit can use different :doc:`maps` formats, including free :ref:`OpenStreetMap` data. In order to use one of these maps, download a map of your desired area and store it into a local folder (such as navit/maps or /usr/share/navit/maps).
+Navit can use different :doc:`maps` formats, including free `OpenStreetMap` data. In order to use one of these maps, download a map of your desired area and store it into a local folder (such as navit/maps or /usr/share/navit/maps).
Install TTS
-----------
@@ -28,8 +29,9 @@ Most GPS receiver will output the position in [[NMEA]] format, which can be used
The output should give you steady NMEA position updates. You can feed this information into **gpsd** / **xgps** or **QLandkarte** to see a graphical representation of your position and to check whether the output corresponds to your current position.
-Configuring
-===========
+***************
+Getting started
+***************
Currently Navit doesn't provide a graphical tool to change settings, so you have to do the changes manually using a texteditor.
Please open your current **navit.xml** file and do the following steps:
@@ -43,7 +45,7 @@ On Navit's very first startup, it needs a **center** to look at on the map. By d
<navit center="4808 N 1134 E" />
-See furthermore: [[Configuration]]
+See furthermore: :doc:`configuration/index`
Setup GPS
@@ -52,9 +54,9 @@ Add the GPS connection
.. code-block:: xml
- <vehicle name="My" enabled="yes" source="file://dev/ttyS0"/ active="1"/>
+ <vehicle name="My" enabled="yes" source="file://dev/ttyS0" active="1"/>
-See furthermore: [[Configuration]]
+See furthermore: :doc:`configuration/index`
Enable Map
diff --git a/docs/configuration/advanced.rst b/docs/configuration/advanced.rst
index 68066af03..8c97dce16 100644
--- a/docs/configuration/advanced.rst
+++ b/docs/configuration/advanced.rst
@@ -1,5 +1,6 @@
Advanced Options
================
+
The rest of this webpage is meant for advanced/power users who'd like to fiddle a little more under-the-hood. The average user can safely ignore this section!
Speech
@@ -32,7 +33,7 @@ espeak
~~~~~~
.. code-block:: xml
- <speech type="cmdline" data="espeak -s 150 -v english_rp %s"/>
+ <speech type="cmdline" data="espeak -s 150 -v english_rp %s"/>
Will use espeak instead, for those who want Navit to speak to them in English, at 150 words per minute. The ''%s'' is filled in by Navit when sent to the speech synthesis software (with something like "Turn left" or whatever is appropriate at the time). If you need more features, you should use an external wrapper script which can contain anything supported by your shell (see [[Translations]]).
diff --git a/docs/configuration/display.rst b/docs/configuration/display.rst
index f822d053b..9202ae6f6 100644
--- a/docs/configuration/display.rst
+++ b/docs/configuration/display.rst
@@ -1,5 +1,5 @@
Display Options
----------------
+===============
The Navit display is highly customisable and consists of the following components
* Graphics driver (appropriate engine for your system, to draw everything)
@@ -31,9 +31,10 @@ They can be activated and configured as following:
.. code-block:: xml
- <graphics type="gtk_drawing_area"/>
+ <graphics type="gtk_drawing_area" />
+
-As mentioned, it's usually best to leave this as whatever the default is within your :xml:`navit.xml`, and only mess around with it if you know what you are doing, or have been told to by one of the developers.
+As mentioned, it's usually best to leave this as whatever the default is within your `navit.xml`, and only mess around with it if you know what you are doing, or have been told to by one of the developers.
Graphical User Interface
------------------------
@@ -56,11 +57,11 @@ There are some options available for the ``gui`` tag which are used by all the G
* **pitch** - The pitch value to pitch the map to when selecting 3D mode from the menus.
* **dimensions** - w="1024" h="600"
-The following example uses the :xml:`internal` GUI, and starts Navit up in fullscreen mode, and will pitch the map to 35 degrees when 3D mode is selected from the menu. Note that to start Navit in 3D mode by default, [[#Initial 3D pitch|change the :xml:`pitch` value in the :xml:`navit` tag]]:
+The following example uses the `internal` GUI, and starts Navit up in fullscreen mode, and will pitch the map to 35 degrees when 3D mode is selected from the menu. Note that to start Navit in 3D mode by default, [[#Initial 3D pitch|change the `pitch` value in the `navit` tag]]:
.. code-block:: xml
- <gui type="internal" enabled="yes" fullscreen="1" pitch="35">
+ <gui type="internal" enabled="yes" fullscreen="1" pitch="35">
Internal GUI
~~~~~~~~~~~~
@@ -68,7 +69,7 @@ The first GUI is embedded in Navit core and is primarily aimed at [[touchscreen]
.. code-block:: xml
- <gui type="internal" enabled="yes">
+ <gui type="internal" enabled="yes">
Options
^^^^^^^
@@ -84,7 +85,7 @@ An example ``gui`` tag using the previous options is shown below:
.. code-block:: xml
- <gui type="internal" enabled="yes" font_size="250" icon_xs="48" icon_s="48" icon_l="64">
+ <gui type="internal" enabled="yes" font_size="250" icon_xs="48" icon_s="48" icon_l="64">
More options are discussed on the [[Internal Gui]] and the [[Configuration/Full_list_of_options|full list of options]].
@@ -94,7 +95,7 @@ The second GUI is called **gtk**, and is most useful for those users who wish to
.. code-block:: xml
- <gui type="gtk" enabled="yes" ... />
+ <gui type="gtk" enabled="yes" />
Options
@@ -108,4 +109,4 @@ A number of options specific to the ``gtk`` GUI are available. These include:
.. code-block:: xml
- <gui type="gtk" enabled="yes" menubar="1" toolbar="1" statusbar="1"/>
+ <gui type="gtk" enabled="yes" menubar="1" toolbar="1" statusbar="1"/>
diff --git a/docs/configuration/general.rst b/docs/configuration/general.rst
index 2ad2874d7..34b201d61 100644
--- a/docs/configuration/general.rst
+++ b/docs/configuration/general.rst
@@ -1,23 +1,22 @@
-==General Options==
+General Options
+===============
Settings which affect Navit's general behaviour are located within the ``<navit .. >`` tag. In a default installation, this is found on line 31 of ``navit.xml``. By default, the ``navit`` tag is set as follows:
.. code-block:: xml
-<source lang="xml">
- <navit center="4808 N 1134 E" zoom="256" tracking="1" orientation="-1" recent_dest="10">
-</source>
+ <navit center="4808 N 1134 E" zoom="256" tracking="1" orientation="-1" recent_dest="10">
+
Some common attributes are discussed below. For more advanced features, see [[Configuration/Full_list_of_options | the full list of options]].
-===Initial map position===
+Initial map position
+--------------------
On Navit's very first startup, it needs a **center** to look at on the map. By default this is set to Munich in Germany, which is conveniently covered by the sample map created on installation.
.. code-block:: xml
-<source lang="xml">
- center="11.5666 48.1333"
-</source>
+ center="11.5666 48.1333"
Coordinates can be written in different formats; see [[Coordinate_format]] for the full list.
To determine a specific latitude and longitude for your location you can use http://itouchmap.com/latlong.html.
@@ -45,7 +44,8 @@ or to orient North:
Orienting the map North whilst in [[3D]] mode will provide visually confusing results, and is not recommended. When in 3D mode, it's best to have the map oriented in the direction of travel.
-===Autozoom===
+Autozoom
+--------
Navit has the ability to **autozoom** the map in or out dependent upon your speed.
autozoom_active="1"
@@ -54,7 +54,8 @@ To de-activate autozoom:
autozoom_active="0"
-===3D pitch===
+3D pitch
+--------
Navit has the capability to display either a 2D map (bird's eye perspective) or a [[3D]] map (some amount of tilt looking to the horizon). Navit's default configuration is to startup in the 2D perspective but it is possible to specify that Navit start with a 3D perspective. The amount of tilt is specified by setting the value of <tt>pitch</tt>.
The **pitch** value defines default camera tilting, with a value from 0 to 359. Note that usable values lie between 0 and 90 where 0 is bird's eye perspective looking down and 90 is human perspective looking forward. Also note that values closer to 90 will slow down map drawing, because the line of sight gets longer and longer and more objects are seen.
@@ -63,14 +64,16 @@ For example, the following added to the <tt>navit</tt> tag will force Navit to s
pitch="30"
-===Imperial units===
+Imperial units
+--------------
By default, Navit use the metric system of measurements when displaying or announcing distances, speeds etc. However, you can configure Navit to display and announce these values in imperial units. Simply add an <tt>imperial</tt> attribute to the Navit tag, and set its value to 1, as shown below:
imperial="1"
Speeds should now be displayed in units of miles-per-hour, whilst distances are converted to miles (large distances) and feet (small distances).
-===Default layout===
+Default layout
+--------------
When no specific layout has been specified by the user, navit uses a default layout to draw maps.
The <tt>default_layout</tt> attribute of the navit tag allows to specify which layout to use as default;
diff --git a/docs/configuration/index.rst b/docs/configuration/index.rst
index 38504d067..93a4e8b52 100644
--- a/docs/configuration/index.rst
+++ b/docs/configuration/index.rst
@@ -1,3 +1,9 @@
+.. _configuration:
+
+*************
+Configuration
+*************
+
Navit is highly modular and customizable. This page aims to point out the most common options which a first-time user may want to change - power users may want to consult [[Configuration/Full_list_of_options | the full list of options]].
It is also possible to edit the navit.xml file for your Android device under Windows and Linux (Debian/Ubuntu derivates) with a third party application called [[NavitConfigurator]].
@@ -7,137 +13,79 @@ The XML configuration file is splitted into sections within a hierarchy:
.. code-block:: xml
-<source lang="xml">
-<config>
- <plugins></plugins>
- <navit>
- <osd></osd>
- <vehicle></vehicle>
- <vehicleprofile></vehicleprofile>
- <mapset></mapset>
- <layout></layout>
- </navit>
-</config>
-</source>
-
-Navit comes **preshipped** with a default ``navit.xml`` together with ``navit_layout_*.xml`` files that are stored at various locations (depending on your system). For Linux-like OSes:
-* in ``~/.navit/``: e.g: ``/home/myusername/.navit/navit.xml`` (This is probably to best place to customize your settings!)
-* in ``/usr/share/navit`` or ``/etc/navit``
-
-Navit will apply settings in the following order:
-* in the current directory (used on Windows)
-* location supplied as first argument on the command line, e.g.: ``navit /home/myusername/navittestconfig.xml`` (Used mainly for development)
-* in the current directory as ``navit.xml.local`` (Used mainly for development)
-
-{{note
-|In any case, you have to **adapt settings** to your system!<br> This includes especially GPS, map provider and vehicle: [[Basic configuration]]
-}}
+ <config>
+ <plugins></plugins>
+ <navit>
+ <osd></osd>
+ <vehicle></vehicle>
+ <vehicleprofile></vehicleprofile>
+ <mapset></mapset>
+ <layout></layout>
+ </navit>
+ </config>
-=Configurable Sections=
-<div style="margin-bottom:8px;">
-{| cellpadding=3 cellspacing=1
+Navit comes **preshipped** with a default ``navit.xml`` together with ``navit_layout_*.xml`` files that are stored at various locations (depending on your system).
-<!-- GENERAL -->
-| width="33%" valign="top" style="background:#FFFFFF; border:2px solid #478cff;" |
-{| style="width:100%; vertical-align:top; background:#FFFFFF;"
-! style="padding:2px" | <h2 style="margin:3px; background:#478cff; font-size:120%; font-weight:bold; border:1px solid #478cff; text-align:left; color:#fff; padding:0.2em 0.4em;">General</h2>
-|-
-| style="margin:2px; padding:10px;" |
+For Linux-like OSes:
+ * in ``~/.navit/``: e.g: ``/home/myusername/.navit/navit.xml`` (This is probably to best place to customize your settings!)
+ * in ``/usr/share/navit`` or ``/etc/navit``
-Common options such as units, position, zoom and map orientation, ... be configured in this section.
+Navit will apply settings in the following order:
+ * in the current directory (used on Windows)
+ * location supplied as first argument on the command line, e.g.: ``navit /home/myusername/navittestconfig.xml`` (Used mainly for development)
+ * in the current directory as ``navit.xml.local`` (Used mainly for development)
-[[Configuration/General_Options| General options.]]
+{{note|In any case, you have to **adapt settings** to your system!<br> This includes especially GPS, map provider and vehicle: [[Basic configuration]]}}
-|}
+*********************
+Configurable Sections
+*********************
-| style="border:1px solid transparent;" |
+General
+'''''''
+Common options such as units, position, zoom and map orientation, ... be configured in this section.
-| width="33%" valign="top" style="background:#FFFFFF; border:2px solid #48be1f; margin-top:50px;" |
-<!-- DISPLAY -->
-{| style="width:100%; vertical-align:top; background:#FFFFFF;"
-|-
-! style="padding:2px" | <h2 style="margin:3px; background:#48be1f; font-size:120%; font-weight:bold; border:1px solid #48be1f; text-align:left; color:#fff; padding:0.2em 0.4em;">Display</h2>
-|-
-| style="margin:2px; padding:10px;" |
+.. include:: general.rst
+Display
+'''''''
A large number of display properties can be configured, including desktop or touchscreen-optimised GUIs, on-screen display items and complete control over menu items.
-[[Configuration/Display_Options| Display options.]]
-
-|}
-
-| style="border:1px solid transparent;" |
-
-
-<!-- VEHICLE -->
-| width="33%" valign="top" style="background:#FFFFFF; border:2px solid #e79e00;" |
-{| style="width:100%; vertical-align:top; background:#FFFFFF;"
-! style="padding:2px" | <h2 style="margin:3px; background:#e79e00; font-size:120%; font-weight:bold; border:0px solid #e79e00; text-align:left; color:#fff; padding:0.2em 0.4em;">Vehicle</h2>
-|-
-| style="margin:2px; padding:10px;" |
+.. include:: display.rst
+Vehicle
+'''''''
A number of vehicles can be defined within Navit, depending upon the device and/or operating system in use. Vehicle profiles for routing (eg: car, pedestrian, bicycle...) are also completely configurable.
-[[Configuration/Vehicle_Options| Vehicle options.]]
-
-|}
-|}
-</div>
-
-<div style="margin-bottom:8px;">
-{| cellpadding=3 cellspacing=1
-
-<!-- MAPS -->
-| width="33%" valign="top" style="background:#FFFFFF; border:2px solid #ec7312;" |
-{| style="width:100%; vertical-align:top; background:#FFFFFF;"
-! style="padding:2px" | <h2 style="margin:3px; background:#ec7312; font-size:120%; font-weight:bold; border:1px solid #ec7312; text-align:left; color:#fff; padding:0.2em 0.4em;">Maps</h2>
-|-
-| style="margin:2px; padding:10px;" |
+.. include:: vehicle.rst
+Maps
+''''
You can use maps from a variety of sources, any number of maps can be configured and enabled at any one time.
-[[Configuration/Maps_Options| Maps options.]]
-|}
+Layout
+''''''
+Maps are displayed according to the rules defined in the layout. All aspects of the layout are configurable, from POI icons to colours for a particular type of highway.
+
+For all versions shipped after nov 2018, layout XML configuration is stored in dedicated XML files called with the prefix ´´navit_layout_´´ (one file per layout definition).
-| style="border:1px solid transparent;" |
+.. include:: layout.rst
-<!-- LAYOUT -->
-| width="33%" valign="top" style="background:#FFFFFF; border:2px solid #b30800;" |
-{| style="width:100%; vertical-align:top; background:#FFFFFF;"
-! style="padding:2px" | <h2 style="margin:3px; background:#b30800; font-size:120%; font-weight:bold; border:1px solid #b30800; text-align:left; color:#fff; padding:0.2em 0.4em;">Layout</h2>
-|-
-| style="margin:2px; padding:10px;" |
+Advanced
+''''''''
+There are many more options, including debugging, specific plugins, speech announcements, trip logging, ...
-Maps are displayed according to the rules defined in the layout. All aspects of the layout are configurable, from POI icons to colours for a particular type of highway.
+.. include:: advanced.rst
-For all versions shipped after nov 2018, layout XML configuration is stored in dedicated XML files called with the prefix **navit_layout_** (one file per layout definition).
-[[Configuration/Layout_Options| Layout options.]]
-|}
-| style="border:1px solid transparent;" |
-<!-- ADVANCED -->
-| width="33%" valign="top" style="background:#FFFFFF; border:2px solid #992667;" |
-{| style="width:100%; vertical-align:top; background:#FFFFFF;"
-! style="padding:2px" | <h2 style="margin:3px; background:#992667; font-size:120%; font-weight:bold; border:1px solid #992667; text-align:left; color:#fff; padding:0.2em 0.4em;">Advanced</h2>
-|-
-| style="margin:2px; padding:10px;" |
-There are many more options, including debugging, specific plugins, speech announcements, trip logging, ...
-[[Configuration/Advanced_Options| Advanced options.]]
-|}
-|}
-</div>
-<!-- Following line disables table of contents -->
-__NOTOC__
-[[Category:Customizing]]
-[[Category:Configuration]]
diff --git a/docs/configuration/layout.rst b/docs/configuration/layout.rst
index 31a41366d..f1dc0552c 100644
--- a/docs/configuration/layout.rst
+++ b/docs/configuration/layout.rst
@@ -1,15 +1,17 @@
-==Layout Options==
-===Layouts===
+Layout Options
+==============
+Layouts
+-------
A layout defines how to **render a map**. Layouts are fully customisable, from the road colours and widths to size and type of icons to display for specific POIs. The layout is also where the **cursor** (i.e. the shape which shows where you are) is defined.<br>
A number of user-generated layouts and cursor definitions are available at [[Layout]].
-===Defining layers===
+Defining layers
+---------------
A layout consist of one cursor and one or more **layers** which are each a set of rules on how and when to draw certain items. Those rules are called **itemgra**. The layers are rendered one by one in the order they appear in the XML config file, as are the items in each layer. If you can't see an item make sure there is not another one hiding it. If your item is hidden, you can move your item further down in the layout section of the file.
.. code-block:: xml
-<source lang="xml">
<layout name="Demo layout" color="#ffefb7" font="Liberation Sans" active="1">
<cursor w="26" h="26">
<layer name="layer_1">
@@ -19,8 +21,6 @@ A layout consist of one cursor and one or more **layers** which are each a set o
</itemgra>
</layer>
<layout>
-</source>
-
Here the available options:
* item_types: Comma separated list of items (see navit/item.h for definitions)
@@ -31,39 +31,41 @@ Here the available options:
For infos about map icons, see [[Icons]]
-===Overriding default (shipped) layouts===
+Overriding default (shipped) layouts
+------------------------------------
When the XML config file is parsed, layouts are taken in the order they come, and a layout with an already existing name overrides a previous definition.
The default (shipped) navit.xml includes first system-wide navit_layout_*.xml files then the user-specific navit_layout_*.xml files, so the system-wide navit_layout_*.xml files can be overiden by adding a user-specific navit-layout_*.xml containing the same **name** attribute.
Copying the default **navit.xml** file to the user-specific location will still use the default shipped layout files, but copying one or several layout files as well to the user-specific location (and modifying them) allow to override these specific layouts.
-===Note on the default layout used by navit===
+Note on the default layout used by navit
+----------------------------------------
When no layout has been specifically selected by the user (for example at first startup), navit will use the default layout specified (see [[Configuration/General_Options#Default_layout|the related section to know how to configure this]]).
-===Using a layer in multiple layouts===
+Using a layer in multiple layouts
+---------------------------------
Sometimes, multiple layouts can use the same layer. For example, a reduced layout for a cleaner map may use the same layers as the regular layout, just not all of them.
To use a layer in multiple layouts, it can be referenced using the **ref** attribute. In place of the regular layer definition, use an empty tag with only the attributes ''name'' and ''ref'':
-<source lang="xml">
-<layer name="Found items" order="0-">
+.. code-block:: xml
+
+ <layer name="Found items" order="0-">
<itemgra item_types="found_item">
<circle color="#008080" radius="24" width="2" text_size="12"/>
</itemgra>
-</layer>
-[...]
-<layout name="Demo layout">
+ </layer>
+ [...]
+ <layout name="Demo layout">
[...]
<layer name="Found items for demo layout" ref="Found items" />
[...]
-</layout>
-<layout name="Demo layout reduced">
+ </layout>
+ <layout name="Demo layout reduced">
[...]
<layer name="Found items" ref="Found items" />
[...]
-</layout>
-
-</source>
+ </layout>
Note that the layer you want to reuse must be placed ''outside'' the layout. Layers defined inside a layout cannot be reused in this way.
diff --git a/docs/configuration/vehicle.rst b/docs/configuration/vehicle.rst
index 3d1769b9f..ee456fb37 100644
--- a/docs/configuration/vehicle.rst
+++ b/docs/configuration/vehicle.rst
@@ -1,4 +1,5 @@
-==Vehicle Options==
+Vehicle Options
+===============
It's important to understand the separate but linked Navit concepts of a **vehicle** and [[Vehicleprofile| **vehicleprofile**]] element. A vehicle defines the source of positional data (suchas a USB GPS device), and how to present that data to the user on the map, where the vehicleprofile defines all aspects of routing.
A simple vehicle definition looks like this:
@@ -6,9 +7,7 @@ A simple vehicle definition looks like this:
.. code-block:: xml
-<source lang="xml">
- <vehicle name="My" enabled="yes" source="file://dev/ttyS0"/ active="1"/>
-</source>
+ <vehicle name="My" enabled="yes" source="file://dev/ttyS0" active="1"/>
Here some of the available options:
@@ -25,7 +24,8 @@ Obsolete options:
* **animate**: If set to 1, the cursor will be animated as a moving dotted line, to make it easier to see.
-->
-===GPS===
+GPS
+---
Most essential detail is the gps source, that need to be adapted to your local setup.
@@ -48,7 +48,7 @@ Linux:
* source="file:/dev/ttyS0" - serial GPS connected to the first serial port (you may need to add the correct baudrate eg.: freerunner source="file:/dev/ttySAC1" baudrate="9600")
* source="gpsd_dbus:" - via dbus, position reported by gpsd
-**Network based:**<br>
+**Network based:**
If you want to connect multiple tools to your GPS, you need an multiplexer tool, as gpsd or gypsy.
* source="gpsd://host[:port]" - gpsd://localhost, the default one, will try to connect to gpsd on localhost
* source="socket:ipaddr:post" - socket connection (expects nmea stream)
@@ -62,16 +62,15 @@ If you want to connect multiple tools to your GPS, you need an multiplexer tool,
* source="demo://" : to use the demo vehicle. Set your Position and Destination, and vehicle will follow the calculated route. Useful if you have no nmea data source.
* source="null://" : no GPS at all
-===Logging tracks===
+Logging tracks
+--------------
To record your trip , you can add a sub-instance "log" to the vehicle. It is possible to add multiple logs.
.. code-block:: xml
-<source lang="xml">
<log type="gpx" data="track_%Y%m%d%i.gpx" flush_size="1048576" flush_time="900" />
<log type="nmea" data="track_%Y%m%d%i.nmea" flush_size="1048576" flush_time="900" />
-</source>
This will give a log file named YearMonthDaySequencenumber.gpx/.nmea which will be kept in memory and flushed to disk when it is 1048576 bytes large or the oldest data is older than 900 seconds.
@@ -81,13 +80,13 @@ To display your track for more than one hour, you must use [[binfile]] to create
.. code-block:: xml
-<source lang="xml">
<log type="binfile" data="track.bin" flush_size="0"/>
-</source>
+
For customizing what is stored, see [[GPX]]
-===Vehicleprofile===
+Vehicleprofile
+--------------
[[Vehicleprofile | Profiles to add in the navit.xml]]
<br/>
<!-- this is tricky, here we need a step by step introduction-->
@@ -96,16 +95,14 @@ Defines the behaviour of the routing and are usually linked to a vehicle section
.. code-block:: xml
-<source lang="xml">
-<vehicleprofile name="bike" flags="0x40000000" flags_forward_mask="0x40000000" flags_reverse_mask="0x40000000" maxspeed_handling="1" route_mode="0">
- <roadprofile item_types="path,track_ground" speed="12" route_weight="5">
- </roadprofile>
- <roadprofile item_types="track_gravelled,track_paved,cycleway,street_service,street_parking_lane,street_0,street_1_city,living_street,street_2_city,street_1_land,street_2_land,street_3_city" speed="25" route_weight="15">
- </roadprofile>
- <roadprofile item_types="roundabout" speed="20" route_weight="10"/>
- <roadprofile item_types="ferry" speed="40" route_weight="40"/>
- </vehicleprofile>
-</source>
+ <vehicleprofile name="bike" flags="0x40000000" flags_forward_mask="0x40000000" flags_reverse_mask="0x40000000" maxspeed_handling="1" route_mode="0">
+ <roadprofile item_types="path,track_ground" speed="12" route_weight="5">
+ </roadprofile>
+ <roadprofile item_types="track_gravelled,track_paved,cycleway,street_service,street_parking_lane,street_0,street_1_city,living_street,street_2_city,street_1_land,street_2_land,street_3_city" speed="25" route_weight="15">
+ </roadprofile>
+ <roadprofile item_types="roundabout" speed="20" route_weight="10"/>
+ <roadprofile item_types="ferry" speed="40" route_weight="40"/>
+ </vehicleprofile>
For details on the flags, see [[Vehicle profile flags]].
The speeds are in km/h.
diff --git a/docs/development/android_development.rst b/docs/development/android_development.rst
index 722d7eb82..783a29e91 100644
--- a/docs/development/android_development.rst
+++ b/docs/development/android_development.rst
@@ -25,9 +25,9 @@ For Android
* Download the Android `SDK <http://dl.google.com/android/android-sdk_r18-linux.tgz>` and `NDK <http://dl.google.com/android/ndk/android-ndk-r8-linux-x86.tar.bz2>`
* Unzip the SDK and NDK to a directory of your choice. The following instructions assume that the SDK and NDK have been unzipped to `~/src`.
* Ensure that the following paths are on your PATH environment variable:
- `path-to-sdk/tools`
- `path-to-sdk/platform-tools`
- `path-to-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin`
+ `path-to-sdk/tools`
+ `path-to-sdk/platform-tools`
+ `path-to-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin`
* On Ubuntu you can accomplish this using the following command (assuming the SDK and NDK have been unzipped to `~/src`):
.. code-block:: bash
@@ -63,15 +63,15 @@ With cmake
cd ~/src
mkdir android-build
- * Optional: Add a `SOURCE_PATH` environment variable to your system, pointing to the directory in which you checked out a copy of Navit. You can leave out this step, but make sure you change `$SOURCE_PATH` in the next steps to the actual path of the directory. `export SOURCE_PATH=~/src/navit`
- * Step into the build directory: `cd ~/src/android-build`
- * Run CMake (ensure that you're in the build directory when you do this!):
+* Optional: Add a `SOURCE_PATH` environment variable to your system, pointing to the directory in which you checked out a copy of Navit. You can leave out this step, but make sure you change `$SOURCE_PATH` in the next steps to the actual path of the directory. `export SOURCE_PATH=~/src/navit`
+* Step into the build directory: `cd ~/src/android-build`
+* Run CMake (ensure that you're in the build directory when you do this!):
.. code-block:: bash
cmake -DCMAKE_TOOLCHAIN_FILE=$SOURCE_PATH/Toolchain/arm-eabi.cmake -DCACHE_SIZE="(20*1024*1024)" -DAVOID_FLOAT=1 -DANDROID_PERMISSIONS="CAMERA" -DANDROID_API_VERSION=8 -DXSLT_PROCESSOR=/usr/bin/saxonb-xslt $SOURCE_PATH
- * Build the apk package:
+* Build the apk package:
.. code-block:: bash
@@ -137,7 +137,7 @@ So far, two issues have been observed with the build:
* Building `vehicle/gpsd` and `map/garmin` fails on Android. As a workaround, edit `CMakeLists.txt` `, inserting the following two lines in the `if(ANDROID)` block (around line 710):
-.. code-block:: C
+.. code-block::
set_with_reason(vehicle/gpsd "Android detected" FALSE)
set_with_reason(map/garmin "Android detected" FALSE)
diff --git a/docs/development/linux_development.rst b/docs/development/linux_development.rst
index 20e613acd..e9802ea31 100644
--- a/docs/development/linux_development.rst
+++ b/docs/development/linux_development.rst
@@ -49,7 +49,7 @@ You can also try the ebuild in the overlay : [sunrise overlay](http://www.gentoo
based on the svn to have the latest version of navit.
Debian / Ubuntu dependencies
--------------------
+----------------------------
It compiles flawlessly on a Lenny (5.0) or later and on `Ubuntu 12.04 LTS` (Precise Pangolin) or later, once all dependencies installed.
@@ -59,23 +59,24 @@ Absolute minimum requirements:
.. code-block:: bash
- gcc cmake zlib1g-dev libpng12-dev libgtk2.0-dev librsvg2-bin
+ gcc cmake zlib1g-dev libpng12-dev libgtk2.0-dev librsvg2-bin
Note that not all these packages are strictly required (for example, maptool can be built without installing GTK+),
but this is the smallest practical set of packages if you want to run Navit.
- * Translations for the user interface: `gettext`
- * Maptool: `protobuf-c-compiler libprotobuf-c-dev`
- * GTK+ is included in minimum requirements. `libimlib2-dev` is needed to enable draw_image_warp function which, in turn
- allows to use raster maps as discussed in [track #1285](http://trac.navit-project.org/ticket/1285)
- * SDL: `libsdl-image1.2-dev libdevil-dev libglc-dev freeglut3-dev libxmu-dev libfribidi-dev`
- * OpenGL graphics: `libglc-dev freeglut3-dev libgl1-mesa-dev libxft-dev libglib2.0-dev libfreeimage-dev`
- * QT: `libqt4-dev` (This package will pull in all the required packages as dependencies.)
- * gpsd: `gpsd gpsd-clients libgps-dev` (optional, but certainly nice to have)
- * espeak: `espeak` (optional)
- * speechd: `libspeechd-dev` (optional, you are better off with using espeak)
- * dbus: `libdbus-glib-1-dev` (optional, you most likely don't need this.)
- * python: `python-dev` (optional, you most likely don't need this.)
- * saxon: `libsaxonb-java` (only required for android)
+
+ * Translations for the user interface: `gettext`
+ * Maptool: `protobuf-c-compiler libprotobuf-c-dev`
+ * GTK+ is included in minimum requirements. `libimlib2-dev` is needed to enable draw_image_warp function which, in turn
+ allows to use raster maps as discussed in [track #1285](http://trac.navit-project.org/ticket/1285)
+ * SDL: `libsdl-image1.2-dev libdevil-dev libglc-dev freeglut3-dev libxmu-dev libfribidi-dev`
+ * OpenGL graphics: `libglc-dev freeglut3-dev libgl1-mesa-dev libxft-dev libglib2.0-dev libfreeimage-dev`
+ * QT: `libqt4-dev` (This package will pull in all the required packages as dependencies.)
+ * gpsd: `gpsd gpsd-clients libgps-dev` (optional, but certainly nice to have)
+ * espeak: `espeak` (optional)
+ * speechd: `libspeechd-dev` (optional, you are better off with using espeak)
+ * dbus: `libdbus-glib-1-dev` (optional, you most likely don't need this.)
+ * python: `python-dev` (optional, you most likely don't need this.)
+ * saxon: `libsaxonb-java` (only required for android)
Everything in one command:
diff --git a/docs/development/programming_guidelines.rst b/docs/development/programming_guidelines.rst
index 0232697d8..3aecabcf7 100644
--- a/docs/development/programming_guidelines.rst
+++ b/docs/development/programming_guidelines.rst
@@ -89,7 +89,7 @@ use
struct mystruct m={0,};
- * Use `/*` and `*/` for comments instead of `//`
+* Use `/*` and `*/` for comments instead of `//`
.. note::
diff --git a/docs/development/wince_development.rst b/docs/development/wince_development.rst
index d08fbe8ae..423139460 100644
--- a/docs/development/wince_development.rst
+++ b/docs/development/wince_development.rst
@@ -4,13 +4,13 @@ WinCE Development
This is a tutorial for Navit on WinCE/WinMobile. If want just want to download a cab file see [[WinCE]].
-This page explains how to build Navit for WinCE/WinMobile with `cegcc <http://cegcc.sourceforge.net>`_.
+This page explains how to build Navit for WinCE/WinMobile with `cegcc <http://cegcc.sourceforge.net>`.
In November 2009 versions compiled using arm-cegcc-gcc (both revision 1214 and release 0.59.1) had problems (threw exception_datatype_misalignment and caused access violations).
Using the variant arm-mingw32ce of CeGCC 0.59.1 it was possible to build a working executable which can be debugged.
-The automatic builds from the subversion repository seem to use an adjusted? version arm-wince-mingw32ce (see `build logs <http://download.navit-project.org/logs/navit/wince/svn>`_).
+The automatic builds from the subversion repository seem to use an adjusted? version arm-wince-mingw32ce (see `build logs <http://download.navit-project.org/logs/navit/wince/svn>`).
Building using arm-mingw32ce
============================
@@ -81,7 +81,7 @@ Building using arm-cegcc
Building cegcc
--------------
-Set the install path to where you want to install `cegcc <http://cegcc.sourceforge.net cegcc>`_:
+Set the install path to where you want to install `cegcc <http://cegcc.sourceforge.net cegcc>`:
.. code-block:: bash
@@ -144,7 +144,7 @@ The current versions of these libs don't need many changes, but they all don't k
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
zlib
-''''
+^^^^
.. code-block:: bash
@@ -157,7 +157,7 @@ zlib
make install
libiconv
-''''''''
+^^^^^^^^
.. code-block:: bash
@@ -171,7 +171,7 @@ libiconv
make install
gettext
-'''''''
+^^^^^^^
workaround for `plural-eval.h:50: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'sigfpe_exit'`
extend gettext-tools/src/plural-eval.h line 32 to `#if defined _MSC_VER || defined __MINGW32__ || defined __CEGCC__`
@@ -189,7 +189,7 @@ dito for gettext-tools/gnulib-lib/wait-process.c line 31
make install
libpng
-''''''
+^^^^^^
.. code-block:: bash
@@ -202,9 +202,9 @@ libpng
make install
libtiff
-'''''''
+^^^^^^^
-.. code-block:: bash
+.. code-block::
libtool: link: CURRENT `' must be a nonnegative integer
@@ -220,9 +220,9 @@ libtiff
make install
glib
-''''
+^^^^
-.. code-block:: bash
+.. code-block::
gatomic.c:570: Error: no such instruction: `swp %eax,%eax,[%esi]'
diff --git a/docs/development/windows_development.rst b/docs/development/windows_development.rst
index 511f261c1..1c5248605 100644
--- a/docs/development/windows_development.rst
+++ b/docs/development/windows_development.rst
@@ -189,19 +189,19 @@ Downloads
---------
In order to compile the win32 version of Navit, you need the following software development tools
- * GTK+ toolkit for win32 from `SourceForgeDownload: Glade/GTK+ <http://sourceforge.net/project/showfiles.php?group_id=98754>`_ (select gtk+-win32-devel)
+ * GTK+ toolkit for win32 from `SourceForgeDownload: Glade/GTK+ <http://sourceforge.net/project/showfiles.php?group_id=98754>` (select gtk+-win32-devel)
* MinGW from `SourceForgeDownload: MinGW <http://sourceforge.net/project/showfiles.php?group_id=2435>`_ (select Automated MinGW installer)
- * MSYS from `SourceForgeDownload: MSYS Base System <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=2496>`_
- * msysCORE from `SourceForgeDownload: MSYS Base System <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=24963>`_
- * diffutils from `SourceForgeDownload: MSYS Base System <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=24963>`_
- * autoconf from `SourceForgeDownload: MSYS Supplementary Tools <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=67879>`_
- * autogen from `SourceForgeDownload: MSYS Supplementary Tools <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=67879>`_
- * automake from `SourceForgeDownload: MSYS Supplementary Tools <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=67879>`_
- * gettext from `SourceForgeDownload: MSYS Supplementary Tools <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=67879>`_
- * libtool from `SourceForgeDownload: MSYS Supplementary Tools <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=67879>`_
- * libiconv from `SourceForgeDownload: MSYS Supplementary Tools <http://sourceforge.net/downloads/mingw/MinGW/libiconv>`_
-
-Probably the easiest way to obtain and install all the MSYS packages is to follow the instructions `here <http://www.mingw.org/wiki/msys>`_
+ * MSYS from `SourceForgeDownload: MSYS Base System <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=2496>`
+ * msysCORE from `SourceForgeDownload: MSYS Base System <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=24963>`
+ * diffutils from `SourceForgeDownload: MSYS Base System <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=24963>`
+ * autoconf from `SourceForgeDownload: MSYS Supplementary Tools <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=67879>`
+ * autogen from `SourceForgeDownload: MSYS Supplementary Tools <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=67879>`
+ * automake from `SourceForgeDownload: MSYS Supplementary Tools <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=67879>`
+ * gettext from `SourceForgeDownload: MSYS Supplementary Tools <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=67879>`
+ * libtool from `SourceForgeDownload: MSYS Supplementary Tools <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=67879>`
+ * libiconv from `SourceForgeDownload: MSYS Supplementary Tools <http://sourceforge.net/downloads/mingw/MinGW/libiconv>`
+
+Probably the easiest way to obtain and install all the MSYS packages is to follow the instructions `here <http://www.mingw.org/wiki/msys>`
For speech support, one option is to use the "cmdline" speech type (refer to [[Configuration]]) and a utility such as a Windows port of `Say <http://krolik.net/wsvn/wsvn/public/Say%2B%2B/>`_
diff --git a/docs/index.rst b/docs/index.rst
index bd7dd9a7e..ebacdbcf2 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -1,5 +1,6 @@
+###################
Navit's User Manual
-===================
+###################
This document is the official User Manual for `Navit`__,
the OpenSource vector based navigation software.
@@ -29,6 +30,7 @@ Navit is highly customizable, from map layouts and on-screen display to the deta
basic_configuration
maps
+ configuration/index
.. Indices and tables
diff --git a/docs/maps.rst b/docs/maps.rst
index ff5b18c2f..66e1e5e0e 100644
--- a/docs/maps.rst
+++ b/docs/maps.rst
@@ -1,4 +1,5 @@
.. _maps:
+
Maps
====
diff --git a/docs/navit.png b/docs/navit.png
index 81f3239d6..242aed8e4 100644
--- a/docs/navit.png
+++ b/docs/navit.png
Binary files differ
diff --git a/docs/osm.rst b/docs/osm.rst
index 12766d0d2..107cbf85f 100644
--- a/docs/osm.rst
+++ b/docs/osm.rst
@@ -1,21 +1,24 @@
-.. _OpenStreetMap:
OpenStreetMap
-------------
-`OpenStreetMap <http://www.openstreetmap.org/>`_ is a free editable map of the whole world. It is made by people like you. OpenStreetMap allows you to view, edit and use geographical data in a collaborative way from anywhere on Earth. Maps from OpenStreetMap can be used in Navit.
+`OpenStreetMap <http://www.openstreetmap.org/>` is a free editable map of the whole world. It is made by people like you. OpenStreetMap allows you to view, edit and use geographical data in a collaborative way from anywhere on Earth. Maps from OpenStreetMap can be used in Navit.
+
Quick Start
~~~~~~~~~~~
* Go to `Navit Planet Extractor <http://maps.navit-project.org/>`_
-* Zoom in and select the area that you are interested in. Use the 'Map Controls' on the right to switch between 'Navigation' and 'Select' modes. or use preselected areas:
- * `Germany <http://maps.navit-project.org/api/map/?bbox=5.185546875,46.845703125,15.46875,55.634765625>`_
- * `France <http://maps.navit-project.org/api/map/?bbox=-5.44921875,42.01171875,8.437500000000002,51.6796875>`_
- * `BeNeLux <http://maps.navit-project.org/api/map/?bbox=2.08740234375,48.8671875,7.778320312500001,54.51416015625>`_
- * `Spain/Portugal <http://maps.navit-project.org/api/map/?bbox=-11.0302734375,34.87060546875,4.614257812500003,44.40673828125>`_
- * `Italy <http://maps.navit-project.org/api/map/?bbox=6.52587890625,36.38671875,18.96240234375,47.197265625>`_
- * `Entire planet <http://maps.navit-project.org/planet.bin>`_
-* Hit '''Get Map!'''
+* Zoom in and select the area that you are interested in. Use the 'Map Controls' on the right to switch between 'Navigation' and 'Select' modes. or use
+* preselected areas:
+
+ * `Germany <http://maps.navit-project.org/api/map/?bbox=5.185546875,46.845703125,15.46875,55.634765625>`_
+ * `France <http://maps.navit-project.org/api/map/?bbox=-5.44921875,42.01171875,8.437500000000002,51.6796875>`_
+ * `BeNeLux <http://maps.navit-project.org/api/map/?bbox=2.08740234375,48.8671875,7.778320312500001,54.51416015625>`_
+ * `Spain/Portugal <http://maps.navit-project.org/api/map/?bbox=-11.0302734375,34.87060546875,4.614257812500003,44.40673828125>`_
+ * `Italy <http://maps.navit-project.org/api/map/?bbox=6.52587890625,36.38671875,18.96240234375,47.197265625>`_
+ * `Entire planet <http://maps.navit-project.org/planet.bin>`_
+
+* Hit "Get Map!"
* Move the downloaded map to the directory of your choice, and add it to the active the mapset (see [[Configuration]]) in navit.xml with a line similar to the following:
.. code-block:: xml
@@ -38,7 +41,7 @@ Topographic Maps
~~~~~~~~~~~~~~~~
Navit will display elevation/height lines but the required data is not included in most OSM derived maps.
-Navit compatible maps with height lines can be created by feeding the output of `Phyghtmap <http://wiki.openstreetmap.org/wiki/Phyghtmap>`_ to Navit's maptool. Alternatively the SRTM data can be downloaded in osm.xml format http://geoweb.hft-stuttgart.de/SRTM/srtm_as_osm/, avoiding the Phygtmap step. The information can be either merged with OSM derived maps or used in a separate layer.
+Navit compatible maps with height lines can be created by feeding the output of `Phyghtmap <http://wiki.openstreetmap.org/wiki/Phyghtmap>` to Navit's maptool. Alternatively the SRTM data can be downloaded in osm.xml format http://geoweb.hft-stuttgart.de/SRTM/srtm_as_osm/, avoiding the Phygtmap step. The information can be either merged with OSM derived maps or used in a separate layer.
Many Garmin type maps such as http://www.wanderreitkarte.de/garmin_de.php also have the height lines information but routing will not work with them.
@@ -50,14 +53,16 @@ Download your own OSM data
^^^^^^^^^^^^^^^^^^^^^^^^^^
OSM data can be downloaded from a variety of sources. OpenStreetMap XML Data files are regular textfiles, easily editable in any text editor. OpenStreetMap Protobuf Data files are binary files, which take up less space (so are quicker to download and process) but are not editable.
-* '''OpenStreetMap XML Data'''
- * `Geofabrik <http://download.geofabrik.de/osm/>`_ provides pre-processed OpenStreetMap XML Data files of almost all countries, and all continents. This method is probably the easiest way of downloading OpenStreetMap XML Data for an entire country or continent. Note that the OSM files are bzipped
- * `planet.openstreetmap.org <http://planet.openstreetmap.org>`_ hosts the complete data set (the whole world). You can use `Osmosis <http://wiki.openstreetmap.org/index.php/Osmosis>`_ to cut it into smaller chunks.
- * `OpenStreetMap ReadOnly (XAPI) <http://wiki.openstreetmap.org/wiki/Xapi>`_ The API allows to get the data of a specific bounding box, so that download managers can be used. For example:
- wget -O map.osm "http://xapi.openstreetmap.org/api/0.6/map?bbox=11.4,48.7,11.6,48.9"
- * [http://www.openstreetmap.org/export OpenStreetMap (visual)] allows you to select a small rectangular area and download the selection as OpenStreetMap XML Data.
+* OpenStreetMap XML Data
+
+ * `Geofabrik <http://download.geofabrik.de/osm/>`_ provides pre-processed OpenStreetMap XML Data files of almost all countries, and all continents. This method is probably the easiest way of downloading OpenStreetMap XML Data for an entire country or continent. Note that the OSM files are bzipped
+ * `planet.openstreetmap.org <http://planet.openstreetmap.org>`_ hosts the complete data set (the whole world). You can use `Osmosis <http://wiki.openstreetmap.org/index.php/Osmosis>`_ to cut it into smaller chunks.
+ * `OpenStreetMap ReadOnly (XAPI) <http://wiki.openstreetmap.org/wiki/Xapi>`_ The API allows to get the data of a specific bounding box, so that download managers can be used. For example:
+ wget -O map.osm "http://xapi.openstreetmap.org/api/0.6/map?bbox=11.4,48.7,11.6,48.9"
+ * `OpenStreetMap (visual) <http://www.openstreetmap.org/export>`_ allows you to select a small rectangular area and download the selection as OpenStreetMap XML Data.
+
* '''OpenStreetMap Protobuf Data'''
- * [http://download.geofabrik.de/osm/ Geofabrik] provides pre-processed OpenStreetMap Protobuf Data files of almost all countries, and all continents.
+ * [http://download.geofabrik.de/osm/ Geofabrik] provides pre-processed OpenStreetMap Protobuf Data files of almost all countries, and all continents.
Convert OSM data to Navit binfile
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -112,6 +117,7 @@ Tips
* To enable a map you have downloaded refer [[OpenStreetMap#Adding_an_OSM_map_to_your_mapset| adding OSM map to navit.xml]]
* If you don't see any map data in Navit (assuming your map is properly specified in navit.xml) using the Internal GUI click anywhere on the screen to bring up the menu. Click on "Actions" and then "Town". Type in the name of a town that should be within your map data. Select your town from the list that appears. This will bring up a sub-menu where you can click "View On Map". Note that if you have a GPS receiver you can also just wait till you get a satellite lock.
* To avoid changing navit.xml if you update your maps and the maps have different file names use the wildcard (\*.bin) in your navit.xml file. For example:
+
.. code-block:: xml
<map type="binfile" enabled="yes" data="/media/mmc2/maps/*.bin"/>
diff --git a/navit/maptool/CMakeLists.txt b/navit/maptool/CMakeLists.txt
index 624ea907b..8c4c824a8 100644
--- a/navit/maptool/CMakeLists.txt
+++ b/navit/maptool/CMakeLists.txt
@@ -9,8 +9,8 @@ if(BUILD_MAPTOOL)
add_executable (maptool maptool.c)
add_library (maptool_core boundaries.c buffer.c ch.c coastline.c itembin.c
- itembin_buffer.c misc.c osm.c osm_o5m.c osm_psql.c osm_relations.c
- sourcesink.c tempfile.c tile.c zip.c osm_xml.c)
+ itembin_buffer.c itembin_slicer.c misc.c osm.c osm_o5m.c osm_psql.c
+ osm_relations.c sourcesink.c tempfile.c tile.c zip.c osm_xml.c)
if(NOT MSVC)
PROTOBUF_C_GENERATE_C (PROTO_SRCS PROTO_HDRS osmformat.proto)
diff --git a/navit/maptool/boundaries.c b/navit/maptool/boundaries.c
index 2f64d092c..28322d2ee 100644
--- a/navit/maptool/boundaries.c
+++ b/navit/maptool/boundaries.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2011 Navit Team
*
diff --git a/navit/maptool/buffer.c b/navit/maptool/buffer.c
index 08f65f2b6..a6b18e52f 100644
--- a/navit/maptool/buffer.c
+++ b/navit/maptool/buffer.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2018 Navit Team
*
diff --git a/navit/maptool/ch.c b/navit/maptool/ch.c
index 29c3f81ee..ae508a63a 100644
--- a/navit/maptool/ch.c
+++ b/navit/maptool/ch.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2011 Navit Team
*
diff --git a/navit/maptool/coastline.c b/navit/maptool/coastline.c
index d96f86ab0..5f79db691 100644
--- a/navit/maptool/coastline.c
+++ b/navit/maptool/coastline.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2011 Navit Team
*
diff --git a/navit/maptool/itembin.c b/navit/maptool/itembin.c
index 6f1328355..3996d6f6a 100644
--- a/navit/maptool/itembin.c
+++ b/navit/maptool/itembin.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2011 Navit Team
*
@@ -226,6 +226,37 @@ void item_bin_add_attr_range(struct item_bin *ib, enum attr_type type, short min
item_bin_add_attr(ib, &attr);
}
+/**
+ * @brief add a "hole" to an item
+ *
+ * This function adds a "hole" (attr_poly_hole) to a map item. It adds the
+ * coordinates and the coordinate count to the existing item.
+ * WARNING: It does NOT allocate any memory, so the memory after the item
+ * must be already allocated for that purpose.
+ * @param[inout] ib item - to add hole to
+ * @param[in] coord - hole coordinate array
+ * @param[in] ccount - number of coordinates in coord
+ */
+void item_bin_add_hole(struct item_bin * ib, struct coord * coord, int ccount) {
+ /* get space for next attr in buffer */
+ int * buffer = ((int *) ib) + ib->len +1;
+ /* get the attr heder in binary file */
+ struct attr_bin * attr = (struct attr_bin *)buffer;
+ /* fill header */
+ attr->len = (ccount *2) + 2;
+ attr->type = attr_poly_hole;
+ /* get the first attr byte in buffer */
+ buffer = (int *)(attr +1);
+ /* for poly_hole, the first 4 bytes are the coordinate count */
+ *buffer = ccount;
+ /* coordinates are behind that */
+ buffer ++;
+ /* copy in the coordinates */
+ memcpy(buffer,coord, ccount * sizeof(struct coord));
+ /* add the hole to the total size */
+ ib->len += attr->len +1;
+}
+
void item_bin_write(struct item_bin *ib, FILE *out) {
dbg_assert(fwrite(ib, (ib->len+1)*4, 1, out)==1);
}
diff --git a/navit/maptool/itembin_buffer.c b/navit/maptool/itembin_buffer.c
index 5bdf09458..590bb3162 100644
--- a/navit/maptool/itembin_buffer.c
+++ b/navit/maptool/itembin_buffer.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2011 Navit Team
*
diff --git a/navit/maptool/itembin_slicer.c b/navit/maptool/itembin_slicer.c
new file mode 100644
index 000000000..e1a0da4ec
--- /dev/null
+++ b/navit/maptool/itembin_slicer.c
@@ -0,0 +1,856 @@
+/*
+ * Navit, a modular navigation system.
+ * Copyright (C) 2005-2008 Navit Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#define _FILE_OFFSET_BITS 64
+#define _LARGEFILE_SOURCE
+#define _LARGEFILE64_SOURCE
+#include <stdlib.h>
+#include <glib.h>
+#include <assert.h>
+#include <string.h>
+#include <signal.h>
+#include <stdio.h>
+#include <math.h>
+#ifndef _MSC_VER
+#include <getopt.h>
+#include <unistd.h>
+#endif
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <zlib.h>
+#include "file.h"
+#include "item.h"
+#include "map.h"
+#include "zipfile.h"
+#include "main.h"
+#include "config.h"
+#include "linguistics.h"
+#include "plugin.h"
+
+#include "maptool.h"
+
+/**
+ * @brief advance tile number on same tile level
+ * @param[inout] buffer current tile number, after call next tile number
+ * @return void
+ */
+static void next_tile(char * buffer) {
+ int done = 0;
+ int len;
+ len = strlen(buffer);
+
+ while ((len > 0) && (!done)) {
+ if(buffer[len-1] == 'd') {
+ buffer[len-1] = 'a';
+ len --;
+ } else {
+ buffer[len-1] ++;
+ done = 1;
+ }
+ }
+}
+
+/**
+ * @brief check if rectangles overlap
+ *
+ * Ths function calculates if two rectangles overlap
+ * @param[in] b1 - one rectangle
+ * @param[in] b2 - another rectangle
+ * @return 1 if they overlap, 0 otherwise
+ */
+static int itembin_bbox_intersects (struct rect * b1, struct rect * b2) {
+ // If one rectangle is on left side of other
+ if (b1->l.x > b2->h.x || b2->l.x > b1->h.x)
+ return 0;
+
+ // If one rectangle is above other
+ if (b1->h.y < b2->l.y || b2->h.y < b1->l.y)
+ return 0;
+
+ return 1;
+}
+
+/**
+ * @brief calculate intersection point of line with one side of an rectangle
+ *
+ * WARNING; Check if the line actually crosses the border before using this
+ * function
+ *
+ * @param[in] p1 - one point of the line
+ * @param[in] p2 - another point of the line
+ * @param[in] rect - rectangle to use as cuttinng data
+ * @param[in] edge - edge of rectangle to use. 0 left, 1 right, 2 bottom, 3 top
+ * @param[out] ret - resulting intersection point
+ */
+static void itembin_poly_intersection(struct coord *p1, struct coord *p2, struct rect *r, int edge, struct coord *ret) {
+ double dy=p2->y-p1->y;
+ double dx=p2->x-p1->x;
+ switch(edge) {
+ case 0:
+ ret->x=r->l.x;
+ ret->y=p1->y+(r->l.x-p1->x)*dy/dx;
+ break;
+ case 1:
+ ret->x=r->h.x;
+ ret->y=p1->y+(r->h.x-p1->x)*dy/dx;
+ break;
+ case 2:
+ ret->y=r->l.y;
+ ret->x=p1->x+(r->l.y-p1->y)*dx/dy;
+ break;
+ case 3:
+ ret->y=r->h.y;
+ ret->x=p1->x+(r->h.y-p1->y)*dx/dy;
+ break;
+ }
+}
+
+/**
+ * @brief calculate intersection point of line with x axis
+ *
+ * @param[in] p1 - one point of the line
+ * @param[in] p2 - another point of the line
+ * @param[in] x - x coordinate to check against
+ * @param[out y - returns y coordinate of intersection of line with x if intersecting
+ * @returns - 0 if not intersecting, 1 if y could be calculated.
+ */
+static int itembin_line_intersect_x(struct coord *p1, struct coord *p2, int x, int *y) {
+ struct rect r;
+ struct coord ret;
+ memset(&r,0,sizeof(r));
+ r.l.x = x;
+ if(((p1->x > x) && (p2->x < x)) || ((p2->x >x) && (p1->x < x))) {
+ itembin_poly_intersection(p1, p2, &r, 0, &ret);
+ *y = ret.y;
+ return 1;
+ }
+ return 0;
+}
+
+/**
+ * @brief calculate if a point is inside a polygon
+ *
+ * This function calculates if a point is inside a polygon. To do this, it casts a ray along the
+ * points x axis through the polygon and counts the intersections. If the count is even the point
+ * is outside, if odd inside
+ * @param[in] pt - point to check
+ * @param[in] poly - polygon to check
+ * @param[in] ccount - number of coordinates in poly
+ * @return 0 if outside 1 if inside
+ */
+static int itembin_poly_is_in(struct coord * pt, struct coord * poly, int ccount) {
+ int intersect_count=0;
+ /* p is first element in current buffer */
+ struct coord *p=poly;
+ /* s is lasst element in current buffer */
+ struct coord *s=poly+ ccount -1;
+ int i;
+
+ /* using x coordinate to trace. So pt is on trace */
+ for(i=0; i < ccount; i ++) {
+ if (p->x < pt->x) {
+ if(s->x > pt->x) {
+ int y=0;
+ /* we crossed the ray. calculate crossing point*/
+ if(itembin_line_intersect_x(p, s, pt->x, &y))
+ if(y < pt->y)
+ intersect_count ++;
+ }
+ } else {
+ if(s->x < pt->x) {
+ int y=0;
+ /* we crossed the ray. calculate crossing point*/
+ if(itembin_line_intersect_x(p, s, pt->x, &y))
+ if(y < pt->y)
+ intersect_count ++;
+ }
+ }
+ /* move one coordinate forward */
+ s=p;
+ p++;
+ }
+ if((intersect_count %2) ==0)
+ return 0;
+ else
+ return 1;
+
+}
+
+/**
+ * @brief data structure to eas up slicing
+ */
+struct slice_result {
+ int count; /**< number of loops / parts in coord */
+ int * ccount; /**< array of numbers of coordinates per part*/
+ struct coord ** coord; /**< array of coordinate arrays*/
+};
+
+/**
+ * @brief data structure to transfer data between this and the multipolygon
+ * code in osm.c
+ */
+struct itembin_loop_combiner_context {
+ /** combiner input */
+ int count;
+ int * ccount;
+ struct item_bin ** part;
+ /** combiner result */
+ int sequence_count;
+ int *scount;
+ int *direction;
+ int **sequences;
+};
+
+/**
+ * @brief data structure to make partd of an item easily avalable for the slicer code
+ */
+struct slicerpolygon {
+ struct item_bin * ib; /**< reference to the original item */
+ /* transfer through the layers */
+ FILE* reference;
+ char * buffer;
+ struct tile_info *info;
+ int number;
+ /* decoded data */
+ struct rect bbox; /**< bbox of the polygons outline */
+ int count; /**< number of coordinates in outer polygon */
+ struct coord * poly; /**< outer polygon */
+ int hole_count; /**< number of hole polygons */
+ int * ccount; /**< number of coordinates per hole polygon */
+ struct coord ** holes; /**< the hole polygons */
+ struct rect * holes_bbox; /**< bboxes of the hole polygons */
+ int attr_len; /**< length of attrs in bytes including the holes as is */
+ struct attr_bin * attrs; /**< first byte of the attrs */
+ int f_attr_len; /**< number of bytes attrs without the holes */
+ struct attr_bin * f_attrs; /**< first byte of attr imege with holes removed */
+};
+
+/**
+ * @brief free all possibly allocated members of a itembin_loop_combiner_context
+ *
+ * @param c - context to clear
+ */
+static void clear_loop_combiner_context(struct itembin_loop_combiner_context * c) {
+ int i;
+ for(i=0; i < c->count; i ++) {
+ if(c->part[i] != NULL)
+ g_free(c->part[i]);
+ }
+ if(c->ccount != NULL)
+ g_free(c->ccount);
+
+ if(c->part != NULL)
+ g_free(c->part);
+
+ for(i=0; i < c->sequence_count; i ++) {
+ if(c->sequences[i] != NULL)
+ g_free(c->sequences[i]);
+ }
+ if(c->scount != NULL)
+ g_free(c->scount);
+
+ if(c->direction != NULL)
+ g_free(c->direction);
+
+ if(c->sequences != NULL)
+ g_free(c->sequences);
+}
+
+/**
+ * @brief free all possibly allocated members of a slice_result
+ *
+ * @param r - context to clear
+ */
+static void clear_slice_result (struct slice_result * r) {
+ int i;
+ for(i=0; i < r->count; i ++) {
+ if(r->coord[i] != NULL)
+ g_free(r->coord[i]);
+ }
+ if(r->ccount !=NULL)
+ g_free(r->ccount);
+ if(r->coord !=NULL)
+ g_free(r->coord);
+
+ memset(r, 0, sizeof(*r));
+}
+
+/**
+ * @brief add a part to a slice result structure
+ *
+ * This function adds a given line part to a slice result. It allocates the
+ * required space for pointers, but keeps the memory of the parts coordinate array.
+ * the coordinate should not be freed outside
+ *
+ * @param[in] r - slice result structure
+ * @param[in] part - new part coordinate array to add
+ * @param[in] ccount - number of coordinates in new part array.
+ */
+static void itembin_slice_add_part(struct slice_result *r, struct coord * part, int ccount) {
+ r->ccount = g_realloc(r->ccount, sizeof(int) * (r->count +1));
+ r->ccount[r->count] = ccount;
+ r->coord = g_realloc(r->coord, sizeof(struct coord *) * (r->count +1));
+ r->coord[r->count] = part;
+ r->count ++;
+}
+
+#if 0
+static void dump_coords(struct coord *coords, int ccount, FILE* file) {
+ int i;
+ for (i=0; i < ccount; i ++) {
+ fprintf(file, "(%d,%d)",coords[i].x, coords[i].y);
+ }
+ fprintf(file, "\n");
+}
+#endif
+
+/**
+ * @brief combine the parts of a slice result to closed loops
+ *
+ * This function uses the osm.c multipolygon code to combine the given parts
+ * of a slice resutl structure to closed loops,
+ *
+ * @param[inout] r - slice result to reassign to loops.
+ */
+static void itembin_loop_combiner (struct slice_result *r) {
+ struct slice_result out;
+ struct itembin_loop_combiner_context c;
+ memset(&out, 0, sizeof(out));
+ /* prepare context for reusing multipolygon processing parts */
+ memset(&c, 0, sizeof(c));
+ int i;
+ c.count = r->count;
+ c.ccount = g_malloc(r->count * sizeof(int));
+ c.part = g_malloc(r->count * sizeof(struct item_bin *));
+ for(i=0; i < c.count; i ++) {
+ c.ccount[i] = r->ccount[i];
+ c.part[i] = (struct item_bin *) g_malloc(r->ccount[i] * sizeof(struct coord) + sizeof(struct item_bin));
+ c.part[i]->type = 0;
+ c.part[i]->clen = r->ccount[i] * 2;
+ memcpy(c.part[i] +1, r->coord[i], r->ccount[i] * sizeof(struct coord));
+ c.part[i]->len = (sizeof(struct item_bin) /4) -1 + c.part[i]->clen;
+ }
+ /* call multipolygon processing part */
+ c.sequence_count = process_multipolygons_find_loops(0, c.count, c.part, &(c.scount), &(c.sequences), &(c.direction));
+ /* assemble new slice_result */
+ for(i = 0; i < c.sequence_count; i ++) {
+ int ccount = 0;
+ struct coord * loop = NULL;
+ /* count total coordinates for new loop */
+ ccount = process_multipolygons_loop_count(c.part, c.scount[i], c.sequences[i]);
+ /* alloc memory for new loop */
+ loop = (struct coord *) g_malloc0(ccount * sizeof(struct coord));
+ /* copy in coordinates */
+ ccount = process_multipolygons_loop_dump(c.part, c.scount[i], c.sequences[i], c.direction, loop);
+ /* attach to result */
+ itembin_slice_add_part(&out, loop, ccount);
+ /* do not free loop. */
+ }
+
+ //fprintf(stderr, "Combined to %d loops %d parts\n", c.sequence_count, out.count);
+ clear_loop_combiner_context(&c);
+ /* copy back the result */
+ clear_slice_result(r);
+ *r = out;
+
+}
+
+/**
+ * @brief sort functions for qsort to sort coordinates along x or y axis
+ * @param[in] a - coordinate a
+ * @param[in] b - coordinate b
+ * @param[in] axis - 1 if x axis, 0 if y axis
+ * @return <1 a<b 0 a==b >1 a>b
+ */
+static inline int itembin_sort_coordinates_xy(const void * a, const void * b, int axis) {
+ struct coord * c1 = (struct coord *) a;
+ struct coord * c2 = (struct coord *) b;
+ if(axis) {
+ return (c1->x - c2->x);
+ } else {
+ return (c1->y - c2->y);
+ }
+}
+
+/**
+ * @brief sort functions for qsort to sort coordinates along x axis
+ * @param[in] a - coordinate a
+ * @param[in] b - coordinate b
+ * @return <1 a<b 0 a==b >1 a>b
+ */
+static int itembin_sort_coordinates_x(const void * a, const void * b) {
+ return itembin_sort_coordinates_xy(a,b,1);
+}
+
+/**
+ * @brief sort functions for qsort to sort coordinates along y axis
+ * @param[in] a - coordinate a
+ * @param[in] b - coordinate b
+ * @return <1 a<b 0 a==b >1 a>b
+ */
+static int itembin_sort_coordinates_y(const void * a, const void * b) {
+ return itembin_sort_coordinates_xy(a,b,0);
+}
+
+/**
+ * @brief srt coordinates along cut edge
+ *
+ * @param[inout] coord - array of points on one axis. Sorted on return.
+ * @param[in] ccpunt - number of coords in coord
+ * @param[in] edge - 0 or 1, sort along y axis, 2 or 3 sort along x axis
+ */
+static void itembin_sort_coordinates(struct coord * coord, int ccount, int edge) {
+ if((edge==0) || (edge==1))
+ qsort(coord, ccount,sizeof(struct coord),itembin_sort_coordinates_y);
+ else
+ qsort(coord, ccount,sizeof(struct coord),itembin_sort_coordinates_x);
+}
+
+static void itembin_slice_part_direction(struct coord *p_in, int p_in_ccount, struct slice_result * p_out, int edge,
+ struct rect * box, struct coord ** cutpoints, int* cutpoint_ccount) {
+ int i;
+
+ /* get some space */
+ int part_ccount =0;
+ struct coord * part = g_malloc((p_in_ccount + 4) * sizeof(struct coord));
+ *cutpoint_ccount =0;
+ /* hold the cut points */
+ *cutpoints=g_malloc((p_in_ccount * 8 + 4) * sizeof(struct coord));
+
+ /* p is first element in current buffer */
+ struct coord *p=p_in;
+ /* s is lasst element in current buffer */
+ struct coord *s=p_in+ p_in_ccount -1;
+
+ /* iterate all point in this loop, remember the cut points, remember the parts */
+ for(i=0; i < p_in_ccount; i ++) {
+ if (geom_is_inside(p, box, edge)) {
+ if (! geom_is_inside(s, box, edge)) {
+ struct coord pi;
+ /* current segment crosses border from outside to inside. Add crossing point with border first */
+ itembin_poly_intersection(s,p,box,edge,&pi);
+ part[part_ccount++]=pi;
+ /* remember the cutpoint */
+ (*cutpoints)[(*cutpoint_ccount)++]=pi;
+ }
+ /* add point if inside */
+ part[part_ccount++]=*p;
+ } else {
+ if (geom_is_inside(s, box, edge)) {
+ struct coord pi;
+ /*current segment crosses border from inside to outside. Add crossing point with border */
+ itembin_poly_intersection(p,s,box,edge,&pi);
+ part[part_ccount++]=pi;
+ /* remember the cutpoint */
+ (*cutpoints)[(*cutpoint_ccount)++]=pi;
+ /*this part is complete. add it to result */
+ itembin_slice_add_part(p_out, part, part_ccount);
+ /* do NOT free this part as it has been added */
+ /* new buffer, new part */
+ part = g_malloc((p_in_ccount +4) * sizeof(struct coord));
+ part_ccount = 0;
+ }
+ /* skip point if outside */
+ }
+ /* move one coordinate forward */
+ s=p;
+ p++;
+ }
+ if(part_ccount > 0) {
+ /* some points left. We started not at the border */
+ if (geom_is_inside(p_in, box, edge))
+ part[part_ccount++]=*(p_in);
+ itembin_slice_add_part(p_out, part, part_ccount);
+ /* do NOT free this part as it has been added */
+ } else {
+ /* we allocated a new buffer for the next part, but there were no points left. */
+ g_free(part);
+ }
+}
+
+static void itembin_slice_direction(struct slice_result * p_in_outer, struct slice_result *p_in_inner,
+ struct slice_result * p_out_outer, struct slice_result * p_out_inner, int edge, struct rect * box) {
+ int outer;
+ int inner;
+ int outer_cutpoint_ccount=0;
+ struct coord * outer_cutpoints = NULL;
+ //fprintf(stderr,"going to slice %d loops %d holes\n", p_in_outer->count, p_in_inner->count);
+ for(outer=0; outer < p_in_outer->count; outer ++) {
+ int i;
+ /* get some space */
+ int cutpoint_ccount =0;
+ /* hold the cut points */
+ struct coord * cutpoints=NULL;;
+
+ /* cut this loop into pieces */
+ itembin_slice_part_direction(p_in_outer->coord[outer], p_in_outer->ccount[outer], p_out_outer, edge,
+ box, &cutpoints, &cutpoint_ccount);
+ if(cutpoint_ccount > 0) {
+ outer_cutpoints=g_realloc(outer_cutpoints, (outer_cutpoint_ccount + cutpoint_ccount) * sizeof(struct coord));
+ for(i=0; i < cutpoint_ccount; i ++) {
+ outer_cutpoints[outer_cutpoint_ccount + i] = cutpoints[i];
+ }
+ outer_cutpoint_ccount += cutpoint_ccount;
+ }
+ /* clear the cutpoints if we got any */
+ if(cutpoints != NULL)
+ g_free(cutpoints);
+
+ }
+ for(inner=0; inner < p_in_inner->count; inner ++) {
+ int i;
+ /* get some space */
+ int cutpoint_ccount =0;
+ /* hold the cut points */
+ struct coord * cutpoints =NULL;
+ struct slice_result temp;
+ memset(&temp, 0, sizeof(temp));
+
+ /* cut this loop into pieces */
+ itembin_slice_part_direction(p_in_inner->coord[inner], p_in_inner->ccount[inner], &temp, edge,
+ box, &cutpoints, &cutpoint_ccount);
+
+ /* if we have cutlines, we need to add the remains of this loop to outer loop */
+ if(cutpoint_ccount > 0) {
+ int a;
+ outer_cutpoints=g_realloc(outer_cutpoints, (outer_cutpoint_ccount + cutpoint_ccount) * sizeof(struct coord));
+ for(i=0; i < cutpoint_ccount; i ++) {
+ outer_cutpoints[outer_cutpoint_ccount + i] = cutpoints[i];
+ }
+ outer_cutpoint_ccount += cutpoint_ccount;
+ /* move the parts to the outer loop */
+ for(a = 0; a < temp.count; a ++) {
+ itembin_slice_add_part(p_out_outer, temp.coord[a], temp.ccount[a]);
+ /* unlink from tem not to get freed later by clear_slice_result */
+ temp.coord[a] = NULL;
+ }
+ } else {
+ int a;
+ /* move the parts to the inner loop */
+ for(a = 0; a < temp.count; a ++) {
+ itembin_slice_add_part(p_out_inner, temp.coord[a], temp.ccount[a]);
+ /* unlink from tem not to get freed later by clear_slice_result */
+ temp.coord[a] = NULL;
+ }
+ }
+ /* clear temp */
+ clear_slice_result(&temp);
+ /* clear the cutpoints if we got any */
+ if(cutpoints != NULL)
+ g_free(cutpoints);
+ }
+
+ /* calculate and add the outer cut lines (there are no inner) */
+ if(outer_cutpoint_ccount >0) {
+ int i;
+ struct coord * part;
+ /* sort the cut points */
+ //dump_coords(outer_cutpoints, outer_cutpoint_ccount, stderr);
+ itembin_sort_coordinates(outer_cutpoints, outer_cutpoint_ccount, edge);
+ //dump_coords(outer_cutpoints, outer_cutpoint_ccount, stderr);
+ /* add the cut lines */
+ for (i = 0; i < outer_cutpoint_ccount; i+=2) {
+ part = g_malloc(sizeof(struct coord) * 4);
+ part[0] = outer_cutpoints[i];
+ part[1] = outer_cutpoints[i];
+ part[2] = outer_cutpoints[i+1];
+ part[3] = outer_cutpoints[i+1];
+ itembin_slice_add_part(p_out_outer, part, 4);
+ /* do NOT free this part as it has been added */
+ }
+ }
+
+ if(outer_cutpoints != NULL)
+ g_free(outer_cutpoints);
+ /* reassemble the parts to loops */
+ //fprintf(stderr, "reassemble %d outer parts\n", p_out_outer->count);
+ itembin_loop_combiner (p_out_outer);
+ //fprintf(stderr, "reassemble %d inner parts\n", p_out_inner->count);
+ itembin_loop_combiner (p_out_inner);
+ //fprintf(stderr, "slicing resulted in %d parts outer, %d parts inner\n", p_out_outer->count, p_out_inner->count);
+}
+
+
+static void itembin_write_slice_result (struct slicerpolygon * sp, struct slice_result * outer,
+ struct slice_result * inner) {
+ int i;
+ int hole_size = 0;
+ /* calculate maximum space for loops */
+ for(i=0; i < inner->count; i ++) {
+ /* add space for the coordnates */
+ hole_size += inner->ccount[i] * sizeof(struct coord);
+ /* add space for attr overhead */
+ hole_size += sizeof(int) * 8;
+ }
+ for(i=0; i < outer->count; i ++) {
+ int h;
+ struct item_bin * out;
+ char buffer[50];
+ snprintf(buffer, 50, "slice %d", sp->number);
+ out = g_malloc(sizeof(struct item_bin) + (outer->ccount[i] * sizeof(struct coord)) + sp->f_attr_len + 50 + hole_size);
+ out->type = sp->ib->type;
+ out->clen = outer->ccount[i] * 2;
+ memcpy(out +1, outer->coord[i], outer->ccount[i] * sizeof(struct coord));
+ memcpy((struct coord *)(out +1) + outer->ccount[i], sp->f_attrs, sp->f_attr_len);
+ out->len = ((sizeof(struct item_bin) + sp->f_attr_len) / 4) -1 + out->clen;
+ item_bin_add_attr_string(out, attr_debug, buffer);
+ /* add holes */
+ for(h=0; h < inner->count; h ++) {
+ if(itembin_poly_is_in(inner->coord[h], outer->coord[i], outer->ccount[i]))
+ item_bin_add_hole(out, inner->coord[h], inner->ccount[h]);
+ }
+ tile_write_item_to_tile(sp->info, out, sp->reference, sp->buffer);
+ g_free(out);
+ }
+}
+
+static void itembin_slice(struct slicerpolygon * sp, struct rect *box) {
+ int i;
+ struct slice_result inner;
+ struct slice_result outer;
+ struct slice_result out_inner;
+ struct slice_result out_outer;
+ struct slice_result * p_in_inner = &inner;
+ struct slice_result * p_out_inner = &out_inner;
+ struct slice_result * p_in_outer = &outer;
+ struct slice_result * p_out_outer = &out_outer;
+ memset(&outer, 0, sizeof(outer));
+ memset(&inner, 0, sizeof(inner));
+ memset(&out_outer, 0, sizeof(out_outer));
+ memset(&out_inner, 0, sizeof(out_inner));
+
+ /*prepare in for first round */
+ /* outer */
+ outer.count=1;
+ outer.ccount=g_malloc(sizeof(int) * outer.count);
+ outer.coord=g_malloc(sizeof(struct coord*) * outer.count);
+ outer.coord[0]=g_malloc(sizeof(struct coord) * sp->count);
+ memcpy(outer.coord[0], sp->poly, sizeof(struct coord) * sp->count);
+ outer.ccount[0] = sp->count;
+ /* holes or inner if matching box*/
+ inner.count=0;
+ inner.ccount=g_malloc(sizeof(int) * sp->hole_count);
+ inner.coord=g_malloc(sizeof(struct coord*) * sp->hole_count);
+ for(i=0; i < sp->hole_count; i ++) {
+ if(itembin_bbox_intersects (&sp->holes_bbox[i], box)) {
+ //fprintf(stderr, "Got intersecting hole %d %d coords\n",i,sp->ccount[i]);
+ inner.coord[inner.count]=g_malloc(sizeof(struct coord) * sp->ccount[i]);
+ memcpy(inner.coord[inner.count], sp->holes[i], sizeof(struct coord) * sp->ccount[i]);
+ inner.ccount[inner.count] = sp->ccount[i];
+ inner.count ++;
+ }
+ }
+ //fprintf(stderr,"%d holes intersecting this tile\n", inner.count);
+
+ /* cut for all 4 directions */
+ for(i =0; i < 4; i ++) {
+ itembin_slice_direction(p_in_outer,p_in_inner, p_out_outer, p_out_inner, i, box);
+ /* clear old input */
+ clear_slice_result(p_in_outer);
+ clear_slice_result(p_in_inner);
+ /* switch buffer */
+ if(p_in_outer == &outer) {
+ p_out_outer = &outer;
+ p_in_outer = &out_outer;
+ p_out_inner = &inner;
+ p_in_inner = &out_inner;
+ } else {
+ p_out_outer = &out_outer;
+ p_in_outer = &outer;
+ p_out_inner = &out_inner;
+ p_in_inner = &inner;
+ }
+ }
+
+ /* write the result to tiles */
+ itembin_write_slice_result (sp, &outer, &inner);
+
+ /* clean up */
+ clear_slice_result(&inner);
+ clear_slice_result(&outer);
+
+}
+
+
+/**
+ * @brief copy item_bin attrs filtering out one kind
+ *
+ * @param[in] in - attrs to filter
+ * @param[in] size - attrs total size in bytes
+ * @param[out] out - space for filtered attr. At least size long.
+ * @param[in] remove - type of item to remove from attr
+ */
+static int itembin_filter_attr(struct attr_bin * in, int size, struct attr_bin * out, enum attr_type remove) {
+ int nout=0;
+ char * in_pos = (char *) in;
+ char * out_pos = (char *) out;
+ while(in_pos < ((char*)in) + size ) {
+ struct attr_bin * reader=(struct attr_bin *) in_pos;
+ if(reader-> type != remove) {
+ /* write it */
+ struct attr_bin * writer = (struct attr_bin *) out_pos;
+ memcpy(writer, reader, (reader->len+1) *4);
+ /* calculate new writer position */
+ nout +=(reader->len+1) *4;
+ out_pos +=(reader->len+1) *4;
+ }
+ /* calculate new posotion */
+ in_pos +=(reader->len+1) *4;
+ }
+ return nout;
+}
+
+/**
+ * @brief free structure filled by itembin_disassemble
+ * @param sp structure to free
+ */
+static void itembin_slicerpolygon_free(struct slicerpolygon * sp) {
+ if(sp->ccount != NULL)
+ g_free(sp->ccount);
+ if(sp->holes != NULL)
+ g_free(sp->holes);
+ if(sp->holes_bbox != NULL)
+ g_free(sp->holes_bbox);
+ if(sp->f_attrs != NULL)
+ g_free(sp->f_attrs);
+}
+
+/**
+ * @brief parse an item_bin and make it's contents accessable.
+ *
+ * This method parses the contents of a item_bin and makes it accessable via direct
+ * pointers. Additionally it filters out holes if any from attr. This allows easy
+ * reassembly of the sliced parts to item_bins.
+ * @param[in] ib item to disassemble
+ * @param{out] out structure containing the parsing result.
+ */
+static void itembin_disassemble (struct item_bin *ib, struct slicerpolygon * out) {
+ struct attr_bin *ab=NULL;
+ /* basic setup*/
+ out->ib = ib;
+ out->count = ib->clen / 2;
+ out->poly = (struct coord *)(ib +1);
+ bbox(out->poly, out->count, &out->bbox);
+ /* init hole storage */
+ out->hole_count=0;
+ out->ccount = NULL;
+ out->holes = NULL;
+ out->holes_bbox = NULL;
+ /* scan for holes and extract pointers to coordinates */
+ while ((ab=item_bin_get_attr_bin(ib, attr_poly_hole, ab))!=NULL) {
+ /* got one hole */
+ /* realloc ccount and holes and holes_bbox*/
+ out->ccount = g_realloc(out->ccount, sizeof(int) * (out->hole_count +1));
+ out->holes = g_realloc(out->holes, sizeof(struct coord *) * (out->hole_count +1));
+ out->holes_bbox = g_realloc(out->holes_bbox, sizeof(struct rect) * (out->hole_count +1));
+ /* get ccount */
+ out->ccount[out->hole_count] = *(int*)(ab + 1);
+ /* get hole coords */
+ out->holes[out->hole_count] = (struct coord *)((int *)(ab + 1) + 1);
+ /* get hole bbox */
+ bbox(out->holes[out->hole_count], out->ccount[out->hole_count], &(out->holes_bbox[out->hole_count]));
+ /* count hole */
+ out->hole_count ++;
+ /* next attr */
+ ab ++;
+ }
+ /* get attr pointer and size */
+ out->attrs = (struct attr_bin *) (out->poly + out->count);
+ out->attr_len = (ib->len - ib->clen +1) * 4 - sizeof(struct item_bin);
+
+ /* get memory for filtered attrs */
+ out->f_attrs=g_malloc(out->attr_len);
+ /* filter_attrs */
+ out->f_attr_len=itembin_filter_attr(out->attrs, out->attr_len, out->f_attrs, attr_poly_hole);
+
+ //fprintf(stderr,"Got %d coords and %d holes. %d bytes attrs, %d without holes\n", out->count, out->hole_count,
+ // out->attr_len, out->f_attr_len);
+}
+
+void itembin_nicer_slicer(struct tile_info *info, struct item_bin *ib, FILE *reference, char * buffer, int min) {
+ char tilecode[22];
+ char tileend[22];
+ struct slicerpolygon sp;
+ long long * id;
+ int is_relation=0;
+
+ /* for now only slice polygons and things > min. */
+ if (ib->type < type_area || min <= tile_len(buffer)) {
+ tile_write_item_to_tile(info, ib, reference, buffer);
+ return;
+ }
+
+ id = item_bin_get_attr(ib, attr_osm_wayid, NULL);
+ if(id!= NULL) {
+ is_relation = 0;
+ } else {
+ id = item_bin_get_attr(ib, attr_osm_relationid, NULL);
+ is_relation =1;
+ }
+
+ /* seems we have a polygon. Calculate tile range from*/
+ memset(tilecode, 0, sizeof(tilecode));
+ memset(tilecode,'a', min);
+ memcpy(tilecode, buffer, tile_len(buffer));
+ /* to */
+ memset(tileend, 0, sizeof(tileend));
+ memset(tileend,'d', min);
+ memcpy(tileend, buffer, tile_len(buffer));
+ next_tile(tileend);
+
+ if(id != NULL) {
+ if(is_relation)
+ osm_info("relation",*id,0,"slice down %d steps from %s to (%s - %s)\n",min - tile_len(buffer), buffer, tilecode,
+ tileend);
+ else
+ osm_info("way",*id,0,"slice down %d steps from %s to (%s - %s)\n",min - tile_len(buffer), buffer, tilecode, tileend);
+
+ }
+ itembin_disassemble (ib, &sp);
+ sp.reference = reference;
+ sp.info = info;
+ sp.buffer = buffer;
+ sp.number=0;
+
+ /* for all tiles in range. Allow this to overflow if tile_len(buffer) == 0*/
+ do {
+ struct rect bbox;
+ /* get tile rectangle. One might like slicing without overlap, but since the
+ * overlapping tiles do not cover the same area per tile code than the
+ * overlapping ones we cannot. This will look ugly. But there is no chance.*/
+ tile_bbox(tilecode, &bbox, overlap);
+
+ /* only process tiles which do intersect wit ib's bbox */
+ if(!itembin_bbox_intersects (&sp.bbox, &bbox)) {
+ next_tile(tilecode);
+ sp.number ++;
+ continue;
+ }
+ fprintf(stderr, "slice %d intersection with %s\n", sp.number, tilecode);
+ sp.buffer=tilecode;
+ itembin_slice(&sp, &bbox);
+
+ /* next tile */
+ next_tile(tilecode);
+ sp.number ++;
+ } while (strcmp(tilecode,tileend) != 0);
+ itembin_slicerpolygon_free(&sp);
+}
+
diff --git a/navit/maptool/maptool.c b/navit/maptool/maptool.c
index 5b2b7d32c..54a68135c 100644
--- a/navit/maptool/maptool.c
+++ b/navit/maptool/maptool.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2011 Navit Team
*
diff --git a/navit/maptool/maptool.h b/navit/maptool/maptool.h
index 5a97c8186..37590e30b 100644
--- a/navit/maptool/maptool.h
+++ b/navit/maptool/maptool.h
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2011 Navit Team
*
@@ -211,6 +211,7 @@ struct attr_bin * item_bin_get_attr_bin(struct item_bin *ib, enum attr_type type
struct attr_bin * item_bin_get_attr_bin_last(struct item_bin *ib);
void item_bin_add_attr_longlong(struct item_bin *ib, enum attr_type type, long long val);
void item_bin_add_attr_string(struct item_bin *ib, enum attr_type type, char *str);
+void item_bin_add_hole(struct item_bin * ib, struct coord * coord, int ccount);
void item_bin_add_attr_range(struct item_bin *ib, enum attr_type type, short min, short max);
void item_bin_remove_attr(struct item_bin *ib, void *ptr);
void item_bin_write(struct item_bin *ib, FILE *out);
@@ -232,6 +233,10 @@ struct item_bin *read_item_range(FILE *in, int *min, int *max);
struct item_bin *init_item(enum item_type type);
extern struct item_bin *tmp_item_bin;
+/* itembin_slicer.c */
+void itembin_nicer_slicer(struct tile_info *info, struct item_bin *ib, FILE *reference, char * buffer, int min);
+
+
/* maptool.c */
extern long long slice_size;
@@ -423,6 +428,14 @@ void zip_set_zipnum(struct zip_info *info, int num);
void zip_close(struct zip_info *info);
void zip_destroy(struct zip_info *info);
+/* osm.c */
+int process_multipolygons_find_loops(osmid relid, int in_count, struct item_bin ** parts, int **scount,
+ int *** sequences,
+ int **direction);
+int process_multipolygons_loop_dump(struct item_bin** bin, int scount, int*sequence, int*direction,
+ struct coord * buffer);
+int process_multipolygons_loop_count(struct item_bin** bin, int scount, int*sequence);
+
/* Break compilation on 32 bit architectures, as we're going to cast osmid's to gpointer to use them as keys to GHashTable's */
struct maptool_force_64 {
char s[sizeof(gpointer)<sizeof(osmid)?-1:1];
diff --git a/navit/maptool/misc.c b/navit/maptool/misc.c
index 9b1c72da2..2b71ccde0 100644
--- a/navit/maptool/misc.c
+++ b/navit/maptool/misc.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2008 Navit Team
*
diff --git a/navit/maptool/osm.c b/navit/maptool/osm.c
index 97ae5d1cf..c6308c2b4 100644
--- a/navit/maptool/osm.c
+++ b/navit/maptool/osm.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2011 Navit Team
*
@@ -2805,9 +2805,9 @@ static int process_multipolygons_find_loop(int in_count, struct item_bin ** part
return 0;
}
-static int process_multipolygons_find_loops(osmid relid, int in_count, struct item_bin ** parts, int **scount,
- int *** sequences,
- int **direction) {
+int process_multipolygons_find_loops(osmid relid, int in_count, struct item_bin ** parts, int **scount,
+ int *** sequences,
+ int **direction) {
int done=0;
int loop_count=0;
int *used;
@@ -2846,8 +2846,8 @@ static int process_multipolygons_find_loops(osmid relid, int in_count, struct it
return loop_count;
}
-static int process_multipolygons_loop_dump(struct item_bin** bin, int scount, int*sequence, int*direction,
- struct coord * buffer) {
+int process_multipolygons_loop_dump(struct item_bin** bin, int scount, int*sequence, int*direction,
+ struct coord * buffer) {
int points = 0;
int a;
@@ -2891,7 +2891,7 @@ static int process_multipolygons_loop_dump(struct item_bin** bin, int scount, in
* @param sequence sequence calculated by process_multipolygon_find_loop
* @returns number of coords
*/
-static int process_multipolygons_loop_count(struct item_bin** bin, int scount, int*sequence) {
+int process_multipolygons_loop_count(struct item_bin** bin, int scount, int*sequence) {
return process_multipolygons_loop_dump(bin,scount,sequence,NULL,NULL);
}
@@ -3083,6 +3083,19 @@ static void process_multipolygons_setup_one(struct item_bin * ib, struct relatio
/*realloc outer to make space for next */
outer = g_realloc(outer, sizeof(struct relation_member) * (outer_count +1));
}
+ /* in ancient times of OSM, multipolygons were created having no "role" for outer loop members.
+ * There are still such multipolygons. Rescue most of them, by treating the role less members
+ * as outer. These multiolygons are treated a mistake nowadays, but even now some editing tools
+ * seem to create such.*/
+ min_count=0;
+ while(search_relation_member(ib, "",&(outer[outer_count]),&min_count)) {
+ //osm_warning("relation",relid,0,"multipolygon: using empty role type as outer\n");
+ if(outer[outer_count].type != rel_member_way)
+ osm_warning("relation",relid,0,"multipolygon: wrong type for outer member\n");
+ outer_count ++;
+ /*realloc outer to make space for next */
+ outer = g_realloc(outer, sizeof(struct relation_member) * (outer_count +1));
+ }
min_count=0;
while(search_relation_member(ib, "inner",&(inner[inner_count]),&min_count)) {
if(inner[inner_count].type != rel_member_way)
diff --git a/navit/maptool/osm_protobuf.c b/navit/maptool/osm_protobuf.c
index 4f71010e4..e38a111f6 100644
--- a/navit/maptool/osm_protobuf.c
+++ b/navit/maptool/osm_protobuf.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2011 Navit Team
*
diff --git a/navit/maptool/osm_protobufdb.c b/navit/maptool/osm_protobufdb.c
index 64b601280..a2343c707 100644
--- a/navit/maptool/osm_protobufdb.c
+++ b/navit/maptool/osm_protobufdb.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2011 Navit Team
*
diff --git a/navit/maptool/osm_psql.c b/navit/maptool/osm_psql.c
index a8dac6914..c4a936723 100644
--- a/navit/maptool/osm_psql.c
+++ b/navit/maptool/osm_psql.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2011 Navit Team
*
diff --git a/navit/maptool/osm_relations.c b/navit/maptool/osm_relations.c
index 3d05caab7..bb7a48811 100644
--- a/navit/maptool/osm_relations.c
+++ b/navit/maptool/osm_relations.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2011 Navit Team
*
diff --git a/navit/maptool/osm_xml.c b/navit/maptool/osm_xml.c
index 6cef06493..9fe3ac093 100644
--- a/navit/maptool/osm_xml.c
+++ b/navit/maptool/osm_xml.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2011 Navit Team
*
diff --git a/navit/maptool/sourcesink.c b/navit/maptool/sourcesink.c
index eedd433d9..d240c67f5 100644
--- a/navit/maptool/sourcesink.c
+++ b/navit/maptool/sourcesink.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2011 Navit Team
*
diff --git a/navit/maptool/tempfile.c b/navit/maptool/tempfile.c
index bdb4dad96..3a4895b9e 100644
--- a/navit/maptool/tempfile.c
+++ b/navit/maptool/tempfile.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2011 Navit Team
*
diff --git a/navit/maptool/tile.c b/navit/maptool/tile.c
index f0d10332a..695dd6d4e 100644
--- a/navit/maptool/tile.c
+++ b/navit/maptool/tile.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2008 Navit Team
*
@@ -334,12 +334,21 @@ void tile_write_item_to_tile(struct tile_info *info, struct item_bin *ib, FILE *
}
void tile_write_item_minmax(struct tile_info *info, struct item_bin *ib, FILE *reference, int min, int max) {
+ /*TODO: make slice_trigger and slice_target configurable by commandline parameter.
+ * bonus: find out why there is a 'min' parameter here
+ */
+ int slice_trigger = 4;
+ int slice_target = 7;
struct rect r;
char buffer[1024];
bbox((struct coord *)(ib+1), ib->clen/2, &r);
buffer[0]='\0';
tile(&r, info->suffix, buffer, max, overlap, NULL);
- tile_write_item_to_tile(info, ib, reference, buffer);
+ if((ib->type >= type_area) && (ib->type != type_poly_water_tiled) && (tile_len(buffer) < slice_trigger)) {
+ itembin_nicer_slicer(info, ib, reference, buffer, slice_target);
+ } else {
+ tile_write_item_to_tile(info, ib, reference, buffer);
+ }
}
int add_aux_tile(struct zip_info *zip_info, char *name, char *filename, int size) {
diff --git a/navit/maptool/zip.c b/navit/maptool/zip.c
index 2538e2e3b..d912c0073 100644
--- a/navit/maptool/zip.c
+++ b/navit/maptool/zip.c
@@ -1,4 +1,4 @@
-/**
+/*
* Navit, a modular navigation system.
* Copyright (C) 2005-2008 Navit Team
*