summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Herlant <aerostitch@users.noreply.github.com>2019-10-29 15:19:23 -0700
committerGitHub <noreply@github.com>2019-10-29 15:19:23 -0700
commit38dd493196f02302bb84c72b8c48b53a59c7dd89 (patch)
tree8f99d7cf396ae1dab83e81babd36fed1fc8bfb38
parent3303b370d9c9668bb6171fe42be7066b86a85b76 (diff)
parentc0a7ca3b532251ef0334f84c17a19274f501969c (diff)
downloadnavit-38dd493196f02302bb84c72b8c48b53a59c7dd89.tar.gz
Merge branch 'trunk' into android_hole
-rw-r--r--.circleci/config.yml9
-rw-r--r--CHANGELOG.md90
-rw-r--r--CONTRIBUTING.md28
-rwxr-xr-xcontrib/sailfish/build_sailfish_ci.sh4
-rw-r--r--docs/basic_configuration.rst16
-rw-r--r--docs/conf.py5
-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.rst153
-rw-r--r--docs/development/changelog_wrapper.rst1
-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.rst174
-rw-r--r--docs/index.rst20
-rw-r--r--docs/maps.rst1
-rw-r--r--docs/osm.rst42
-rw-r--r--docs/requirements.txt1
-rw-r--r--navit/android.c95
-rw-r--r--navit/android/AndroidManifest.xml16
-rw-r--r--navit/android/build.gradle11
-rw-r--r--navit/android/res/values-v19/styles.xml5
-rw-r--r--navit/android/res/values-v21/styles.xml18
-rw-r--r--navit/android/res/values/strings.xml1
-rw-r--r--navit/android/res/xml/navit_backup_rules.xml4
-rw-r--r--navit/android/src/org/navitproject/navit/Navit.java251
-rw-r--r--navit/android/src/org/navitproject/navit/NavitAddressSearchActivity.java8
-rw-r--r--navit/android/src/org/navitproject/navit/NavitBackupTask.java10
-rw-r--r--navit/android/src/org/navitproject/navit/NavitCallbackHandler.java84
-rw-r--r--navit/android/src/org/navitproject/navit/NavitCamera.java41
-rw-r--r--navit/android/src/org/navitproject/navit/NavitDialogs.java8
-rw-r--r--navit/android/src/org/navitproject/navit/NavitDownloadSelectMapActivity.java11
-rw-r--r--navit/android/src/org/navitproject/navit/NavitGraphics.java250
-rw-r--r--navit/android/src/org/navitproject/navit/NavitMapDownloader.java899
-rw-r--r--navit/android/src/org/navitproject/navit/NavitRestoreTask.java12
-rw-r--r--navit/android/src/org/navitproject/navit/NavitSensors.java6
-rw-r--r--navit/android/src/org/navitproject/navit/NavitUtils.java6
-rw-r--r--navit/android/src/org/navitproject/navit/NavitVehicle.java1
-rw-r--r--navit/coord.h8
-rw-r--r--navit/graphics.c53
-rw-r--r--navit/graphics/android/graphics_android.c2
-rw-r--r--navit/graphics/qt5/event_qt5.cpp1
-rw-r--r--navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp301
-rw-r--r--navit/gui/qml/gui_qml.cpp1
-rw-r--r--navit/gui/qml/vehicleProxy.h1
-rw-r--r--navit/gui/qt5_qml/backend.cpp2
-rw-r--r--navit/iphone/downloader/Classes/DownloaderDetailViewController.h5
-rw-r--r--navit/map.h3
-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.c46
-rw-r--r--navit/maptool/itembin_slicer.c856
-rw-r--r--navit/maptool/maptool.c6
-rw-r--r--navit/maptool/maptool.h16
-rw-r--r--navit/maptool/misc.c2
-rw-r--r--navit/maptool/osm.c230
-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.c71
-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.c20
-rw-r--r--navit/navit.dtd12
-rw-r--r--navit/plugin/pedestrian/pedestrian.c931
-rw-r--r--navit/search.c14
-rw-r--r--navit/search.h1
-rw-r--r--navit/speech/qt5_espeak/Qt5EspeakAudioOut.h3
-rw-r--r--navit/traffic.c4
-rw-r--r--navit/vehicle/qt5/vehicle_qt5.cpp17
-rw-r--r--po/de.po.in915
-rw-r--r--po/en_GB.po.in26
-rwxr-xr-xscripts/ci_sanity_checks.sh2
-rw-r--r--scripts/setup_sanitycheck_requirements.sh4
84 files changed, 4042 insertions, 2199 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index b4fef97e0..d1a085d23 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -9,7 +9,7 @@ jobs:
- checkout
- run:
name: Setup requirements
- command: bash scripts/setup_common_requirements.sh
+ command: bash scripts/setup_sanitycheck_requirements.sh
- run:
name: run sanity check script
command: bash scripts/ci_sanity_checks.sh
@@ -83,9 +83,6 @@ jobs:
sudo apt-get update
sudo apt-get install -y ant cmake gettext libsaxonb-java librsvg2-bin pkg-config rename
- run:
- name: Install Android SDK components
- command: sdkmanager "cmake;3.6.4111459"
- - run:
name: Install ndk
command: |
echo y | sdkmanager --licenses
@@ -110,10 +107,6 @@ jobs:
path: navit/android/build/outputs/apk
destination: apk
- store_artifacts:
- name: Store translations
- path: po
- destination: translations
- - store_artifacts:
name: Store logs
path: navit/android/build/outputs/logs
destination: logs
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d94d5b9eb..fa94da6ab 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,7 +14,7 @@ Navit follows the semantic versioning:
replacement for the previous version (all data formats and interfaces are still
supported); minor UI changes (such as moving individual menu items) are also
allowed
-* X.y.z (major): at least one of the following:
+* `X.y.z` (major): at least one of the following:
* Major new functionality (such as Augmented Reality, inertial navigation or
support for live traffic services): de-facto standard for end-user apps
* New user interface (such as moving from the old pulldown menu UI to the Internal
@@ -27,22 +27,72 @@ Navit follows the semantic versioning:
## [Unreleased]
To get the list of all the unreleased commits, see:
-https://github.com/navit-gps/navit/compare/v0.5.2...HEAD
-
-This changelog is generated from the list of commits on every releases.
+[Full Changelog](https://github.com/navit-gps/navit/compare/v0.5.3...HEAD)
+
+**Implemented enhancements:**
+
+- fix/enhancement:graphics/layout:get default icon size from layout + draw tunnels transparent + mark oneway streets [\#884](https://github.com/navit-gps/navit/pull/884) ([metalstrolch](https://github.com/metalstrolch))
+- core:feature:multipolygon support [\#824](https://github.com/navit-gps/navit/pull/824) ([metalstrolch](https://github.com/metalstrolch))
+- Add/Android: Provide geo coordinates for clicked position in contextual menu [\#794](https://github.com/navit-gps/navit/pull/794) ([lains](https://github.com/lains))
+- Add:Gui/Internal: Adding missing escape modes and fixing generic html escape mode [\#785](https://github.com/navit-gps/navit/pull/785) ([lains](https://github.com/lains))
+- Fix:Speech:Android: Replace hyphens with white spaces when using android speech [\#761](https://github.com/navit-gps/navit/pull/761) ([lains](https://github.com/lains))
+- enhancement:layout\_car:use transparency to draw some map features [\#879](https://github.com/navit-gps/navit/pull/879) ([metalstrolch](https://github.com/metalstrolch))
+- update: Navit logo for \(sailfish\) desktop [\#874](https://github.com/navit-gps/navit/pull/874) ([metalstrolch](https://github.com/metalstrolch))
+- Add watch after reopen the gps file [\#872](https://github.com/navit-gps/navit/pull/872) ([gefin](https://github.com/gefin))
+- Add:graphics/windows: polygons with holes for windows CE [\#862](https://github.com/navit-gps/navit/pull/862) ([metalstrolch](https://github.com/metalstrolch))
+- Add:graphics/sdl: Polygon with holes support. [\#861](https://github.com/navit-gps/navit/pull/861) ([metalstrolch](https://github.com/metalstrolch))
+- Admin levels for additional countries [\#859](https://github.com/navit-gps/navit/pull/859) ([mvglasow](https://github.com/mvglasow))
+- Add:graphics/windows: draw polygon with holes [\#855](https://github.com/navit-gps/navit/pull/855) ([metalstrolch](https://github.com/metalstrolch))
+- countries:add:Kosovo [\#846](https://github.com/navit-gps/navit/pull/846) ([metalstrolch](https://github.com/metalstrolch))
+- update building of sailfish OS to version 3.1.0.12 [\#843](https://github.com/navit-gps/navit/pull/843) ([hoehnp](https://github.com/hoehnp))
+- traffic:Improve startup performance [\#822](https://github.com/navit-gps/navit/pull/822) ([mvglasow](https://github.com/mvglasow))
+- feature:gui\_internal: include post code in town serch [\#818](https://github.com/navit-gps/navit/pull/818) ([metalstrolch](https://github.com/metalstrolch))
+- add:graphics:dpi scaling support [\#813](https://github.com/navit-gps/navit/pull/813) ([metalstrolch](https://github.com/metalstrolch))
+- jandegr's fix for the windows builds issues [\#806](https://github.com/navit-gps/navit/pull/806) ([pgrandin](https://github.com/pgrandin))
+- qt5: Remove unnecessary moc includes. [\#798](https://github.com/navit-gps/navit/pull/798) ([metalstrolch](https://github.com/metalstrolch))
+- Disable maptool if protobuf-c not found [\#797](https://github.com/navit-gps/navit/pull/797) ([metalstrolch](https://github.com/metalstrolch))
+- Adding comments and const [\#788](https://github.com/navit-gps/navit/pull/788) ([lains](https://github.com/lains))
+- Sync bookmarks 2 [\#782](https://github.com/navit-gps/navit/pull/782) ([jkoan](https://github.com/jkoan))
+- Feature:Support USERPROFILE folder for Windows target [\#758](https://github.com/navit-gps/navit/pull/758) ([OLFDB](https://github.com/OLFDB))
+- Android: Do not reinitialize everything when the activity is recreated [\#754](https://github.com/navit-gps/navit/pull/754) ([mvglasow](https://github.com/mvglasow))
+- Add:gui/internal: Greek keyboard [\#753](https://github.com/navit-gps/navit/pull/753) ([OLFDB](https://github.com/OLFDB))
+- patch:vehicle:gpsd allow navit to use gpsd API version 7 and higher, … [\#749](https://github.com/navit-gps/navit/pull/749) ([charlescurley](https://github.com/charlescurley))
+- Android build chain updates [\#746](https://github.com/navit-gps/navit/pull/746) ([mvglasow](https://github.com/mvglasow))
+- Make Navit work in split screen mode [\#745](https://github.com/navit-gps/navit/pull/745) ([mvglasow](https://github.com/mvglasow))
+- Enable traffic plugins by default [\#744](https://github.com/navit-gps/navit/pull/744) ([mvglasow](https://github.com/mvglasow))
+
+**Fixed bugs:**
+
+- Missing clipping for polygons with holes leads to slow rendering performance on Windows CE and SDL [\#869](https://github.com/navit-gps/navit/issues/869)
+- Bicycle routing is close to unusable outside built-up areas [\#844](https://github.com/navit-gps/navit/issues/844)
+- fix:graphics/qt5; Allow to draw transparent polygons [\#878](https://github.com/navit-gps/navit/pull/878) ([metalstrolch](https://github.com/metalstrolch))
+- Fix:android:64 bit and cleanup2 [\#877](https://github.com/navit-gps/navit/pull/877) ([jandegr](https://github.com/jandegr))
+- fix:core:add clipping to polygons with holes [\#870](https://github.com/navit-gps/navit/pull/870) ([metalstrolch](https://github.com/metalstrolch))
+- Fix:xml:Fix bike routing [\#850](https://github.com/navit-gps/navit/pull/850) ([mvglasow](https://github.com/mvglasow))
+- Fix: Fix pkgconfig detection, and multiple subsequent build for Android [\#833](https://github.com/navit-gps/navit/pull/833) ([lains](https://github.com/lains))
+- Android build fix and update - to be tested [\#827](https://github.com/navit-gps/navit/pull/827) ([jandegr](https://github.com/jandegr))
+- Fix:graphics/android:Fix crash on startup [\#838](https://github.com/navit-gps/navit/pull/838) ([mvglasow](https://github.com/mvglasow))
+- Issue/826 [\#837](https://github.com/navit-gps/navit/pull/837) ([gefin](https://github.com/gefin))
+- fix: vehicle: Increase layer for cursor for rotation [\#817](https://github.com/navit-gps/navit/pull/817) ([metalstrolch](https://github.com/metalstrolch))
+- fix:core: Correct default layout handling. [\#816](https://github.com/navit-gps/navit/pull/816) ([metalstrolch](https://github.com/metalstrolch))
+- fix: no redraw of map when stopping drag over osd\_speed\_warner, osd\_stopwatch and osd\_odometer [\#814](https://github.com/navit-gps/navit/pull/814) ([hoehnp](https://github.com/hoehnp))
+- Fix:core:Fix Warning in IDE for Items not found [\#778](https://github.com/navit-gps/navit/pull/778) ([jkoan](https://github.com/jkoan))
+- fix:graphics:Fix issue when try to close the SDL window ion non webos [\#775](https://github.com/navit-gps/navit/pull/775) ([jkoan](https://github.com/jkoan))
+- Fix:core:Fix item\_def.h when used whithout defined macros \(like in IDE\) [\#771](https://github.com/navit-gps/navit/pull/771) ([jkoan](https://github.com/jkoan))
+- Fix:port/Android:Create notification channel on API 26+ [\#756](https://github.com/navit-gps/navit/pull/756) ([mvglasow](https://github.com/mvglasow))
## [v0.5.3] - 2018-08-31
Release 0.5.2 had issues with the version not properly updated in the `CMakeLists.txt`. This release fixes that issue.
-## Changed
+### Changed
* Update Sailfish spec for release 0.5.3. [Joseph Herlant]
* Update Patch version for release 0.5.3. [Joseph Herlant]
## [v0.5.2] - 2018-08-30
-## Added
+### Added
* Add:build:Make gradlew executable. [mvglasow]
* Add:build:Ignore gradle artifacts. [mvglasow]
@@ -52,7 +102,7 @@ Release 0.5.2 had issues with the version not properly updated in the `CMakeList
* Add:build:Add cmake4eclipse artifacts to .gitignore (#594) [mvglasow]
* Add Slovakia and Belgium to the maplist. [jandegr]
-## Changed
+### Changed
* Update:doc:Update AUTHORS file. [Joseph Herlant]
* Update in-tree espeak to espeak-1.48.04 (#624) [Stefan Wildemann]
@@ -83,7 +133,7 @@ Release 0.5.2 had issues with the version not properly updated in the `CMakeList
* Refactor:core:Improve documentation of route\_value\_seg() [mvglasow]
* Update:release:Add more keywords for gitchangelog
-## Fixed
+### Fixed
* Fix Android apk VersionCode (#633) [jkoan]
* Fix latlon2bookmark (#627) [jkoan]
@@ -127,7 +177,7 @@ Release 0.5.2 had issues with the version not properly updated in the `CMakeList
* Refactor:Android (#563) [jandegr]
* Refactoring:Android:cleanup (#458) [jandegr]
-## Removed
+### Removed
* Cleanup:osd&support\_espeak:get rid of unused-variables compilation warnings (#619) [Joseph Herlant]
* Cleanup:scripts:removes deprecated usage of egrep (#616) [Joseph Herlant]
@@ -142,7 +192,7 @@ Release 0.5.2 had issues with the version not properly updated in the `CMakeList
## [v0.5.1] - 2018-04-19
-## Added
+### Added
* Adding question mark to icon for position pending (#423) [lains]
* Add:icon:forbiden\_area (#331) [youte62]
@@ -225,7 +275,7 @@ Release 0.5.2 had issues with the version not properly updated in the `CMakeList
* Add:port\_android:OSD button and command to show Android menu. [mvglasow]
* Adding a androix/x86 build script. [Pierre GRANDIN]
-## Changed
+### Changed
* Update NavitVehicle.java. [jandegr]
* Update NavitVehicle.java. [jandegr]
@@ -396,7 +446,7 @@ Release 0.5.2 had issues with the version not properly updated in the `CMakeList
* Update build\_android\_x86.sh. [jandegr]
* Updated COPYRIGHT for 2016. [Pierre GRANDIN]
-## Fixed
+### Fixed
* Contrib:New version for sailfish 0.5.1-r5 (#444) [Stefan Wildemann]
* OSD:Make Image and Scale osd types obey osd\_configuration setting (trac:1202) (#439) [Robert Pohlink]
@@ -528,14 +578,14 @@ Release 0.5.2 had issues with the version not properly updated in the `CMakeList
* Osd: Make osd "Button" accept h and w props. [Stefan Wildemann]
* Core:Crash in country\_search\_new Properly handle coutry search by attr\_country\_id to fix crash in internal gui when there's a gps fix and a map supporting attr\_country\_id such as Reiseplaner is active. Fixes #1337. [Michael Dankov]
-## Removed
+### Removed
* Removed deprecated files and fixed a configuration example. [jkoan]
* Cleanup old xpm icons (#292) [Johan Fitié]
* Removed autotools lefotover (#204) [jandegr]
* Cleanup. [jandegr]
-## Other
+### Other
* Show min/max elevation and distance in height profile. [Timo]
* Maptool: migrate strdup to g\_strdup. [Joseph Herlant]
@@ -741,20 +791,20 @@ Release 0.5.2 had issues with the version not properly updated in the `CMakeList
## [v0.5.0] - 2015-12-31
-This release was done before the adoption of this changelog format. Click
-[here](https://github.com/navit-gps/navit/compare/v0.5.0-rc.2...v0.5.0)
+This release was done before the adoption of this changelog format. Use
+[this v0.5.0-rc.2 to v0.5.0 comparison link](https://github.com/navit-gps/navit/compare/v0.5.0-rc.2...v0.5.0)
to view the corresponding changes.
## [v0.5.0-rc2] - 2015-09-02
-This release was done before the adoption of this changelog format. Click
-[here](https://github.com/navit-gps/navit/compare/v0.5.0-rc.1...v0.5.0-rc.2)
+This release was done before the adoption of this changelog format. Use
+[this v0.5.0-rc.1 to v0.5.0-rc.2 comparison link](https://github.com/navit-gps/navit/compare/v0.5.0-rc.1...v0.5.0-rc.2)
to view the corresponding changes.
## [v0.5.0-rc1] - 2015-08-08
-This release was done before the adoption of this changelog format. Click
-[here](https://github.com/navit-gps/navit/compare/v0.5.0-beta.1...v0.5.0-rc.1)
+This release was done before the adoption of this changelog format. Use
+[this v0.5.0-beta.1 to v0.5.0-rc.1 comparison link](https://github.com/navit-gps/navit/compare/v0.5.0-beta.1...v0.5.0-rc.1)
to view the corresponding changes.
[Unreleased]: https://github.com/navit-gps/navit/compare/v0.5.3...HEAD
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4a71f995c..5ea95ad43 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -3,8 +3,8 @@
Welcome to Navit! We welcome contributions!
If you are interested in contributing to the [Navit code repo](README.md)
-then checkout the [Wiki](https://wiki.navit-project.org/index.php/Main_Page)
-and our [ReadTheDocs space](https://navit.readthedocs.io)
+then checkout the [old Wiki](https://wiki.navit-project.org/index.php/Main_Page)
+and our [new wiki hosted on ReadTheDocs](https://navit.readthedocs.io)
When pushing a pull request, please make sure you follow our:
* [programming guidelines](https://navit.readthedocs.io/en/trunk/development/programming_guidelines.html)
@@ -55,6 +55,30 @@ If your changes are more complex, catch up new ideas, or still have some minor p
So that's it, you helped Navit to go one step forward. Thank you very much :)
+## Contributing on the documentation
+
+For the documentation we now use [readthedocs](https://navit.readthedocs.io/en/trunk/) pulled from the docs folder inside this repository<.
+
+We follow the [Documentation style guide from Sphinx](https://documentation-style-guide-sphinx.readthedocs.io/en/latest/style-guide.html) (as readthedocs uses sphinx).
+With a small exception which is that we still use the `.rst` extension instead of the recommended `.txt` one for now.
+
+The [old wiki](https://wiki.navit-project.org/index.php) has been deprecated and is slowly being migrated to our
+[new wiki](https://navit.readthedocs.io/en/trunk/).
+
+To update or add documentation, create a pull request on github using a PR title starting by `update:doc:` and followed by a
+message explaining the change.
+
+You can use the following command from the root of the git repository clone to check the linting of the documentation (The last argument is the output directory so you might have to adjust that) if you have `sphinx-build` installed:
+
+```
+mkdir /tmp/navit
+sphinx-build -Dhtml_theme="sphinx_rtd_theme" -n -E -W --keep-going docs /tmp/navit/
+```
+
+Now if you want to view how the result would look like you can:
+ * open <file:///tmp/navit/index.html> in your favorite browser
+ * or if you prefer to run an http server on the directory you created the build in (`/tmp/navit/` in the previously mentionned command) you can do so using: `python3 -m http.server 8000` and then call <http://localhost:8000> from your browser.
+
## See also
* [programming guidelines](https://navit.readthedocs.io/en/trunk/development/programming_guidelines.html)
diff --git a/contrib/sailfish/build_sailfish_ci.sh b/contrib/sailfish/build_sailfish_ci.sh
index 58d1022f3..55a20317d 100755
--- a/contrib/sailfish/build_sailfish_ci.sh
+++ b/contrib/sailfish/build_sailfish_ci.sh
@@ -17,6 +17,6 @@ mkdir $HOME/rpmbuild
sb2 -t SailfishOS-${VERSION_ID}-armv7hl -m sdk-install -R zypper --non-interactive in $(grep "^BuildRequires: " navit-sailfish.spec | sed -e "s/BuildRequires: //")
sb2 -t SailfishOS-${VERSION_ID}-armv7hl -m sdk-build rpmbuild --define "_topdir /home/nemo/rpmbuild" --define "navit_source ${SCRIPTPATH}/../.." -bb navit-sailfish.spec
#intel devices
-sb2 -t SailfishOS-${VERSION_ID}-i486 -m sdk-install -R zypper --non-interactive in $(grep "^BuildRequires: " navit-sailfish.spec | sed -e "s/BuildRequires: //")
-sb2 -t SailfishOS-${VERSION_ID}-i486 -m sdk-build rpmbuild --define "_topdir /home/nemo/rpmbuild" --define "navit_source ${SCRIPTPATH}/../.." -bb navit-sailfish.spec
+#sb2 -t SailfishOS-${VERSION_ID}-i486 -m sdk-install -R zypper --non-interactive in $(grep "^BuildRequires: " navit-sailfish.spec | sed -e "s/BuildRequires: //")
+#sb2 -t SailfishOS-${VERSION_ID}-i486 -m sdk-build rpmbuild --define "_topdir /home/nemo/rpmbuild" --define "navit_source ${SCRIPTPATH}/../.." -bb navit-sailfish.spec
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/conf.py b/docs/conf.py
index a8b73e774..99af94fe4 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,6 +1,11 @@
# -*- coding: utf-8 -*-
from datetime import datetime
+extensions = [
+ 'm2r',
+ 'sphinx_rtd_theme',
+]
+
source_suffix = '.rst'
master_doc = 'index'
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
new file mode 100644
index 000000000..323a0d877
--- /dev/null
+++ b/docs/development/android_development.rst
@@ -0,0 +1,153 @@
+===================
+Android Development
+===================
+
+Developing for Android
+======================
+
+Pre-requisites
+--------------
+
+For Navit
+~~~~~~~~~
+
+ * Ensure that your system has the correct dependencies installed to build Navit.
+ * Checkout the latest copy of Navit from git. The instructions on this page assume you have checked-out a copy to `~/src/navit/`
+
+.. code-block:: bash
+
+ cd ~/src
+ git clone git@github.com:navit-gps/navit.git
+
+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`
+ * On Ubuntu you can accomplish this using the following command (assuming the SDK and NDK have been unzipped to `~/src`):
+
+.. code-block:: bash
+
+ export ANDROID_NDK=~/src/android-ndk-r8
+ export ANDROID_SDK=~/src/android-sdk-linux
+ export PATH=$PATH:$ANDROID_NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools
+
+Double-check the version numbers in the paths and adapt if required. If you are running a 64-bit version of the NDK, replace `linux-x86` with `linux-x86_64`.
+
+Prepare Android SDK:
+ * run android in command line - this will show a GUI for preparing Android SDK
+ * select Android 2.2 (API 8) and click 'Install N packages...' button - this will download SDK packages that support API 8
+
+Compiling
+---------
+
+**We have recently switched from CMake to gradle for the Android build. CMake is no longer supported for the Android build, see the section on gradle for details.**
+
+Assuming you've followed the previous steps, you're probably setup to start compiling. Ensure that:
+ * You have a java-jdk installed on your system. On Ubuntu: `sudo apt-get install openjdk-6-jdk`. When multiple version of java are installed `update-java-alternatives -s java-1.6.0-openjdk-i386`
+ * On Ubuntu, ensure that ant1.8 is installed: `sudo apt-get install ant1.8`
+ * Make sure that you have saxonb-xslt installed: `sudo apt-get install libsaxonb-java`
+
+With cmake
+----------
+
+ * Ensure that you have **CMake 2.8** installed.
+ * Create a build directory - this will be the directory into which the Android version of Navit will be built. Assume we've made one in `~/src` as follows:
+
+.. code-block:: bash
+
+ 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!):
+
+.. 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:
+
+.. code-block:: bash
+
+ make
+ make apkg
+
+ * The previous commands have now created a package called `Navit-debug.apk` in the following directory: `~/src/android-build/navit/android/bin`
+ * Copy the package to your device (i.e. sd-card) and run it from there (through a file-manager, for example), or
+ * If debug bridge (adb) is enabled run: `adb install navit/android/bin/Navit-debug.apk`
+ * Later, to reinstall already installed Navit app run: `adb install -r navit/android/bin/Navit-debug.apk`
+
+With cmake on Windows
+---------------------
+
+ * install CMake 2.8 if you haven't already, add folder with exe to PATH
+ * install MinGW or use MinGW included in the git windows folder (e.g. C:\msysgit\mingw\ ), add folder with exe to PATH
+ * install saxon .NET version from http://sourceforge.net/projects/saxon/files/Saxon-HE/9.3/SaxonHE9-3-0-4N-setup.exe/download,
+ * rename `transform.exe` to `saxon.exe`, add folder with exe to PATH
+ * create a build dir (i.e. `mkdir android-build`)
+ * run from build dir ( replace `$SOURCE_PATH`):
+
+.. code-block:: bash
+
+ cmake -DCMAKE_TOOLCHAIN_FILE=$SOURCE_PATH/Toolchain/arm-eabi.cmake -DCACHE_SIZE="(20*1024*1024)" -DAVOID_FLOAT=1 -DANDROID_PERMISSIONS="CAMERA" $SOURCE_PATH -G "MinGW Makefiles"
+
+ * run `MinGW32-make`
+ * run `MinGW32-make apkg`
+ * install `Navit-debug.apk` (in `<build path>/navit/android/bin`) to your device
+ * copy `navit/android/bin/Navit-debug.apk` to your device (i.e. sd-card) and run it from there or
+ * if debug bridge (`adb`) is enabled run `adb install navit/android/bin/Navit-debug.apk`
+
+With gradle
+-----------
+
+**Note: this section is still under construction and may not yet be accurate!**
+
+These setup instructions are for a machine that does not have Android Studio installed. If you have Android Studio, some of them may not be necessary (or can be accomplished in a different way).
+
+Make sure you have the following Android SDK components installed (if not, install them using Android SDK Manager):
+
+ * Android SDK Platform-tools, version 25.0.3 or later
+ * Android SDK Build-tools, version 27.0.3
+
+Make sure you have the `ANDROID_HOME` environment variable set and pointing to your Android SDK dir. On Linux, this can be accomplished by adding the following line at the bottom of your `.bashrc` file in your home dir: `export ANDROID_HOME="$HOME/bin/android-sdk-linux_86"` (use the actual path to your SDK install here)
+
+You need to enter the command in your current shell as well in order for it to take effect there as well.
+
+On Ubuntu 18.04 or later (or if your default JRE is Java 9 or later), edit `$ANDROID_HOME/tools/bin/sdkmanager`. Change line #31 to read:
+
+.. code-block:: bash
+
+ DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME" -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee'
+
+Now run `$ANDROID_HOME/tools/bin/sdkmanager "cmake;3.6.4111459"` and accept the license agreement. (If the package is not found, run `$ANDROID_HOME/tools/bin/sdkmanager --list | grep cmake` and install the cmake version reported there.)
+
+Make sure you have NDK version 12 or later (if you don’t, install it with `$ANDROID_HOME/tools/bin/sdkmanager "ndk-bundle"`.)
+
+If you did **not** install NDK through `sdkmanager`, make sure you have the `ANDROID_NDK_HOME` environment variable set and pointing to your Android NDK dir. (If not, add it as described above.)
+
+Change to the Navit source dir and run `./gradlew build`.
+
+So far, two issues have been observed with the build:
+
+ * Bitmap resources are missing from the APK. A workaround is described `here <https://github.com/navit-gps/navit/pull/553#issuecomment-406881461>`_ integration of these steps into gradle is being worked on.
+ * 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:: cmake
+
+ set_with_reason(vehicle/gpsd "Android detected" FALSE)
+ set_with_reason(map/garmin "Android detected" FALSE)
+
+
+Testing an alternative build
+============================
+
+If you want to try an alternative build (e.g. Jan's builds with alternative routing) you can do it by :
+ * enable unsigned apk installation ( `example build <http://www.tomsguide.com/faq/id-2326514/download-install-android-apps-unidentified-developer.html>`_ )
+ * installing an alternative apk (e.g. `an APK from CircleCI <https://circle-artifacts.com/gh/jandegr/navit/292/artifacts/0/tmp/circle-artifacts.MZk9Slb/navit-96b3160a2e51dffb54e3aa74c17ce3683c52828e-debug.apk>`_)
+ * you will probably need an alternative map to match the application requirements (such as `this one <https://circle-artifacts.com/gh/jandegr/navit/265/artifacts/0/tmp/circle-artifacts.WJkkT78/BNLFR.bin>`_)
diff --git a/docs/development/changelog_wrapper.rst b/docs/development/changelog_wrapper.rst
new file mode 100644
index 000000000..071c46823
--- /dev/null
+++ b/docs/development/changelog_wrapper.rst
@@ -0,0 +1 @@
+.. mdinclude :: ../../CHANGELOG.md
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..7f15672ed 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
+::
libtool: link: CURRENT `' must be a nonnegative integer
@@ -220,9 +220,9 @@ libtiff
make install
glib
-''''
+^^^^
-.. code-block:: bash
+::
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..6aa695f82 100644
--- a/docs/development/windows_development.rst
+++ b/docs/development/windows_development.rst
@@ -5,7 +5,7 @@ Windows Development
Compiling using CMake
=====================
-At the moment, compiling with [[CMake]] seems to be the only way to create a runnable binary in Windows.
+At the moment, compiling with CMake seems to be the only way to create a runnable binary in Windows.
Compiling / debugging using CodeBlocks & mingw compiler
@@ -32,14 +32,14 @@ Install the packages mentioned above. After everything has been installed you ca
.. warning::
- Not up to date! Directory projs\CodeBlocks was deleted in 2009
+ Not up to date! Directory projs\CodeBlocks was deleted in 2009
Compiling
---------
.. warning::
- Not up to date! Directory projs\CodeBlocks was deleted in 2009
+ Not up to date! Directory projs\CodeBlocks was deleted in 2009
To compile:
@@ -73,8 +73,9 @@ Download cygwin
Download the cygwin setup.exe from http://cygwin.com/setup.exe
.. note::
- I have been unable to build with cygwin according to these instructions. I suggest you only try it if you are knowledgable
- and can improve the instructions. --[[User:Nop|Nop]] 13:01, 7 November 2010 (UTC)
+
+ I have been unable to build with cygwin according to these instructions. I suggest you only try it if you are knowledgable
+ and can improve the instructions. --[[User:Nop|Nop]] 13:01, 7 November 2010 (UTC)
Dependencies
------------
@@ -110,13 +111,13 @@ Edit configure.in and add the following to CFLAGS at line 10:
.. code-block:: bash
- -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
+ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
It should look like this :
.. code-block:: bash
- CFLAGS="$CFLAGS -Wall -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include"
+ CFLAGS="$CFLAGS -Wall -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include"
Now run `autogen.sh && ./configure`
@@ -153,7 +154,7 @@ Configuration GPS
.. note::
- If this works at all, it's only when running under cygwin. See above for the proper Win32 configuration. --[[User:Nop|Nop]] 13:04, 7 November 2010 (UTC)
+ If this works at all, it's only when running under cygwin. See above for the proper Win32 configuration. --[[User:Nop|Nop]] 13:04, 7 November 2010 (UTC)
If you have a gps cable device which spits out NMEA data, you can configure it like under unix. Beware of the following enumeration:
* ComPort1==ttyS0
@@ -164,7 +165,7 @@ Example:
.. code-block:: xml
- <vehicle name="GPSOnCom3" profilename="car" enabled="yes" active="1" source="file:/dev/ttyS2" baudrate="38400" color="#0000ff"/>
+ <vehicle name="GPSOnCom3" profilename="car" enabled="yes" active="1" source="file:/dev/ttyS2" baudrate="38400" color="#0000ff"/>
Running under Cygwin
--------------------
@@ -189,17 +190,13 @@ 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)
- * 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>`_
+ * GTK+ toolkit for win32 from `Glade/GTK+ <http://sourceforge.net/project/showfiles.php?group_id=98754>`_ (select gtk+-win32-devel)
+ * MinGW from `MinGW <http://sourceforge.net/project/showfiles.php?group_id=2435>`_ (select Automated MinGW installer)
+ * MSYS from `MSYS Base System <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=2496>`_
+ * msysCORE from `MSYSCore Base System <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=24963>`_
+ * diffutils from `diffutils <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=24963>`_
+ * autoconf, autogen, automake, gettext and libtool from `MSYS Supplementary Tools <http://sourceforge.net/project/showfiles.php?group_id=2435&package_id=67879>`_
+ * libiconv from `MinGW's libiconv <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>`_
@@ -208,23 +205,23 @@ For speech support, one option is to use the "cmdline" speech type (refer to [[C
TroubleShooting
===============
-.. code-block::
+::
- /bin/m4: unrecognized option '--gnu'
+ /bin/m4: unrecognized option '--gnu'
Wrong version of m4, use 1.4.13
-.. code-block::
+::
- Can't locate object method "path" via package "Request (perhaps you forgot to load "Request"?)
+ Can't locate object method "path" via package "Request (perhaps you forgot to load "Request"?)
Wrong version of Autoconf, make sure the latest version is installed, plus the wrapper (version 1.7). Also delete autom4te.cache.
-.. code-block::
+::
- command PKG_MODULE_EXISTS not recognized
+ command PKG_MODULE_EXISTS not recognized
For some reason the necessary file "pkg.m4" containing various macros is missing. Find it and put it in ./m4
@@ -236,33 +233,39 @@ This is a quick walk-thru on compiling a win32 exe using Ubuntu as development m
Set up Ubuntu to build Linux version
------------------------------------
-First, setup compiling in linux ubuntu explained in https://navit.readthedocs.io/en/trunk/development/linux_development.html
+First, setup compiling in linux ubuntu explained in :doc:`/development/linux_development`
Here is a quick walk-thru:
Get all the dependencies for Ubuntu in one command:
.. code-block:: bash
- sudo apt-get install cmake zlib1g-dev libpng12-dev libgtk2.0-dev librsvg2-bin \
+ sudo apt-get install cmake zlib1g-dev libpng12-dev libgtk2.0-dev librsvg2-bin \
g++ gpsd gpsd-clients libgps-dev libdbus-glib-1-dev freeglut3-dev libxft-dev \
libglib2.0-dev libfreeimage-dev gettext
-get the latest SVN-source.
-First, cd into root: `cd ~`
+get the latest source from git. First, cd into root: `cd ~`
Now, let's grab the code from SVN. This assumes that you have subversion installed.
This will download the latest SVN source and put in in folder "navit-source".
You can use any location you want for the source, just to keep it simple we place it right in the root.
-`svn co svn://svn.code.sf.net/p/navit/code/trunk/navit/ navit-source`
+
+.. code-block:: bash
+
+ git clone git@github.com:navit-gps/navit.git navit-source
Create a directory to put the build in and cd into it:
.. code-block:: bash
- mkdir navit-build
- cd navit-build
+ mkdir navit-build
+ cd navit-build
+
+Start compiling and build navit:
-Start compiling and build navit: `cmake ~/navit-source && make`
+.. code-block:: bash
+
+ cmake ~/navit-source && make
At the end of the process navit is built into navit-build/.
You can start navit to see if all worked well:
@@ -277,38 +280,42 @@ Building the win32 exe
Now that we have set up the basic building environment we can build a win32 exe using the next walk-thru.
-Install ming32 and the dependencies: `sudo apt-get install mingw32 libsaxonb-java librsvg2-bin mingw32-binutils mingw32-runtime default-jdk`
+Install ming32 and the dependencies:
+
+.. code-block:: bash
+
+ sudo apt-get install mingw32 libsaxonb-java librsvg2-bin mingw32-binutils mingw32-runtime default-jdk
now cd into the source:
.. code-block:: bash
- cd ~
- cd navit-source
+ cd ~
+ cd navit-source
We are going to place the build directory within the source directory.
First, make the build directory and cd into it:
.. code-block:: bash
- mkdir build
- cd build
+ mkdir build
+ cd build
From within the build directory start compiling and building:
.. code-block:: bash
- cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain/mingw32.cmake ../
+ cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain/mingw32.cmake ../
And then make the actual build:
.. code-block:: bash
- make -j4
+ make -j4
The -j4 part is used to define the amount of processors the process can use.
-So if you have a dual-core pc use -j2
-If -j4 fails, try -j2 and if that fails try "make" alone.
+So if you have a dual-core pc use `-j2`
+If `-j4` fails, try `-j2` and if that fails try `make` alone.
Known "bugs"
------------
@@ -319,7 +326,11 @@ Cut and paste (or move) the "locale" folder to the navit folder.
This should be investigated anf fixed so the folder is in the correct place after a build.
So move `navit-source/build/locale/` to `navit-source/build/navit/locale`
-You can run `mv navit-source/build/locale/ navit-source/build/navit/`
+You can run
+
+.. code-block:: bash
+
+ mv navit-source/build/locale/ navit-source/build/navit/
The country-flags images in the "town" search are not displayed.
This could be due to a conversion error during build, has to be investigated and solved but doesn't inflict with the use of navit.
@@ -331,10 +342,9 @@ You can delete those without any problem.
Windows Mobile/Windows CE
=========================
-[[WinCE_development]] may have details that are relevant for compilation on WindowsCE / Windows Mobile.
+:doc:`/development/wince_development` may have details that are relevant for compilation on WindowsCE / Windows Mobile.
-You can download now
-[http://download.navit-project.org/navit/wince/svn/ cab or zip file for Windows Mobile and WindowsCE]!
+You can download now `cab or zip file for Windows Mobile and WindowsCE <http://download.navit-project.org/navit/wince/svn/>`_ !
Highest number is the newest version of NavIt.
Download it and save on your Storage Card. Install it.
@@ -347,13 +357,13 @@ This is a manual for self compiling (navit.exe)
You need to have a Linux (like Ubuntu).
If you didn´t have Linux, start your Linux on Live-CD.
-Compiling navit for wince using http://cegcc.sourceforge.net/.
+Compiling navit for wince using `<http://cegcc.sourceforge.net/>`_.
Download latest cegcc release and install it.
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).<br />
-Using the variant arm-mingw32ce of CeGCC 0.59.1 it was possible to build a working executable which can be debugged (see [[WinCE development]]).
+Using the variant arm-mingw32ce of CeGCC 0.59.1 it was possible to build a working executable which can be debugged (see :doc:`/development/wince_development`).
-Source [http://www.archlinux.de/?page=PackageDetails;package=4837 cegcc-arm and mingw] (TODO dead link)
+Source `cegcc-arm and mingw <http://www.archlinux.de/?page=PackageDetails;package=4837>`_ (TODO dead link)
Current installs in /opt/cegcc.
Setup a cross-compile environment:
@@ -362,16 +372,16 @@ Example setcegccenv.sh:
.. code-block:: bash
- #! /bin/bash
- export PATH=$PATH:/opt/cegcc/bin/
- export CEGCC_PATH=/opt/cegcc
- export WINCE_PATH=/opt/wince
- export PATH=$CEGCC_PATH/bin:$PATH
- export CPPFLAGS="-I$WINCE_PATH/include"
- export LDFLAGS="-L$WINCE_PATH/lib -L$CEGCC_PATH/lib"
- export LD_LIBRARY_PATH="$WINCE_PATH/bin"
- export PKG_CONFIG_PATH="$WINCE_PATH/lib/pkgconfig"
- export PKG_CONFIG_LIBDIR="$WINCE_PATH/lib/pkgconfig"
+ #! /bin/bash
+ export PATH=$PATH:/opt/cegcc/bin/
+ export CEGCC_PATH=/opt/cegcc
+ export WINCE_PATH=/opt/wince
+ export PATH=$CEGCC_PATH/bin:$PATH
+ export CPPFLAGS="-I$WINCE_PATH/include"
+ export LDFLAGS="-L$WINCE_PATH/lib -L$CEGCC_PATH/lib"
+ export LD_LIBRARY_PATH="$WINCE_PATH/bin"
+ export PKG_CONFIG_PATH="$WINCE_PATH/lib/pkgconfig"
+ export PKG_CONFIG_LIBDIR="$WINCE_PATH/lib/pkgconfig"
For installation, compiling and configuring please see manual for NavIt on Linux.
@@ -380,7 +390,7 @@ Then autogen.sh and configure navit. Example configure for wince:
.. code-block:: bash
- ./configure \
+ ./configure \
RANLIB=arm-cegcc-ranlib \
CXX=arm-cegcc-g++ \
CC=arm-cegcc-gcc \
@@ -416,7 +426,7 @@ If example did not run, do this:
.. code-block:: bash
- ./configure \
+ ./configure \
RANLIB=arm-mingw32ce-ranlib \
CXX=arm-mingw32ce-g++ \
CC=arm-mingw32ce-gcc \
@@ -462,26 +472,26 @@ For installation you need packages librapi, liprapi2, pyrapi2, libsync.
Package synce-0.9.0-1 contains librapi and libsync.
You do not need to install it again!
-Sources: [http://sourceforge.net/project/showfiles.php?group_id=30550 Sync] If link is crashed, use this: [http://rpmfind.net/linux/rpm2html/search.php?query=librapi.so.2 Sync Link2]
-libsync: [http://sourceforge.net/project/mirror_picker.php?height=350&width=300&group_id=30550&use_mirror=puzzle&filesize=&filename=libsynce-0.12.tar.gz&abmode= libsync]
-pyrapi2: [http://rpmfind.net/linux/rpm2html/search.php?query=pyrapi2.so pyrapi2]
-librapi2 [http://repository.slacky.eu/slackware-12.0/libraries/synce-librapi/0.11.0/src/ librapi2]
+Sources: `Sync <http://sourceforge.net/project/showfiles.php?group_id=30550>`_ If link is crashed, use this: `Sync Link2 <http://rpmfind.net/linux/rpm2html/search.php?query=librapi.so.2>`_
+libsync: `libsync <http://sourceforge.net/project/mirror_picker.php?height=350&width=300&group_id=30550&use_mirror=puzzle&filesize=&filename=libsynce-0.12.tar.gz&abmode=>`_
+pyrapi2: `pyrapi2 <http://rpmfind.net/linux/rpm2html/search.php?query=pyrapi2.so>`_
+librapi2 `librapi2 <http://repository.slacky.eu/slackware-12.0/libraries/synce-librapi/0.11.0/src/>`_
Once you have navit.exe ready, copy `/opt/cegcc/arm-cegcc/lib/device/*.dll` on your device.
For Debian use:
-.. code-block::
+.. code-block:: bash
- synce-pcp /opt/cegcc/arm-cegcc/lib/device/cegcc.dll ":/windows/cegcc.dll"
- synce-pcp /opt/cegcc/arm-cegcc/lib/device/cegccthrd.dll ":/windows/cegccthrd.dll"
+ synce-pcp /opt/cegcc/arm-cegcc/lib/device/cegcc.dll ":/windows/cegcc.dll"
+ synce-pcp /opt/cegcc/arm-cegcc/lib/device/cegccthrd.dll ":/windows/cegccthrd.dll"
All other Linux/Unix systems use:
-.. code-block::
+.. code-block:: bash
- pcp /opt/cegcc/arm-cegcc/lib/device/cegcc.dll ":/windows/cegcc.dll"
- pcp /opt/cegcc/arm-cegcc/lib/device/cegccthrd.dll ":/windows/cegccthrd.dll"
+ pcp /opt/cegcc/arm-cegcc/lib/device/cegcc.dll ":/windows/cegcc.dll"
+ pcp /opt/cegcc/arm-cegcc/lib/device/cegccthrd.dll ":/windows/cegccthrd.dll"
Synchronisation with a grahic surface, if connection to device failed:
@@ -502,15 +512,15 @@ Install navit.exe.
Debian:
-.. code-block::
+.. code-block:: bash
- synce-pcp navit.exe ":/Storage Card/navit.exe"
+ synce-pcp navit.exe ":/Storage Card/navit.exe"
All other:
-.. code-block::
+.. code-block:: bash
- pcp navit.exe ":/Storage Card/navit.exe"
+ pcp navit.exe ":/Storage Card/navit.exe"
Prepare a navit.xml.wince
@@ -521,17 +531,17 @@ Fix the paths to your maps "/Storage Card/binfilemap.bin"
Debian:
-.. code-block::
+.. code-block:: bash
- synce-pcp binfilemap.bin ":/Storage Card/binfilemap.bin"
- synce-pcp navit.xml.wince ":/Storage Card/navit.xml"
+ synce-pcp binfilemap.bin ":/Storage Card/binfilemap.bin"
+ synce-pcp navit.xml.wince ":/Storage Card/navit.xml"
All other:
-.. code-block::
+.. code-block:: bash
- pcp binfilemap.bin ":/Storage Card/binfilemap.bin"
- pcp navit.xml.wince ":/Storage Card/navit.xml"
+ pcp binfilemap.bin ":/Storage Card/binfilemap.bin"
+ pcp navit.xml.wince ":/Storage Card/navit.xml"
For a start best use the samplemap.
diff --git a/docs/index.rst b/docs/index.rst
index 16ef92f9d..80d7260a2 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.
@@ -21,14 +22,15 @@ Navit is highly customizable, from map layouts and on-screen display to the deta
.. image:: navit.png
.. toctree::
- :hidden:
- :glob:
- :numbered:
- :maxdepth: 2
- :caption: Navit's user manual
+ :hidden:
+ :glob:
+ :numbered:
+ :maxdepth: 2
+ :caption: Navit's user manual
- basic_configuration
- maps
+ basic_configuration
+ maps
+ configuration/index
.. Indices and tables
@@ -45,9 +47,11 @@ Navit is highly customizable, from map layouts and on-screen display to the deta
:glob:
:caption: Navit's developer documentation
+ development/changelog_wrapper
development/programming_guidelines
development/commit_guidelines
development/linux_development
+ development/android_development
development/macos_development
development/wince_development
development/windows_development
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/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/docs/requirements.txt b/docs/requirements.txt
new file mode 100644
index 000000000..142a838f8
--- /dev/null
+++ b/docs/requirements.txt
@@ -0,0 +1 @@
+m2r
diff --git a/navit/android.c b/navit/android.c
index f35cb274a..214e3171c 100644
--- a/navit/android.c
+++ b/navit/android.c
@@ -11,6 +11,7 @@
#include "callback.h"
#include "country.h"
#include "projection.h"
+#include "coord.h"
#include "map.h"
#include "mapset.h"
#include "navit_nls.h"
@@ -321,7 +322,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_navitproject_navit_NavitGraphics_getAllC
JNIEXPORT jstring JNICALL Java_org_navitproject_navit_NavitGraphics_getCoordForPoint( JNIEnv* env,
- jobject thiz, jint x, jint y, jboolean absolute_coord) {
+ jobject thiz, jint x, jint y, jboolean absoluteCoord) {
jstring return_string = NULL;
@@ -343,27 +344,28 @@ JNIEXPORT jstring JNICALL Java_org_navitproject_navit_NavitGraphics_getCoordForP
pc.pro = transform_get_projection(transform);
char coord_str[32];
- if (absolute_coord) {
+ if (absoluteCoord) {
pcoord_format_absolute(&pc, coord_str, sizeof(coord_str), ",");
} else {
pcoord_format_degree_short(&pc, coord_str, sizeof(coord_str), " ");
}
- dbg(lvl_error,"Display point x=%d y=%d is \"%s\"",x,y,coord_str);
+ dbg(lvl_debug,"Display point x=%d y=%d is \"%s\"",x,y,coord_str);
return_string = (*env)->NewStringUTF(env,coord_str);
return return_string;
}
-JNIEXPORT jint JNICALL Java_org_navitproject_navit_NavitGraphics_callbackMessageChannel( JNIEnv* env, jclass thiz,
- jint channel, jstring str) {
+
+JNIEXPORT jobject JNICALL Java_org_navitproject_navit_NavitCallbackHandler_callbackCmdChannel( JNIEnv* env,
+ jclass thiz, jint command) {
+
struct attr attr;
const char *s;
- jint ret = 0;
- dbg(lvl_debug,"enter %d %p",channel,str);
+ dbg(lvl_debug,"enter %d\n",command);
config_get_attr(config_get(), attr_navit, &attr, NULL);
- switch(channel) {
+ switch(command) {
case 1:
// zoom in
navit_zoom_in_cursor(attr.u.navit, 2);
@@ -374,6 +376,34 @@ JNIEXPORT jint JNICALL Java_org_navitproject_navit_NavitGraphics_callbackMessage
navit_zoom_out_cursor(attr.u.navit, 2);
navit_draw(attr.u.navit);
break;
+ case 3:
+ // block
+ navit_block(attr.u.navit, 1);
+ break;
+ case 4:
+ // unblock
+ navit_block(attr.u.navit, 0);
+ break;
+ case 5:
+ // cancel route
+ navit_set_destination(attr.u.navit, NULL, NULL, 0);
+ navit_draw(attr.u.navit);
+ break;
+ default:
+ dbg(lvl_error, "Unknown command: %d", command);
+ break;
+ }
+}
+
+JNIEXPORT jint JNICALL Java_org_navitproject_navit_NavitCallbackHandler_callbackMessageChannel( JNIEnv* env,
+ jclass thiz, jint channel, jstring str) {
+ struct attr attr;
+ const char *s;
+ jint ret = 0;
+ dbg(lvl_debug,"enter %d %p",channel,str);
+ config_get_attr(config_get(), attr_navit, &attr, NULL);
+
+ switch(channel) {
case 6: {// add a map to the current mapset, return 1 on success
struct mapset *ms = navit_get_mapset(attr.u.navit);
struct attr type, name, data, *attrs[4];
@@ -458,12 +488,13 @@ JNIEXPORT jint JNICALL Java_org_navitproject_navit_NavitGraphics_callbackMessage
pc.pro = transform_get_projection(transform);
char coord_str[32];
- //pcoord_format_short(&pc, coord_str, sizeof(coord_str), " ");
pcoord_format_degree_short(&pc, coord_str, sizeof(coord_str), " ");
+
dbg(lvl_debug,"Setting destination to %s",coord_str);
// start navigation asynchronous
navit_set_destination(attr.u.navit, &pc, coord_str, 1);
}
+ break;
case 3: {
// navigate to geo position
char *name;
@@ -478,14 +509,14 @@ JNIEXPORT jint JNICALL Java_org_navitproject_navit_NavitGraphics_callbackMessage
char *p;
char *stopstring;
- // lat
- p = strtok(parse_str, "#");
+ // latitude
+ p = strtok (parse_str,"#");
g.lat = strtof(p, &stopstring);
- // lon
- p = strtok(NULL, "#");
+ // longitude
+ p = strtok (NULL, "#");
g.lng = strtof(p, &stopstring);
- // description
- name = strtok(NULL, "#");
+ // description/name of the place identified by lat and long
+ name = strtok (NULL, "#");
dbg(lvl_debug, "lat=%f", g.lat);
dbg(lvl_debug, "lng=%f", g.lng);
@@ -499,14 +530,14 @@ JNIEXPORT jint JNICALL Java_org_navitproject_navit_NavitGraphics_callbackMessage
pc.y = c.y;
pc.pro = projection_mg;
char coord_str[32];
- if (!name || *name == '\0') {
+ if (!name || *name == '\0') { /* When name is an empty string, use the geo coord instead */
pcoord_format_degree_short(&pc, coord_str, sizeof(coord_str), " ");
name = coord_str;
}
// start navigation asynchronous
navit_set_destination(attr.u.navit, &pc, name, 1);
- break;
}
+ break;
default:
dbg(lvl_error, "Unknown command: %d", channel);
}
@@ -514,7 +545,6 @@ JNIEXPORT jint JNICALL Java_org_navitproject_navit_NavitGraphics_callbackMessage
return ret;
}
-
static char *postal_str(struct search_list_result *res, int level) {
char *ret=NULL;
if (res->town->common.postal)
@@ -680,35 +710,6 @@ static void android_search_idle(struct android_search_priv *search_priv) {
dbg(lvl_info, "leave");
}
-static char *search_fix_spaces(const char *str) {
- int i;
- int len=strlen(str);
- char c,*s,*d,*ret=g_strdup(str);
-
- for (i = 0 ; i < len ; i++) {
- if (ret[i] == ',' || ret[i] == '/')
- ret[i]=' ';
- }
- s=ret;
- d=ret;
- len=0;
- do {
- c=*s++;
- if (c != ' ' || len != 0) {
- *d++=c;
- len++;
- }
- while (c == ' ' && *s == ' ')
- s++;
- if (c == ' ' && *s == '\0') {
- d--;
- len--;
- }
- } while (c);
-
- return ret;
-}
-
static void start_search(struct android_search_priv *search_priv, const char *search_string) {
dbg(lvl_debug,"enter %s", search_string);
char *str=search_fix_spaces(search_string);
diff --git a/navit/android/AndroidManifest.xml b/navit/android/AndroidManifest.xml
index e8f153fd4..5978512ed 100644
--- a/navit/android/AndroidManifest.xml
+++ b/navit/android/AndroidManifest.xml
@@ -10,12 +10,17 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
- <application android:usesCleartextTraffic="true" android:label="@string/app_name"
+ <application
+ android:label="@string/app_name"
+ android:usesCleartextTraffic="true"
+ android:allowBackup="true"
+ android:fullBackupContent="@xml/navit_backup_rules"
android:icon="@drawable/icon"
- android:name=".NavitAppConfig"
- android:theme="@style/NavitTheme">
+ android:name=".NavitAppConfig">
<activity android:name="Navit"
android:label="@string/app_name"
+ android:theme="@style/NavitTheme"
+ android:launchMode="singleTask"
android:configChanges="screenLayout|smallestScreenSize|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|fontScale|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
@@ -23,6 +28,11 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
+ <action android:name="android.intent.action.VIEW"/>
+ <category android:name="android.intent.category.DEFAULT"/>
+ <data android:scheme="geo"/>
+ </intent-filter>
+ <intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="google.navigation" />
diff --git a/navit/android/build.gradle b/navit/android/build.gradle
index 6934afdfa..55455958a 100644
--- a/navit/android/build.gradle
+++ b/navit/android/build.gradle
@@ -3,12 +3,12 @@ apply from: "$project.rootDir/gradle/scripts/git-scm-version.gradle"
apply plugin: 'checkstyle'
android {
- compileSdkVersion 28
+ compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "org.navitproject.navit"
- minSdkVersion 9
- targetSdkVersion 28
+ minSdkVersion 10
+ targetSdkVersion 29
versionCode gitVersionCode
versionName gitVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -17,7 +17,7 @@ android {
}
externalNativeBuild {
cmake {
- arguments '-DUSE_PLUGINS=n', '-DBUILD_MAPTOOL=n', '-DXSL_PROCESSING=y', '-DXSLTS=android', '-DANDROID=y', '-DSAMPLE_MAP=n'
+ arguments '-DUSE_PLUGINS=n', '-DBUILD_MAPTOOL=n', '-DXSL_PROCESSING=n', '-DSAMPLE_MAP=n'
}
}
}
@@ -74,9 +74,10 @@ android {
applicationVariants.all { variant ->
// create tasks to generate Javadocs
task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) {
- classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
+ source = android.sourceSets.main.java.srcDirs
destinationDir = file("build/outputs/docs/javadoc/")
title = rootProject.name
+ options.memberLevel = JavadocMemberLevel.PACKAGE
verbose = true
failOnError false
}
diff --git a/navit/android/res/values-v19/styles.xml b/navit/android/res/values-v19/styles.xml
index 7e3277f09..1df022e4b 100644
--- a/navit/android/res/values-v19/styles.xml
+++ b/navit/android/res/values-v19/styles.xml
@@ -1,8 +1,5 @@
<resources>
<style name="NavitTheme" parent="android:Theme.DeviceDefault.NoActionBar">
-
<!-- API 19 theme customizations can go here. -->
- <item name="android:windowTranslucentNavigation">true</item>
- <item name="android:windowTranslucentStatus">true</item>
</style>
-</resources> \ No newline at end of file
+</resources>
diff --git a/navit/android/res/values-v21/styles.xml b/navit/android/res/values-v21/styles.xml
index 85cf81d9b..2f73c6fc0 100644
--- a/navit/android/res/values-v21/styles.xml
+++ b/navit/android/res/values-v21/styles.xml
@@ -1,21 +1,5 @@
<resources>
<style name="NavitTheme" parent="android:Theme.DeviceDefault.NoActionBar">
-
<!-- API 21 theme customizations can go here. -->
- <!--
- Don't use translucent system bars on API 21 as they are drawn with a semitransparent
- black background which can't be changed.
- -->
- <item name="android:windowTranslucentNavigation">false</item>
- <item name="android:windowTranslucentStatus">false</item>
-
- <!--
- We could set any semi-transparent color here (or change it in code), but this would not
- be available on API 19/20. Simply specifying full transparency allows us to implement a
- separate mechanism that will work on all versions.
- -->
- <item name="android:navigationBarColor">@android:color/transparent</item>
- <item name="android:statusBarColor">@android:color/transparent</item>
- <item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
-</resources> \ No newline at end of file
+</resources>
diff --git a/navit/android/res/values/strings.xml b/navit/android/res/values/strings.xml
index 44ed1483b..5ce99e52a 100644
--- a/navit/android/res/values/strings.xml
+++ b/navit/android/res/values/strings.xml
@@ -31,6 +31,7 @@
<string name="position_popup_title">Position</string>
<string name="position_popup_drive_here">Route to here</string>
<string name="position_popup_view">View</string>
+ <string name="use_position_with">Use position with</string>
<!-- MAP DOWNLOAD -->
<string name="map_delete">Delete this map?</string>
diff --git a/navit/android/res/xml/navit_backup_rules.xml b/navit/android/res/xml/navit_backup_rules.xml
new file mode 100644
index 000000000..1343fe2bc
--- /dev/null
+++ b/navit/android/res/xml/navit_backup_rules.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<full-backup-content>
+ <include domain="external" path="bookmark.txt"/>
+</full-backup-content>
diff --git a/navit/android/src/org/navitproject/navit/Navit.java b/navit/android/src/org/navitproject/navit/Navit.java
index 78ddff901..bacc15213 100644
--- a/navit/android/src/org/navitproject/navit/Navit.java
+++ b/navit/android/src/org/navitproject/navit/Navit.java
@@ -38,6 +38,7 @@ import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.AssetManager;
import android.content.res.Configuration;
+import android.graphics.Color;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Build;
@@ -45,7 +46,6 @@ import android.os.Bundle;
import android.os.Environment;
import android.os.Message;
import android.os.PowerManager;
-import android.support.annotation.RequiresApi;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.NotificationCompat;
import android.support.v4.content.ContextCompat;
@@ -71,14 +71,10 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
-
public class Navit extends Activity {
- public static DisplayMetrics sMetrics;
public static boolean sShowSoftKeyboardShowing;
- private static Intent sStartupIntent;
- private static long sStartupIntentTimestamp;
private static final int MY_PERMISSIONS_REQ_FINE_LOC = 103;
private static final int NavitDownloaderSelectMap_id = 967;
private static final int NavitAddressSearch_id = 70;
@@ -86,7 +82,6 @@ public class Navit extends Activity {
private static final String NAVIT_PACKAGE_NAME = "org.navitproject.navit";
private static final String TAG = "Navit";
static String sMapFilenamePath;
- static String sNavitDataDir;
boolean mIsFullscreen;
private NavitDialogs mDialogs;
private PowerManager.WakeLock mWakeLock;
@@ -214,6 +209,9 @@ public class Navit extends Activity {
return true;
}
+ /**
+ * Show the first start infobox (presentation of navit and link website for more info).
+ **/
private void showInfos() {
SharedPreferences settings = getSharedPreferences(NavitAppConfig.NAVIT_PREFS, MODE_PRIVATE);
boolean firstStart = settings.getBoolean("firstStart", true);
@@ -260,22 +258,16 @@ public class Navit extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
+ Log.d(TAG, "onCreate");
super.onCreate(savedInstanceState);
windowSetup();
mDialogs = new NavitDialogs(this);
- // only take arguments here, onResume gets called all the time (e.g. when screenblanks, etc.)
- Navit.sStartupIntent = this.getIntent();
- // hack! Remember time stamps, and only allow 4 secs. later in onResume to set target!
- Navit.sStartupIntentTimestamp = System.currentTimeMillis();
- Log.d(TAG, "**1**A " + sStartupIntent.getAction());
- Log.d(TAG, "**1**D " + sStartupIntent.getDataString());
-
createNotificationChannel();
buildNotification();
verifyPermissions();
- // get the local language -------------
+ // get the local language
Locale locale = Locale.getDefault();
String lang = locale.getLanguage();
String langc = lang;
@@ -295,33 +287,34 @@ public class Navit extends Activity {
Log.d(TAG, "Language " + lang);
SharedPreferences prefs = getSharedPreferences(NavitAppConfig.NAVIT_PREFS,MODE_PRIVATE);
- sNavitDataDir = getApplicationContext().getFilesDir().getPath();
- sMapFilenamePath = prefs.getString("filenamePath", sNavitDataDir + '/');
- Log.i(TAG,"NavitDataDir = " + sNavitDataDir);
+ String navitDataDir = getApplicationContext().getFilesDir().getPath();
+ String candidateFileNamePath = getApplicationContext().getExternalFilesDir(null).toString();
+ sMapFilenamePath = prefs.getString("filenamePath", candidateFileNamePath + '/');
+ Log.i(TAG,"NavitDataDir = " + navitDataDir);
Log.i(TAG,"mapFilenamePath = " + sMapFilenamePath);
// make sure the new path for the navitmap.bin file(s) exist!!
File navitMapsDir = new File(sMapFilenamePath);
navitMapsDir.mkdirs();
// make sure the share dir exists
- File navitDataShareDir = new File(sNavitDataDir + "/share");
+ File navitDataShareDir = new File(navitDataDir + "/share");
navitDataShareDir.mkdirs();
Display display = getWindowManager().getDefaultDisplay();
- sMetrics = new DisplayMetrics();
- display.getMetrics(sMetrics);
- int densityDpi = (int)((sMetrics.density * 160) - .5f);
+ DisplayMetrics metrics = new DisplayMetrics();
+ display.getMetrics(metrics);
+ int densityDpi = (int)((metrics.density * 160) - .5f);
Log.d(TAG, "-> pixels x=" + display.getWidth() + " pixels y=" + display.getHeight());
Log.d(TAG, "-> dpi=" + densityDpi);
- Log.d(TAG, "-> density=" + sMetrics.density);
- Log.d(TAG, "-> scaledDensity=" + sMetrics.scaledDensity);
+ Log.d(TAG, "-> density=" + metrics.density);
+ Log.d(TAG, "-> scaledDensity=" + metrics.scaledDensity);
mActivityResults = new NavitActivityResult[16];
setVolumeControlStream(AudioManager.STREAM_MUSIC);
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE,"navit:DoNotDimScreen");
- if (!extractRes(langc, sNavitDataDir + "/locale/" + langc + "/LC_MESSAGES/navit.mo")) {
+ if (!extractRes(langc, navitDataDir + "/locale/" + langc + "/LC_MESSAGES/navit.mo")) {
Log.e(TAG, "Failed to extract language resource " + langc);
}
@@ -350,7 +343,7 @@ public class Navit extends Activity {
String[] children = assetMgr.list("config/" + myDisplayDensity);
for (String child : children) {
Log.d(TAG, "Processing config file '" + child + "' from assets");
- if (!extractAsset("config/" + myDisplayDensity + "/" + child, sNavitDataDir + "/share/" + child)) {
+ if (!extractAsset("config/" + myDisplayDensity + "/" + child, navitDataDir + "/share/" + child)) {
Log.e(TAG, "Failed to extract asset config/" + myDisplayDensity + "/" + child);
}
}
@@ -358,8 +351,26 @@ public class Navit extends Activity {
Log.e(TAG, "Failed to access assets using AssetManager");
}
Log.d(TAG, "android.os.Build.VERSION.SDK_INT=" + Integer.valueOf(Build.VERSION.SDK));
- navitMain(navitLanguage, sNavitDataDir + "/bin/navit", sMapFilenamePath);
+ navitMain(navitLanguage, navitDataDir + "/bin/navit", sMapFilenamePath);
showInfos();
+
+ Intent startupIntent = new Intent(this.getIntent());
+ Log.d(TAG, "onCreate intent " + startupIntent.toString());
+ handleIntent(startupIntent);
+ }
+
+ private void handleIntent(Intent intent) {
+ String naviScheme = intent.getScheme();
+ if (naviScheme != null) {
+ Log.d(TAG, "Using intent " + intent.toString());
+ if (naviScheme.equals("google.navigation")) {
+ parseNavigationURI(intent.getData().getSchemeSpecificPart());
+ } else if (naviScheme.equals("geo")
+ && intent.getAction().equals("android.intent.action.VIEW")) {
+ invokeCallbackOnGeo(intent.getData().getSchemeSpecificPart(),
+ NavitCallbackHandler.MsgType.CLB_SET_DESTINATION, "");
+ }
+ }
}
private void windowSetup() {
@@ -370,6 +381,19 @@ public class Navit extends Activity {
this.getActionBar().hide();
}
}
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ getWindow().getDecorView().setSystemUiVisibility(
+ View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
+ getWindow().setStatusBarColor(Color.TRANSPARENT);
+ getWindow().setNavigationBarColor(Color.TRANSPARENT);
+ } else {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
+ }
+ }
}
/* uses NAVIT_PACKAGE_NAME as id */
@@ -403,47 +427,31 @@ public class Navit extends Activity {
public void onRestart() {
super.onRestart();
- Log.d(TAG, "OnRestart");
+ Log.d(TAG, "onRestart");
}
public void onStart() {
super.onStart();
- Log.d(TAG, "OnStart");
+ Log.d(TAG, "onStart");
+ }
+
+ @Override
+ public void onNewIntent(Intent intent) {
+ Log.d(TAG, "onNewIntent");
+ handleIntent(intent);
}
@Override
public void onResume() {
super.onResume();
- Log.d(TAG, "OnResume");
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
- /* Required to make system bars fully transparent */
- getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
- | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
- | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
- }
- //InputMethodManager sInputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
- // DEBUG
- // intent_data = "google.navigation:q=Wien Burggasse 27";
- // intent_data = "google.navigation:q=48.25676,16.643";
- // intent_data = "google.navigation:ll=48.25676,16.643&q=blabla-strasse";
- // intent_data = "google.navigation:ll=48.25676,16.643";
- if (sStartupIntent != null) {
- if (System.currentTimeMillis() <= Navit.sStartupIntentTimestamp + 4000L) {
- Log.d(TAG, "**2**A " + sStartupIntent.getAction());
- Log.d(TAG, "**2**D " + sStartupIntent.getDataString());
- String naviScheme = sStartupIntent.getScheme();
- if (naviScheme != null && naviScheme.equals("google.navigation")) {
- parseNavigationURI(sStartupIntent.getData().getSchemeSpecificPart());
- }
- } else {
- Log.e(TAG, "timestamp for navigate_to expired! not using data");
- }
- }
+ NavitCallbackHandler.sendCommand(NavitCallbackHandler.CmdType.CMD_UNBLOCK);
+ Log.d(TAG, "onResume");
}
@Override
public void onPause() {
super.onPause();
+ NavitCallbackHandler.sendCommand(NavitCallbackHandler.CmdType.CMD_BLOCK);
Log.d(TAG, "onPause");
}
@@ -468,6 +476,42 @@ public class Navit extends Activity {
}
}
+ /**
+ * Invoke CallbackHandler on a geographical position.
+ *
+ * @param geoString A string containing the target geographical position with a format like "48.25676,16.643"
+ * @param msgType The type of message to send
+ * @param name The name/label to associate to the geographical position
+ **/
+ private void invokeCallbackOnGeo(String geoString, NavitCallbackHandler.MsgType msgType, String name) {
+ String[] geo = geoString.split(",");
+ if (geo.length == 2) {
+ try {
+ Bundle b = new Bundle();
+ float lat = Float.parseFloat(geo[0]);
+ float lon = Float.parseFloat(geo[1]);
+ b.putFloat("lat", lat);
+ b.putFloat("lon", lon);
+ b.putString("q", name);
+ Message msg = Message.obtain(NavitCallbackHandler.sCallbackHandler,
+ msgType.ordinal());
+
+ msg.setData(b);
+ msg.sendToTarget();
+ Log.d(TAG, "target found (b): " + geoString);
+ } catch (NumberFormatException e) {
+ Log.e(TAG,"numberFormatException");
+ }
+ } else {
+ Log.w(TAG, "Ignoring invalid geo string: " + geoString);
+ }
+ }
+
+ /**
+ * Parse google navigation URIs (usually starting with "google.navigation:") and take the appropriate actions.
+ *
+ * @param schemeSpecificPart A string containing the URI scheme, for example "ll=48.25676,16.643&q=blabla-strasse"
+ **/
private void parseNavigationURI(String schemeSpecificPart) {
String[] naviData = schemeSpecificPart.split("&");
Pattern p = Pattern.compile("(.*)=(.*)");
@@ -484,39 +528,17 @@ public class Navit extends Activity {
// c: google.navigation:ll=48.25676,16.643
// b: google.navigation:q=48.25676,16.643
- float lat;
- float lon;
- Bundle b = new Bundle();
-
String geoString = params.get("ll");
+ String address = null;
if (geoString != null) {
- String address = params.get("q");
- if (address != null) {
- b.putString("q", address);
- }
+ address = params.get("q");
} else {
geoString = params.get("q");
}
if (geoString != null) {
if (geoString.matches("^[+-]{0,1}\\d+(|\\.\\d*),[+-]{0,1}\\d+(|\\.\\d*)$")) {
- String[] geo = geoString.split(",");
- if (geo.length == 2) {
- try {
- lat = Float.valueOf(geo[0]);
- lon = Float.valueOf(geo[1]);
- b.putFloat("lat", lat);
- b.putFloat("lon", lon);
- Message msg = Message.obtain(NavitGraphics.sCallbackHandler,
- NavitGraphics.MsgType.CLB_SET_DESTINATION.ordinal());
-
- msg.setData(b);
- msg.sendToTarget();
- Log.i(TAG, "target found (b): " + geoString);
- } catch (NumberFormatException e) {
- e.printStackTrace();
- }
- }
+ invokeCallbackOnGeo(geoString, NavitCallbackHandler.MsgType.CLB_SET_DESTINATION, address);
} else {
start_targetsearch_from_intent(geoString);
}
@@ -571,15 +593,13 @@ public class Navit extends Activity {
switch (id) {
case 1 :
// zoom in
- Message.obtain(NavitGraphics.sCallbackHandler,
- NavitGraphics.MsgType.CLB_ZOOM_IN.ordinal()).sendToTarget();
+ NavitCallbackHandler.sendCommand(NavitCallbackHandler.CmdType.CMD_ZOOM_IN);
// if we zoom, hide the bubble
Log.d(TAG, "onOptionsItemSelected -> zoom in");
break;
case 2 :
// zoom out
- Message.obtain(NavitGraphics.sCallbackHandler,
- NavitGraphics.MsgType.CLB_ZOOM_OUT.ordinal()).sendToTarget();
+ NavitCallbackHandler.sendCommand(NavitCallbackHandler.CmdType.CMD_ZOOM_OUT);
// if we zoom, hide the bubble
Log.d(TAG, "onOptionsItemSelected -> zoom out");
break;
@@ -590,21 +610,22 @@ public class Navit extends Activity {
break;
case 5 :
// toggle the normal POI layers and labels (to avoid double POIs)
- Message msg = Message.obtain(NavitGraphics.sCallbackHandler,
- NavitGraphics.MsgType.CLB_CALL_CMD.ordinal());
+ Message msg = Message.obtain(NavitCallbackHandler.sCallbackHandler,
+ NavitCallbackHandler.MsgType.CLB_CALL_CMD.ordinal());
Bundle b = new Bundle();
b.putString("cmd", "toggle_layer(\"POI Symbols\");");
msg.setData(b);
msg.sendToTarget();
-
- msg = Message.obtain(NavitGraphics.sCallbackHandler, NavitGraphics.MsgType.CLB_CALL_CMD.ordinal());
+ msg = Message.obtain(NavitCallbackHandler.sCallbackHandler,
+ NavitCallbackHandler.MsgType.CLB_CALL_CMD.ordinal());
b = new Bundle();
b.putString("cmd", "toggle_layer(\"POI Labels\");");
msg.setData(b);
msg.sendToTarget();
// toggle full POI icons on/off
- msg = Message.obtain(NavitGraphics.sCallbackHandler, NavitGraphics.MsgType.CLB_CALL_CMD.ordinal());
+ msg = Message.obtain(NavitCallbackHandler.sCallbackHandler,
+ NavitCallbackHandler.MsgType.CLB_CALL_CMD.ordinal());
b = new Bundle();
b.putString("cmd", "toggle_layer(\"Android-POI-Icons-full\");");
msg.setData(b);
@@ -640,6 +661,7 @@ public class Navit extends Activity {
* <p>Calling this method has the same effect as pressing the hardware Menu button, or touching
* the overflow button in the Action bar.</p>
*/
+ @SuppressWarnings("unused")
void showMenu() {
openOptionsMenu();
}
@@ -650,11 +672,13 @@ public class Navit extends Activity {
*
* @return 1 if keyboard is software, 0 if hardware
*/
+ @SuppressWarnings("unused")
int showNativeKeyboard() {
Log.d(TAG, "showNativeKeyboard");
Configuration config = getResources().getConfiguration();
if ((config.keyboard == Configuration.KEYBOARD_QWERTY)
- && (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO)) {
+ && (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO)
+ && (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P)) {
/* physical keyboard present */
return 0;
}
@@ -663,7 +687,6 @@ public class Navit extends Activity {
((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE))
.showSoftInput(getCurrentFocus(), InputMethodManager.SHOW_FORCED);
sShowSoftKeyboardShowing = true;
-
return 1;
}
@@ -671,6 +694,7 @@ public class Navit extends Activity {
/**
* Hides the native keyboard or other input method.
*/
+ @SuppressWarnings("unused")
void hideNativeKeyboard() {
((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE))
.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
@@ -678,20 +702,6 @@ public class Navit extends Activity {
}
- void setDestination(float latitude, float longitude, String address) {
- Toast.makeText(getApplicationContext(), getTstring(R.string.address_search_set_destination) + "\n"
- + address, Toast.LENGTH_LONG).show(); //TRANS
-
- Bundle b = new Bundle();
- b.putFloat("lat", latitude);
- b.putFloat("lon", longitude);
- b.putString("q", address);
- Message msg = Message.obtain(NavitGraphics.sCallbackHandler,
- NavitGraphics.MsgType.CLB_SET_DESTINATION.ordinal());
- msg.setData(b);
- msg.sendToTarget();
- }
-
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
case Navit.NavitDownloaderSelectMap_id :
@@ -708,8 +718,8 @@ public class Navit extends Activity {
getTstring(R.string.address_search_set_destination) + "\n" + destination.getString(("q")),
Toast.LENGTH_LONG).show(); //TRANS
- Message msg = Message.obtain(NavitGraphics.sCallbackHandler,
- NavitGraphics.MsgType.CLB_SET_DESTINATION.ordinal());
+ Message msg = Message.obtain(NavitCallbackHandler.sCallbackHandler,
+ NavitCallbackHandler.MsgType.CLB_SET_DESTINATION.ordinal());
msg.setData(destination);
msg.sendToTarget();
}
@@ -772,7 +782,7 @@ public class Navit extends Activity {
@Override
public void onDestroy() {
super.onDestroy();
- Log.d(TAG, "OnDestroy");
+ Log.d(TAG, "onDestroy");
NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
notificationManager.cancelAll();
NavitVehicle.removeListeners(this);
@@ -782,34 +792,27 @@ public class Navit extends Activity {
public void onStop() {
super.onStop();
- Log.d(TAG, "OnStop");
+ Log.d(TAG, "onStop");
}
- @RequiresApi(api = Build.VERSION_CODES.ICE_CREAM_SANDWICH)
+ @SuppressWarnings("unused")
void fullscreen(int fullscreen) {
-
- View decorView = getWindow().getDecorView();
-
- mIsFullscreen = (fullscreen != 0);
- if (mIsFullscreen) {
- getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ return;
+ }
+ if (fullscreen != 0) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
- int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
- decorView.setSystemUiVisibility(uiOptions);
- }
-
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
} else {
- getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
- decorView.setSystemUiVisibility(0);
- }
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
}
- public void disableSuspend() {
+
+ @SuppressWarnings("unused")
+ void disableSuspend() {
mWakeLock.acquire();
mWakeLock.release();
}
diff --git a/navit/android/src/org/navitproject/navit/NavitAddressSearchActivity.java b/navit/android/src/org/navitproject/navit/NavitAddressSearchActivity.java
index 3c0c489d1..9e851f2b1 100644
--- a/navit/android/src/org/navitproject/navit/NavitAddressSearchActivity.java
+++ b/navit/android/src/org/navitproject/navit/NavitAddressSearchActivity.java
@@ -85,8 +85,6 @@ public class NavitAddressSearchActivity extends Activity {
private int mSearchResultsStreets = 0;
private int mSearchResultsStreetsHn = 0;
private long mSearchHandle = 0;
-
- // TODO remember settings
private static String sLastAddressSearchString = "";
private static Boolean sLastAddressPartialMatch = false;
private static String sLastCountry = "";
@@ -107,10 +105,9 @@ public class NavitAddressSearchActivity extends Activity {
// We have all images stored as drawable_nodpi resources which allows native code to manipulate them
// without interference with android builtin choosing and scaling system. But that makes us to
// reinvent the wheel here to show an image in android native interface.
- int[] flagIconSizes = {24,32,48,64,96};
- int exactSize;
+ int[] flagIconSizes = {24, 32, 64, 96};
int nearestSize;
- exactSize = (int)(Navit.sMetrics.density * 24.0 - .5);
+ int exactSize = (int)(getResources().getDisplayMetrics().density * 24 - 0.5);
nearestSize = flagIconSizes[0];
for (int size: flagIconSizes) {
nearestSize = size;
@@ -158,7 +155,6 @@ public class NavitAddressSearchActivity extends Activity {
}
mCountryButton = new ImageButton(this);
-
setCountryButtonImage();
mCountryButton.setOnClickListener(new OnClickListener() {
diff --git a/navit/android/src/org/navitproject/navit/NavitBackupTask.java b/navit/android/src/org/navitproject/navit/NavitBackupTask.java
index 567acb137..cc81072d9 100644
--- a/navit/android/src/org/navitproject/navit/NavitBackupTask.java
+++ b/navit/android/src/org/navitproject/navit/NavitBackupTask.java
@@ -16,11 +16,11 @@ import java.io.ObjectOutputStream;
public class NavitBackupTask extends AsyncTask<Void, Void, String> {
- private Navit mActivity;
+ private final Navit mActivity;
private ProgressDialog mDialog;
- public NavitBackupTask(Navit context) {
+ NavitBackupTask(Navit context) {
mActivity = context;
}
@@ -80,11 +80,11 @@ public class NavitBackupTask extends AsyncTask<Void, Void, String> {
ObjectOutputStream preferencesOOs = null;
try {
/* Backup Files in home */
- NavitUtils.copyFileIfExists(Navit.sNavitDataDir + "/home/bookmark.txt",
+ NavitUtils.copyFileIfExists(Navit.sMapFilenamePath + "/home/bookmark.txt",
backupDir.getPath() + "/bookmark.txt");
- NavitUtils.copyFileIfExists(Navit.sNavitDataDir + "/home/destination.txt",
+ NavitUtils.copyFileIfExists(Navit.sMapFilenamePath + "/home/destination.txt",
backupDir.getPath() + "/destination.txt");
- NavitUtils.copyFileIfExists(Navit.sNavitDataDir + "/home/gui_internal.txt",
+ NavitUtils.copyFileIfExists(Navit.sMapFilenamePath + "/home/gui_internal.txt",
backupDir.getPath() + "/gui_internal.txt");
/* Backup Shared Preferences */
diff --git a/navit/android/src/org/navitproject/navit/NavitCallbackHandler.java b/navit/android/src/org/navitproject/navit/NavitCallbackHandler.java
new file mode 100644
index 000000000..c3a3b3230
--- /dev/null
+++ b/navit/android/src/org/navitproject/navit/NavitCallbackHandler.java
@@ -0,0 +1,84 @@
+package org.navitproject.navit;
+
+import android.os.Handler;
+import android.os.Message;
+import android.util.Log;
+
+class NavitCallbackHandler {
+
+
+ private static final String TAG = "CallbackHandler";
+ private static final MsgType[] msg_values = MsgType.values();
+
+ static final Handler sCallbackHandler = new CallBackHandler();
+
+ private static native int callbackMessageChannel(int channel, String s);
+
+ private static native int callbackCmdChannel(int commandd);
+
+ enum CmdType { CMD_ZOOM_IN, CMD_ZOOM_OUT, CMD_BLOCK, CMD_UNBLOCK, CMD_CANCEL_ROUTE }
+
+ static void sendCommand(CmdType command) {
+ switch (command) {
+ case CMD_ZOOM_IN:
+ callbackCmdChannel(1);
+ break;
+ case CMD_ZOOM_OUT:
+ callbackCmdChannel(2);
+ break;
+ case CMD_BLOCK:
+ callbackCmdChannel(3);
+ break;
+ case CMD_UNBLOCK:
+ callbackCmdChannel(4);
+ break;
+ case CMD_CANCEL_ROUTE:
+ callbackCmdChannel(5);
+ break;
+ default:
+ Log.e(TAG, "Unhandled command : " + command);
+ }
+ }
+
+
+ enum MsgType {
+ CLB_SET_DESTINATION, CLB_SET_DISPLAY_DESTINATION, CLB_CALL_CMD, CLB_LOAD_MAP, CLB_UNLOAD_MAP,
+ CLB_DELETE_MAP
+ }
+
+
+ static class CallBackHandler extends Handler {
+ public void handleMessage(Message msg) {
+ switch (msg_values[msg.what]) {
+ case CLB_SET_DESTINATION:
+ String lat = Float.toString(msg.getData().getFloat("lat"));
+ String lon = Float.toString(msg.getData().getFloat("lon"));
+ String q = msg.getData().getString(("q"));
+ callbackMessageChannel(3, lat + "#" + lon + "#" + q);
+ break;
+ case CLB_SET_DISPLAY_DESTINATION:
+ int x = msg.arg1;
+ int y = msg.arg2;
+ callbackMessageChannel(4, "" + x + "#" + y);
+ break;
+ case CLB_CALL_CMD:
+ String cmd = msg.getData().getString(("cmd"));
+ callbackMessageChannel(5, cmd);
+ break;
+ case CLB_LOAD_MAP:
+ callbackMessageChannel(6, msg.getData().getString(("title")));
+ break;
+ case CLB_DELETE_MAP:
+ //unload map before deleting it !!!
+ callbackMessageChannel(7, msg.getData().getString(("title")));
+ NavitUtils.removeFileIfExists(msg.getData().getString(("title")));
+ break;
+ case CLB_UNLOAD_MAP:
+ callbackMessageChannel(7, msg.getData().getString(("title")));
+ break;
+ default:
+ Log.d(TAG, "Unhandled callback : " + msg_values[msg.what]);
+ }
+ }
+ }
+}
diff --git a/navit/android/src/org/navitproject/navit/NavitCamera.java b/navit/android/src/org/navitproject/navit/NavitCamera.java
index 1df26081a..42076404d 100644
--- a/navit/android/src/org/navitproject/navit/NavitCamera.java
+++ b/navit/android/src/org/navitproject/navit/NavitCamera.java
@@ -52,19 +52,16 @@ class NavitCamera extends SurfaceView implements SurfaceHolder.Callback {
* <p>acquire the camera and tell it where to draw.</p>
*/
public void surfaceCreated(SurfaceHolder holder) {
- if (mCamera != null) {
- try {
- mCamera = Camera.open();
- mCamera.setPreviewDisplay(holder);
- } catch (IOException exception) {
- mCamera.release();
- mCamera = null;
- Log.e(TAG, "IOException");
- }
- Log.i(TAG, "surfaceCreated");
- } else {
- Log.e(TAG, "null camera");
+ try {
+ mCamera = Camera.open();
+ mCamera.setPreviewDisplay(holder);
+ } catch (IOException exception) {
+ mCamera.release();
+ mCamera = null;
+ Log.e(TAG, "IOException");
}
+ Log.i(TAG, "surfaceCreated");
+
}
@@ -74,9 +71,11 @@ class NavitCamera extends SurfaceView implements SurfaceHolder.Callback {
* <p>stop the preview and release the camera.</p>
*/
public void surfaceDestroyed(SurfaceHolder holder) {
- mCamera.stopPreview();
- mCamera = null;
- Log.e(TAG,"surfaceDestroyed");
+ if (mCamera != null) {
+ mCamera.stopPreview();
+ mCamera = null;
+ Log.e(TAG, "surfaceDestroyed");
+ }
}
@@ -87,11 +86,13 @@ class NavitCamera extends SurfaceView implements SurfaceHolder.Callback {
*/
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
Log.e(TAG,"surfaceChanged " + w + "x " + h);
- mCamera.stopPreview();
- Camera.Parameters parameters = mCamera.getParameters();
- parameters.setPreviewSize(w, h);
- mCamera.setParameters(parameters);
- mCamera.startPreview();
+ if (mCamera != null) {
+ mCamera.stopPreview();
+ Camera.Parameters parameters = mCamera.getParameters();
+ parameters.setPreviewSize(w, h);
+ mCamera.setParameters(parameters);
+ mCamera.startPreview();
+ }
}
}
diff --git a/navit/android/src/org/navitproject/navit/NavitDialogs.java b/navit/android/src/org/navitproject/navit/NavitDialogs.java
index 8a9d6de65..4c506d70c 100644
--- a/navit/android/src/org/navitproject/navit/NavitDialogs.java
+++ b/navit/android/src/org/navitproject/navit/NavitDialogs.java
@@ -64,14 +64,14 @@ public class NavitDialogs extends Handler {
mActivity.dismissDialog(DIALOG_MAPDOWNLOAD);
mActivity.removeDialog(DIALOG_MAPDOWNLOAD);
if (msg.getData().getInt("value1") == 1) {
- Message msgOut = Message.obtain(NavitGraphics.sCallbackHandler,
- NavitGraphics.MsgType.CLB_LOAD_MAP.ordinal());
+ Message msgOut = Message.obtain(NavitCallbackHandler.sCallbackHandler,
+ NavitCallbackHandler.MsgType.CLB_LOAD_MAP.ordinal());
msgOut.setData(msg.getData());
msgOut.sendToTarget();
msgOut = Message
- .obtain(NavitGraphics.sCallbackHandler,
- NavitGraphics.MsgType.CLB_CALL_CMD.ordinal());
+ .obtain(NavitCallbackHandler.sCallbackHandler,
+ NavitCallbackHandler.MsgType.CLB_CALL_CMD.ordinal());
Bundle b = new Bundle();
int mi = msg.getData().getInt("value2");
double lon = (Double.parseDouble(NavitMapDownloader.osm_maps[mi].mLon1) + Double
diff --git a/navit/android/src/org/navitproject/navit/NavitDownloadSelectMapActivity.java b/navit/android/src/org/navitproject/navit/NavitDownloadSelectMapActivity.java
index 8f816df60..4ee521c8c 100644
--- a/navit/android/src/org/navitproject/navit/NavitDownloadSelectMapActivity.java
+++ b/navit/android/src/org/navitproject/navit/NavitDownloadSelectMapActivity.java
@@ -29,7 +29,6 @@ import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.Message;
-import android.os.StatFs;
import android.support.v4.app.ActivityCompat;
import android.util.Log;
import android.view.View;
@@ -60,7 +59,7 @@ public class NavitDownloadSelectMapActivity extends ExpandableListActivity {
updateMapsForLocation();
setListAdapter(sAdapter);
try {
- setTitle(getFreeSpace() / 1024 / 1024 + "MB available");
+ setTitle(NavitUtils.getFreeSpace(Navit.sMapFilenamePath) / 1024 / 1024 + "MB available");
} catch (Exception e) {
Log.e(TAG, "Exception " + e.getClass().getName()
+ " during getFreeSpace, reporting 'no sdcard present'");
@@ -73,10 +72,6 @@ public class NavitDownloadSelectMapActivity extends ExpandableListActivity {
}
}
- private long getFreeSpace() {
- StatFs fsInfo = new StatFs(Navit.sMapFilenamePath);
- return (long) fsInfo.getAvailableBlocks() * fsInfo.getBlockSize();
- }
private void updateDownloadedMaps() {
sDownloadedMapsChilds.clear();
@@ -234,8 +229,8 @@ public class NavitDownloadSelectMapActivity extends ExpandableListActivity {
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
Log.d(TAG, "Delete Map");
- Message msg = Message.obtain(NavitGraphics.sCallbackHandler,
- NavitGraphics.MsgType.CLB_DELETE_MAP.ordinal());
+ Message msg = Message.obtain(NavitCallbackHandler.sCallbackHandler,
+ NavitCallbackHandler.MsgType.CLB_DELETE_MAP.ordinal());
Bundle b = new Bundle();
b.putString("title", mapLocation);
msg.setData(b);
diff --git a/navit/android/src/org/navitproject/navit/NavitGraphics.java b/navit/android/src/org/navitproject/navit/NavitGraphics.java
index e67adc8be..02624fa00 100644
--- a/navit/android/src/org/navitproject/navit/NavitGraphics.java
+++ b/navit/android/src/org/navitproject/navit/NavitGraphics.java
@@ -19,14 +19,11 @@
package org.navitproject.navit;
-import static org.navitproject.navit.NavitAppConfig.getTstring;
-
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
-import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -39,7 +36,6 @@ import android.graphics.PointF;
import android.graphics.Rect;
import android.net.Uri;
import android.os.Build;
-import android.os.Handler;
import android.os.Message;
import android.support.annotation.RequiresApi;
import android.support.v4.view.ViewConfigurationCompat;
@@ -65,23 +61,22 @@ import java.util.List;
class NavitGraphics {
private static final String TAG = "NavitGraphics";
private static final long TIME_FOR_LONG_PRESS = 300L;
+ private static boolean sInMap;
private final NavitGraphics mParentGraphics;
- private final ArrayList<NavitGraphics> mOverlays = new ArrayList<>();
+ private final ArrayList<NavitGraphics> mOverlays;
private int mBitmapWidth;
private int mBitmapHeight;
private int mPosX;
private int mPosY;
private int mPosWraparound;
private int mOverlayDisabled;
- private int mBgColor;
private float mTrackballX;
private float mTrackballY;
private int mPaddingLeft;
private int mPaddingRight;
private int mPaddingTop;
private int mPaddingBottom;
- private View mView;
- static final Handler sCallbackHandler = new CallBackHandler();
+ private NavitView mView;
private SystemBarTintView mLeftTintView;
private SystemBarTintView mRightTintView;
private SystemBarTintView mTopTintView;
@@ -90,12 +85,11 @@ class NavitGraphics {
private RelativeLayout mRelativeLayout;
private NavitCamera mCamera;
private Navit mActivity;
- private static boolean sInMap;
- private boolean mTinting;
+ private boolean mTinting;
+ @SuppressWarnings("unused")
void setBackgroundColor(int bgcolor) {
- this.mBgColor = bgcolor;
if (mLeftTintView != null) {
mLeftTintView.setBackgroundColor(bgcolor);
}
@@ -113,23 +107,7 @@ class NavitGraphics {
private void setCamera(int useCamera) {
if (useCamera != 0 && mCamera == null) {
// mActivity.requestWindowFeature(Window.FEATURE_NO_TITLE);
- addCamera();
- addCameraView();
- }
- }
-
- /**
- * Adds a camera.
- *
- * <p>This method does not create the view for the camera. This must be done separately by calling
- * {@link #addCameraView()}.</p>
- */
- private void addCamera() {
- mCamera = new NavitCamera(mActivity);
- }
-
- private void addCameraView() {
- if (mCamera != null) {
+ mCamera = new NavitCamera(mActivity);
mRelativeLayout.addView(mCamera);
mRelativeLayout.bringChildToFront(mView);
}
@@ -167,16 +145,23 @@ class NavitGraphics {
static final int DRAG = 1;
static final int ZOOM = 2;
static final int PRESSED = 3;
-
PointF mPressedPosition = null;
+ // mContextMenuMapViewIntent is the ACTION_VIEW intent for a geo coordinates.
+ // it is used when clicking on view in the map contextual menu
+ Intent mContextMenuMapViewIntent = null;
NavitView(Context context) {
super(context);
+ // assumption usefull for the KitKat tinting only
+ sInMap = true;
+ }
+
+ boolean isDrag() {
+ return mTouchMode == DRAG;
}
public void onWindowFocusChanged(boolean hasWindowFocus) {
Log.v(TAG,"onWindowFocusChanged = " + hasWindowFocus);
- // beter aanroepen in Navit of appconfig ?
if (Navit.sShowSoftKeyboardShowing && hasWindowFocus) {
InputMethodManager imm = (InputMethodManager) mActivity
.getSystemService(Context.INPUT_METHOD_SERVICE);
@@ -210,6 +195,56 @@ class NavitGraphics {
return insets;
}
+ /**
+ * Create an intent for a view action of a point provided by its x and y position on the display.
+ *
+ * @param x The x coordinates of the point on the display
+ * @param y The y coordinates of the point on the display
+ *
+ * @return An intent to start to view the specified point on a third-party app on Android (can be null if a
+ * view action is not possible)
+ **/
+ Intent getViewIntentForDisplayPoint(int x, int y) {
+ Intent result = null;
+
+ /* Check if there is at least one application that can process a geo intent... */
+ String selectedPointCoord = getCoordForPoint(x, y, true);
+ Uri intentUri = Uri.parse("geo:" + selectedPointCoord);
+ Intent defaultShareIntent = new Intent(Intent.ACTION_VIEW, intentUri);
+
+ List<Intent> customShareIntentList = new ArrayList<>();
+ List<ResolveInfo> intentTargetAppList;
+ intentTargetAppList = this.getContext().getPackageManager().queryIntentActivities(defaultShareIntent, 0);
+
+ String selfPackageName = this.getContext().getPackageName();
+
+ if (!intentTargetAppList.isEmpty()) {
+ for (ResolveInfo resolveInfo : intentTargetAppList) {
+ String packageName = resolveInfo.activityInfo.packageName;
+ Intent copiedIntent = new Intent(Intent.ACTION_VIEW, intentUri);
+ if (!packageName.equals(selfPackageName)) {
+ Log.d(TAG, "Adding package \"" + packageName + "\" to app chooser");
+ copiedIntent.setPackage(packageName);
+ copiedIntent.setClassName(
+ resolveInfo.activityInfo.packageName,
+ resolveInfo.activityInfo.name);
+ customShareIntentList.add(copiedIntent);
+ } else {
+ Log.d(TAG, "Excluding ourselves (package " + packageName + ") from intent targets");
+ }
+ }
+ if (customShareIntentList.size() > 0) {
+ result = Intent.createChooser(customShareIntentList.remove(customShareIntentList.size() - 1),
+ NavitAppConfig.getTstring(R.string.use_position_with));
+ result.putExtra(Intent.EXTRA_INITIAL_INTENTS,
+ customShareIntentList.toArray(new Intent[0]));
+ Log.d(TAG, "Preparing action intent (" + customShareIntentList.size() + 1
+ + " candidate apps) to view selected coord: " + selectedPointCoord);
+ }
+ }
+ return result;
+ }
+
private static final int MENU_DRIVE_HERE = 1;
private static final int MENU_VIEW = 2;
private static final int MENU_CANCEL = 3;
@@ -221,40 +256,34 @@ class NavitGraphics {
menu.setHeaderTitle(NavitAppConfig.getTstring(R.string.position_popup_title) + " " + clickCoord);
menu.add(1, MENU_DRIVE_HERE, NONE, NavitAppConfig.getTstring(R.string.position_popup_drive_here))
.setOnMenuItemClickListener(this);
- Uri intentUri = Uri.parse("geo:" + getCoordForPoint((int)mPressedPosition.x,
- (int)mPressedPosition.y, true));
- Intent mContextMenuMapViewIntent = new Intent(Intent.ACTION_VIEW, intentUri);
-
- PackageManager packageManager = this.getContext().getPackageManager();
- List<ResolveInfo> activities = packageManager.queryIntentActivities(mContextMenuMapViewIntent,
- PackageManager.MATCH_DEFAULT_ONLY);
- boolean isIntentSafe = (activities.size() > 0); // at least one candidate receiver
- if (isIntentSafe) { // add view with external app option
- menu.add(1, MENU_VIEW, NONE, NavitAppConfig.getTstring(R.string.position_popup_view))
- .setOnMenuItemClickListener(this);
+ mContextMenuMapViewIntent = getViewIntentForDisplayPoint((int)mPressedPosition.x, (int)mPressedPosition.y);
+ if (mContextMenuMapViewIntent != null) {
+ menu.add(1, MENU_VIEW, NONE,
+ NavitAppConfig.getTstring(R.string.position_popup_view)).setOnMenuItemClickListener(this);
} else {
- Log.w(TAG, "No application available to handle ACTION_VIEW intent, option not displayed");
+ Log.w(TAG, "No application available to handle ACTION_VIEW intent, view option not displayed");
}
- menu.add(1, MENU_CANCEL, NONE, getTstring(R.string.cancel)).setOnMenuItemClickListener(this);
+ menu.add(1, MENU_CANCEL, NONE,
+ NavitAppConfig.getTstring(R.string.cancel)).setOnMenuItemClickListener(this);
}
@Override
public boolean onMenuItemClick(MenuItem item) {
int itemId = item.getItemId();
if (itemId == MENU_DRIVE_HERE) {
- Message msg = Message.obtain(sCallbackHandler, MsgType.CLB_SET_DISPLAY_DESTINATION.ordinal(),
+ Message msg = Message.obtain(NavitCallbackHandler.sCallbackHandler,
+ NavitCallbackHandler.MsgType.CLB_SET_DISPLAY_DESTINATION.ordinal(),
(int) mPressedPosition.x, (int) mPressedPosition.y);
msg.sendToTarget();
} else if (itemId == MENU_VIEW) {
- Uri intentUri = Uri.parse("geo:" + getCoordForPoint((int) mPressedPosition.x,
- (int) mPressedPosition.y, true));
- Intent mContextMenuMapViewIntent = new Intent(Intent.ACTION_VIEW, intentUri);
+ mContextMenuMapViewIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
if (mContextMenuMapViewIntent.resolveActivity(this.getContext().getPackageManager()) != null) {
this.getContext().startActivity(mContextMenuMapViewIntent);
} else {
- Log.w(TAG, "ACTION_VIEW intent is not handled by any application, discarding...");
+ Log.w(TAG, "View menu selected but intent is not handled by any application. Ignoring...");
}
}
+ mContextMenuMapViewIntent = null;
return true;
}
@@ -278,8 +307,6 @@ class NavitGraphics {
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
Log.d(TAG, "onSizeChanged pixels x=" + w + " pixels y=" + h);
- Log.v(TAG, "onSizeChanged density=" + Navit.sMetrics.density);
- Log.v(TAG, "onSizeChanged scaledDensity=" + Navit.sMetrics.scaledDensity);
super.onSizeChanged(w, h, oldw, oldh);
mDrawBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
mDrawCanvas = new Canvas(mDrawBitmap);
@@ -372,12 +399,12 @@ class NavitGraphics {
Log.v(TAG, "New scale = " + scale);
if (scale > 1.2) {
// zoom in
- callbackMessageChannel(1, "");
+ NavitCallbackHandler.sendCommand(NavitCallbackHandler.CmdType.CMD_ZOOM_IN);
mOldDist = newDist;
} else if (scale < 0.8) {
mOldDist = newDist;
// zoom out
- callbackMessageChannel(2, "");
+ NavitCallbackHandler.sendCommand(NavitCallbackHandler.CmdType.CMD_ZOOM_OUT);
}
}
}
@@ -548,19 +575,21 @@ class NavitGraphics {
public SystemBarTintView(Context context) {
super(context);
- this.setBackgroundColor(mBgColor);
}
}
+ @SuppressWarnings("unused")
NavitGraphics(final Activity navit, NavitGraphics parent, int x, int y, int w, int h,
- int wraparound, int useCamera) {
+ int wraparound, int useCamera) {
if (parent == null) {
+ mOverlays = new ArrayList<>();
if (useCamera != 0) {
- addCamera();
+ setCamera(useCamera);
}
setmActivity((Navit)navit);
} else {
+ mOverlays = null;
mDrawBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
mBitmapWidth = w;
mBitmapHeight = h;
@@ -585,11 +614,9 @@ class NavitGraphics {
mView.setFocusableInTouchMode(true);
mView.setKeepScreenOn(true);
mRelativeLayout = new RelativeLayout(mActivity);
- addCameraView();
mRelativeLayout.addView(mView);
/* The navigational and status bar tinting code is meaningful only on API19+ */
mTinting = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
-
if (mTinting) {
mFrameLayout = new FrameLayout(mActivity);
mFrameLayout.addView(mRelativeLayout);
@@ -608,69 +635,6 @@ class NavitGraphics {
mView.requestFocus();
}
- enum MsgType {
- CLB_ZOOM_IN, CLB_ZOOM_OUT, CLB_REDRAW, CLB_MOVE, CLB_BUTTON_UP, CLB_BUTTON_DOWN, CLB_SET_DESTINATION,
- CLB_SET_DISPLAY_DESTINATION, CLB_CALL_CMD, CLB_COUNTRY_CHOOSER, CLB_LOAD_MAP, CLB_UNLOAD_MAP, CLB_DELETE_MAP
- }
-
- private static final MsgType[] msg_values = MsgType.values();
-
- private static class CallBackHandler extends Handler {
- public void handleMessage(Message msg) {
- switch (msg_values[msg.what]) {
- case CLB_ZOOM_IN:
- callbackMessageChannel(1, "");
- break;
- case CLB_ZOOM_OUT:
- callbackMessageChannel(2, "");
- break;
- case CLB_MOVE:
- //motionCallback(mMotionCallbackID, msg.getData().getInt("x"), msg.getData().getInt("y"));
- break;
- case CLB_SET_DESTINATION:
- String lat = Float.toString(msg.getData().getFloat("lat"));
- String lon = Float.toString(msg.getData().getFloat("lon"));
- String q = msg.getData().getString(("q"));
- callbackMessageChannel(3, lat + "#" + lon + "#" + q);
- break;
- case CLB_SET_DISPLAY_DESTINATION:
- int x = msg.arg1;
- int y = msg.arg2;
- callbackMessageChannel(4, "" + x + "#" + y);
- break;
- case CLB_CALL_CMD:
- String cmd = msg.getData().getString(("cmd"));
- callbackMessageChannel(5, cmd);
- break;
- case CLB_BUTTON_UP:
- //buttonCallback(mButtonCallbackID, 0, 1, msg.getData().getInt("x"), msg.getData().getInt("y"));
- break;
- case CLB_BUTTON_DOWN:
- //buttonCallback(mButtonCallbackID, 1, 1, msg.getData().getInt("x"), msg.getData().getInt("y"));
- break;
- case CLB_COUNTRY_CHOOSER:
- break;
- case CLB_LOAD_MAP:
- callbackMessageChannel(6, msg.getData().getString(("title")));
- break;
- case CLB_DELETE_MAP:
- //unload map before deleting it !!!
- callbackMessageChannel(7, msg.getData().getString(("title")));
- //remove commentlines below after testing
- //File toDelete = new File(msg.getData().getString(("title")));
- //toDelete.delete();
- NavitUtils.removeFileIfExists(msg.getData().getString(("title")));
- break;
- case CLB_UNLOAD_MAP:
- callbackMessageChannel(7, msg.getData().getString(("title")));
- break;
- case CLB_REDRAW:
- default:
- Log.d(TAG, "Unhandled callback : " + msg_values[msg.what]);
- }
- }
- }
-
private native void sizeChangedCallback(long id, int x, int y);
@@ -678,13 +642,11 @@ class NavitGraphics {
private native void keypressCallback(long id, String s);
- private static native int callbackMessageChannel(int i, String s);
-
private native void buttonCallback(long id, int pressed, int button, int x, int y);
private native void motionCallback(long id, int x, int y);
- private native String getCoordForPoint(int x, int y, boolean absolutCoord);
+ private native String getCoordForPoint(int x, int y, boolean absoluteCoord);
static native String[][] getAllCountries();
@@ -774,8 +736,6 @@ class NavitGraphics {
* All system bar sizes are device defaults and do not change with rotation, but we have
* to figure out which ones apply.
*
- * Status bar visibility is as on API 20-22.
- *
* The navigation bar is shown on devices that report they have no physical menu button. This seems to
* work even on devices that allow disabling the physical buttons (and use the navigation bar, in which
* case they report no physical menu button is available; tested with a OnePlus One running CyanogenMod)
@@ -833,6 +793,7 @@ class NavitGraphics {
*
* <p>Note that this method is not aware of non-standard mechanisms on some customized builds of Android</p>
*/
+ @SuppressWarnings("unused")
boolean hasMenuButton() {
if (Build.VERSION.SDK_INT <= 10) {
return true;
@@ -845,30 +806,36 @@ class NavitGraphics {
}
}
+ @SuppressWarnings("unused")
void setSizeChangedCallback(long id) {
mSizeChangedCallbackID = id;
}
+ @SuppressWarnings("unused")
void setPaddingChangedCallback(long id) {
mPaddingChangedCallbackID = id;
}
+ @SuppressWarnings("unused")
void setButtonCallback(long id) {
Log.v(TAG,"set Buttononcallback");
mButtonCallbackID = id;
}
+ @SuppressWarnings("unused")
void setMotionCallback(long id) {
mMotionCallbackID = id;
Log.v(TAG,"set Motioncallback");
}
+ @SuppressWarnings("unused")
void setKeypressCallback(long id) {
Log.v(TAG,"set Keypresscallback");
mKeypressCallbackID = id;
}
+ @SuppressWarnings("unused")
protected void draw_polyline(Paint paint, int[] c) {
paint.setStrokeWidth(c[0]);
paint.setARGB(c[1],c[2],c[3],c[4]);
@@ -943,7 +910,8 @@ class NavitGraphics {
mDrawCanvas.drawPath(path, paint);
}
- protected void draw_polygon(Paint paint, int[] c) {
+ @SuppressWarnings("unused")
+ protected void (Paint paint, int[] c) {
paint.setStrokeWidth(c[0]);
paint.setARGB(c[1],c[2],c[3],c[4]);
paint.setStyle(Paint.Style.FILL);
@@ -958,6 +926,7 @@ class NavitGraphics {
mDrawCanvas.drawPath(path, paint);
}
+ @SuppressWarnings("unused")
protected void draw_rectangle(Paint paint, int x, int y, int w, int h) {
Rect r = new Rect(x, y, x + w, y + h);
paint.setStyle(Paint.Style.FILL);
@@ -966,11 +935,13 @@ class NavitGraphics {
mDrawCanvas.drawRect(r, paint);
}
+ @SuppressWarnings("unused")
protected void draw_circle(Paint paint, int x, int y, int r) {
paint.setStyle(Paint.Style.STROKE);
mDrawCanvas.drawCircle(x, y, r / 2, paint);
}
+ @SuppressWarnings("unused")
protected void draw_text(Paint paint, int x, int y, String text, int size, int dx, int dy, int bgcolor) {
int oldcolor = paint.getColor();
Path path = null;
@@ -1021,11 +992,6 @@ class NavitGraphics {
* @param p2x and p2y specifying the bottom left point, not yet used but kept
* for compatibility with the linux port
* @param bitmap Bitmap object holding the image to draw
- *
- * TODO make it work with 4 points specified to make it work for 3D mapview, so it can be used
- * for small but very detailed maps as well as for large maps with very little detail but large
- * coverage.
- * TODO make it work with rectangular tiles as well ?
*/
protected void draw_image_warp(Paint paint, int count, int p0x, int p0y, int p1x, int p1y, int p2x, int p2y,
Bitmap bitmap) {
@@ -1057,6 +1023,7 @@ class NavitGraphics {
/* Used by the pedestrian plugin, draws without a mapbackground */
private static final int DRAW_MODE_BEGIN_CLEAR = 2;
+ @SuppressWarnings("unused")
protected void draw_mode(int mode) {
if (mode == DRAW_MODE_END) {
if (mParentGraphics == null) {
@@ -1071,18 +1038,18 @@ class NavitGraphics {
}
+ @SuppressWarnings("unused")
protected void draw_drag(int x, int y) {
mPosX = x;
mPosY = y;
}
+ @SuppressWarnings("unused")
protected void overlay_disable(int disable) {
Log.v(TAG,"overlay_disable: " + disable + ", Parent: " + (mParentGraphics != null));
- // assume we are NOT in map view mode!
- // but this backfires when dragging the map
if (mParentGraphics == null) {
sInMap = (disable == 0);
- workAroundForGuiInternal(sInMap);
+ workAroundForGuiInternal();
}
if (mOverlayDisabled != disable) {
mOverlayDisabled = disable;
@@ -1092,30 +1059,23 @@ class NavitGraphics {
}
}
- private void workAroundForGuiInternal(Boolean inMap) {
+ private void workAroundForGuiInternal() {
if (!mTinting) {
return;
}
Log.v(TAG,"workaround gui internal");
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && !inMap) {
- mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
- return;
- }
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- mActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
- return;
- }
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && !inMap) {
+ if (!sInMap && !mView.isDrag() && Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
mActivity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
return;
}
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
mActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
mActivity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
}
}
+ @SuppressWarnings("unused")
protected void overlay_resize(int x, int y, int w, int h, int wraparound) {
mDrawBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
mBitmapWidth = w;
diff --git a/navit/android/src/org/navitproject/navit/NavitMapDownloader.java b/navit/android/src/org/navitproject/navit/NavitMapDownloader.java
index 51c362407..e66840073 100644
--- a/navit/android/src/org/navitproject/navit/NavitMapDownloader.java
+++ b/navit/android/src/org/navitproject/navit/NavitMapDownloader.java
@@ -20,7 +20,6 @@ import static org.navitproject.navit.NavitAppConfig.getTstring;
import android.location.Location;
import android.os.Bundle;
import android.os.Message;
-import android.os.StatFs;
import android.util.Log;
import java.io.BufferedInputStream;
@@ -47,422 +46,424 @@ import java.net.URLConnection;
*/
public class NavitMapDownloader extends Thread {
- //
- // define the maps here
- // size estimations updated 2017-06-22
- //
static final OsmMapValues[] osm_maps = {
- new OsmMapValues(getTstring(R.string.whole_planet), "-180", "-90", "180", "90",
- 23992258630L, 0),
- new OsmMapValues(getTstring(R.string.africa), "-30.89", "-36.17", "61.68",
- "38.40", 2070076339L, 0),
- new OsmMapValues(getTstring(R.string.angola), "11.4", "-18.1", "24.2", "-5.3",
- 127557789L, 1),
- new OsmMapValues(getTstring(R.string.burundi), "28.9", "-4.5", "30.9", "-2.2",
- 124049667L, 1),
- new OsmMapValues(getTstring(R.string.canary_islands), "-18.69", "26.52", "-12.79",
- "29.99", 133565815L, 1),
- new OsmMapValues(getTstring(R.string.congo), "11.7",
- "-13.6", "31.5", "5.7", 244228485L, 1),
- new OsmMapValues(getTstring(R.string.ethiopia), "32.89", "3.33", "48.07", "14.97",
- 153067406L, 1),
- new OsmMapValues(getTstring(R.string.guinea), "-15.47", "7.12", "-7.58", "12.74",
- 188047126L, 1),
- new OsmMapValues(getTstring(R.string.cotedivoire), "-8.72", "4.09", "-2.43",
- "10.80", 132187496L, 1),
- new OsmMapValues(getTstring(R.string.kenya), "33.8", "-5.2", "42.4", "4.9",
- 190073089L, 1),
- new OsmMapValues(getTstring(R.string.lesotho), "26.9", "-30.7", "29.6", "-28.4",
- 196189429L, 1),
- new OsmMapValues(getTstring(R.string.liberia), "-15.00", "-0.73", "-7.20", "8.65",
- 156257253L, 1),
- new OsmMapValues(getTstring(R.string.libya), "9.32", "19.40", "25.54", "33.63",
- 126046917L, 1),
- new OsmMapValues(getTstring(R.string.madagascar), "42.25", "-26.63", "51.20",
- "-11.31", 145210721L, 1),
- new OsmMapValues(getTstring(R.string.namibia) + "+" + getTstring(R.string.botswana),
- "11.4", "-29.1", "29.5", "-16.9", 248970987L, 1),
- new OsmMapValues(getTstring(R.string.reunion), "55.2", "-21.4", "55.9", "-20.9",
- 126008774L, 1),
- new OsmMapValues(getTstring(R.string.rwanda), "28.8", "-2.9", "30.9", "-1.0",
- 128267595L, 1),
- new OsmMapValues(getTstring(R.string.south_africa) + "+" + getTstring(R.string.lesotho),
- "15.93", "-36.36", "33.65", "-22.08", 307280006L, 1),
- new OsmMapValues(getTstring(R.string.tanzania), "29.19",
- "-11.87", "40.74", "-0.88", 253621029L, 1),
- new OsmMapValues(getTstring(R.string.uganda), "29.3", "-1.6", "35.1", "4.3",
- 179134521L, 1),
- new OsmMapValues(getTstring(R.string.asia), "23.8", "0.1", "195.0", "82.4",
- 5113673780L, 0),
- new OsmMapValues(getTstring(R.string.azerbaijan), "44.74", "38.34", "51.69",
- "42.37", 138346406L, 1),
- new OsmMapValues(getTstring(R.string.china), "67.3", "5.3", "135.0", "54.5",
- 1718108758L, 1),
- new OsmMapValues(getTstring(R.string.cyprus), "32.0", "34.5", "34.9", "35.8",
- 118472448L, 1),
- new OsmMapValues(getTstring(R.string.india) + "+" + getTstring(R.string.nepal), "67.9",
- "5.5", "89.6", "36.0", 601877877L, 1),
- new OsmMapValues(getTstring(R.string.indonesia), "93.7", "-17.3", "155.5", "7.6",
- 420741405L, 1),
- new OsmMapValues(getTstring(R.string.iran), "43.5", "24.4",
- "63.6", "40.4", 242016066L, 1),
- new OsmMapValues(getTstring(R.string.iraq), "38.7", "28.5", "49.2", "37.4",
- 160751805L, 1),
- new OsmMapValues(getTstring(R.string.israel), "33.99", "29.8", "35.95", "33.4",
- 155685778L, 1),
- new OsmMapValues(getTstring(R.string.japan) + "+" + getTstring(R.string.korea), "123.6",
- "25.2", "151.3", "47.1", 1029080156L, 1),
- new OsmMapValues(getTstring(R.string.kazakhstan), "46.44", "40.89", "87.36",
- "55.45", 407633007L, 1),
- new OsmMapValues(getTstring(R.string.kyrgyzsyan), "69.23", "39.13", "80.33",
- "43.29", 147997835L, 1),
- new OsmMapValues(getTstring(R.string.malaysia) + "+" + getTstring(R.string.singapore),
- "94.3", "-5.9", "108.6", "6.8", 168816435L, 1),
- new OsmMapValues(getTstring(R.string.mongolia), "87.5", "41.4", "120.3", "52.7",
- 153534851L, 1),
- new OsmMapValues(getTstring(R.string.pakistan), "60.83", "23.28", "77.89",
- "37.15", 217644321L, 1),
- new OsmMapValues(getTstring(R.string.philippines), "115.58", "4.47", "127.85",
- "21.60", 281428307L, 1),
- new OsmMapValues(getTstring(R.string.saudi_arabia), "33.2", "16.1", "55.9",
- "33.5", 242648303L, 1),
- new OsmMapValues(getTstring(R.string.taiwan), "119.1", "21.5", "122.5", "25.2",
- 1029080156L, 1),
- new OsmMapValues(getTstring(R.string.thailand), "97.5", "5.7", "105.2", "19.7",
- 185135492L, 1),
- new OsmMapValues(getTstring(R.string.turkey), "25.1", "35.8", "46.4", "42.8",
- 331087441L, 1),
- new OsmMapValues(getTstring(R.string.turkmenistan), "51.78", "35.07", "66.76",
- "42.91", 131045087L, 1),
- new OsmMapValues(getTstring(R.string.uae_other), "51.5", "22.6", "56.7", "26.5",
- 128934674L, 1),
- new OsmMapValues(getTstring(R.string.australia) + "+" + getTstring(R.string.oceania),
- "89.84", "-57.39", "179.79", "7.26", 782722650L, 0),
- new OsmMapValues(getTstring(R.string.australia), "110.5", "-44.2", "154.9",
- "-9.2", 348652900L, 0),
- new OsmMapValues(getTstring(R.string.tasmania), "144.0", "-45.1", "155.3",
- "-24.8", 253231890L, 1),
- new OsmMapValues(getTstring(R.string.victoria) + " + " + getTstring(R.string.new_south_wales),
- "140.7", "-39.4", "153.7", "-26.9", 241500829L, 1),
- new OsmMapValues(getTstring(R.string.new_caledonia), "157.85", "-25.05", "174.15",
- "-16.85", 115512336L, 1),
- new OsmMapValues(getTstring(R.string.newzealand), "165.2", "-47.6", "179.1",
- "-33.7", 239264192L, 1),
- new OsmMapValues(getTstring(R.string.europe), "-12.97", "33.59", "34.15", "72.10",
- 11984126789L, 0),
- new OsmMapValues(getTstring(R.string.western_europe), "-17.6", "34.5", "42.9",
- "70.9", 12648810717L, 1),
- new OsmMapValues(getTstring(R.string.austria), "9.4", "46.32", "17.21", "49.1",
- 898273634L, 1),
- new OsmMapValues(getTstring(R.string.azores), "-31.62", "36.63", "-24.67",
- "40.13", 112687225L, 1),
- new OsmMapValues(getTstring(R.string.belgium), "2.3", "49.5", "6.5", "51.6",
- 733035524L, 1),
- new OsmMapValues(getTstring(R.string.benelux), "2.08", "48.87", "7.78", "54.52",
- 1771971595L, 1),
- new OsmMapValues(getTstring(R.string.netherlands), "3.07", "50.75", "7.23",
- "53.73", 1191828033L, 1),
- new OsmMapValues(getTstring(R.string.denmark), "7.65", "54.32", "15.58", "58.07",
- 365606979L, 1),
- new OsmMapValues(getTstring(R.string.faroe_islands), "-7.8", "61.3", "-6.1",
- "62.5", 109377568L, 1),
- new OsmMapValues(getTstring(R.string.france), "-5.45", "42.00", "8.44", "51.68",
- 3907969744L, 1),
- new OsmMapValues(getTstring(R.string.alsace), "6.79", "47.27", "8.48", "49.17",
- 354249349L, 2),
- new OsmMapValues(getTstring(R.string.aquitaine), "-2.27", "42.44", "1.50",
- "45.76", 443715019L, 2),
- new OsmMapValues(getTstring(R.string.auvergne), "2.01", "44.57", "4.54", "46.85",
- 287663213L, 2),
- new OsmMapValues(getTstring(R.string.basse_normandie), "-2.09", "48.13", "1.03",
- "49.98", 262352354L, 2),
- new OsmMapValues(getTstring(R.string.bourgogne), "2.80", "46.11", "5.58", "48.45",
- 298868796L, 2),
- new OsmMapValues(getTstring(R.string.bretagne), "-5.58", "46.95", "-0.96",
- "48.99", 382770794L, 2),
- new OsmMapValues(getTstring(R.string.centre), "0.01", "46.29", "3.18", "48.99",
- 474224721L, 2),
- new OsmMapValues(getTstring(R.string.champagne_ardenne), "3.34", "47.53", "5.94",
- "50.28", 269947824L, 2),
- new OsmMapValues(getTstring(R.string.corse), "8.12", "41.32", "9.95", "43.28",
- 129902146L, 2),
- new OsmMapValues(getTstring(R.string.franche_comte), "5.20", "46.21", "7.83",
- "48.07", 324476070L, 2),
- new OsmMapValues(getTstring(R.string.haute_normandie), "-0.15", "48.62", "1.85",
- "50.18", 202782876L, 2),
- new OsmMapValues(getTstring(R.string.ile_de_france), "1.40", "48.07", "3.61",
- "49.29", 311052699L, 2),
- new OsmMapValues(getTstring(R.string.languedoc_roussillon), "1.53", "42.25",
- "4.89", "45.02", 380145667L, 2),
- new OsmMapValues(getTstring(R.string.limousin), "0.58", "44.87", "2.66", "46.50",
- 206696539L, 2),
- new OsmMapValues(getTstring(R.string.lorraine), "4.84", "47.77", "7.72", "49.73",
- 330777318L, 2),
- new OsmMapValues(getTstring(R.string.midi_pyrenees), "-0.37", "42.18", "3.50",
- "45.10", 462618363L, 2),
- new OsmMapValues(getTstring(R.string.nord_pas_de_calais), "1.42", "49.92", "4.49",
- "51.31", 368467511L, 2),
- new OsmMapValues(getTstring(R.string.pays_de_la_loire), "-2.88", "46.20", "0.97",
- "48.62", 499471143L, 2),
- new OsmMapValues(getTstring(R.string.picardie), "1.25", "48.79", "4.31", "50.43",
- 374308041L, 2),
- new OsmMapValues(getTstring(R.string.poitou_charentes), "-1.69", "45.04", "1.26",
- "47.23", 342125526L, 2),
- new OsmMapValues(getTstring(R.string.provence_alpes_cote_d_azur), "4.21", "42.91",
- "7.99", "45.18", 390306134L, 2),
- new OsmMapValues(getTstring(R.string.rhone_alpes), "3.65", "44.07", "7.88",
- "46.64", 510797942L, 2),
- new OsmMapValues(getTstring(R.string.luxembourg), "5.7", "49.4", "6.5", "50.2",
- 1771971595L, 1),
- new OsmMapValues(getTstring(R.string.germany), "5.18", "46.84", "15.47", "55.64",
- 3521359466L, 1),
- new OsmMapValues(getTstring(R.string.baden_wuerttemberg), "7.32", "47.14",
- "10.57", "49.85", 674361124L, 2),
- new OsmMapValues(getTstring(R.string.bayern), "8.92", "47.22", "13.90", "50.62",
- 860161150L, 2),
- new OsmMapValues(getTstring(R.string.mittelfranken), "9.86", "48.78", "11.65",
- "49.84", 203055195L, 2),
- new OsmMapValues(getTstring(R.string.niederbayern), "11.55", "47.75", "14.12",
- "49.42", 312924770L, 2),
- new OsmMapValues(getTstring(R.string.oberbayern), "10.67", "47.05", "13.57",
- "49.14", 382734883L, 2),
- new OsmMapValues(getTstring(R.string.oberfranken), "10.31", "49.54", "12.49",
- "50.95", 235258691L, 2),
- new OsmMapValues(getTstring(R.string.oberpfalz), "11.14", "48.71", "13.47",
- "50.43", 264536012L, 2),
- new OsmMapValues(getTstring(R.string.schwaben), "9.27", "47.10", "11.36", "49.09",
- 321141607L, 2),
- new OsmMapValues(getTstring(R.string.unterfranken), "8.59", "49.16", "10.93",
- "50.67", 303720890L, 2),
- new OsmMapValues(getTstring(R.string.berlin), "13.03", "52.28", "13.81", "52.73",
- 169019946L, 2),
- new OsmMapValues(getTstring(R.string.brandenburg), "11.17", "51.30", "14.83",
- "53.63", 323497599L, 2),
- new OsmMapValues(getTstring(R.string.bremen), "8.43", "52.96", "9.04", "53.66",
- 150963608L, 2),
- new OsmMapValues(getTstring(R.string.hamburg), "9.56", "53.34", "10.39", "53.80",
- 156284421L, 2),
- new OsmMapValues(getTstring(R.string.hessen), "7.72", "49.34", "10.29", "51.71",
- 432279328L, 2),
- new OsmMapValues(getTstring(R.string.mecklenburg_vorpommern), "10.54", "53.05",
- "14.48", "55.05", 213183908L, 2),
- new OsmMapValues(getTstring(R.string.niedersachsen), "6.40", "51.24", "11.69",
- "54.22", 819766939L, 2),
- new OsmMapValues(getTstring(R.string.nordrhein_westfalen), "5.46", "50.26",
- "9.52", "52.59", 967053517L, 2),
- new OsmMapValues(getTstring(R.string.rheinland_pfalz), "6.06", "48.91", "8.56",
- "51.00", 442868899L, 2),
- new OsmMapValues(getTstring(R.string.saarland), "6.30", "49.06", "7.46", "49.69",
- 157721162L, 2),
- new OsmMapValues(getTstring(R.string.sachsen_anhalt), "10.50", "50.88", "13.26",
- "53.11", 287785088L, 2),
- new OsmMapValues(getTstring(R.string.sachsen), "11.82", "50.11", "15.10", "51.73",
- 342620834L, 2),
- new OsmMapValues(getTstring(R.string.schleswig_holstein), "7.41", "53.30",
- "11.98", "55.20", 280293910L, 2),
- new OsmMapValues(getTstring(R.string.thueringen), "9.81", "50.15", "12.72",
- "51.70", 269428239L, 2),
- new OsmMapValues(getTstring(R.string.iceland), "-25.3", "62.8", "-11.4", "67.5",
- 124837162L, 1),
- new OsmMapValues(getTstring(R.string.ireland), "-11.17", "51.25", "-5.23", "55.9",
- 234750271L, 1),
- new OsmMapValues(getTstring(R.string.italy), "6.52", "36.38", "18.96", "47.19",
- 1610171395L, 1),
- new OsmMapValues(getTstring(R.string.spain) + "+" + getTstring(R.string.portugal),
- "-11.04", "34.87", "4.62", "44.41", 1039624918L, 1),
- new OsmMapValues(getTstring(R.string.mallorca), "2.2", "38.8", "4.7", "40.2",
- 137200636L, 2),
- new OsmMapValues(getTstring(R.string.galicia), "-10.0", "41.7", "-6.3", "44.1",
- 174549553L, 2),
- new OsmMapValues(getTstring(R.string.scandinavia), "4.0", "54.4", "32.1", "71.5",
- 1398661090L, 1),
- new OsmMapValues(getTstring(R.string.finland), "18.6", "59.2", "32.3", "70.3",
- 460997178L, 1),
- new OsmMapValues(getTstring(R.string.denmark), "7.49", "54.33", "13.05", "57.88",
- 321870414L, 1),
- new OsmMapValues(getTstring(R.string.switzerland), "5.79", "45.74", "10.59",
- "47.84", 552565332L, 1),
- new OsmMapValues(getTstring(R.string.united_kingdom), "-9.7", "49.6", "2.2",
- "61.2", 901724648L, 1),
- new OsmMapValues(getTstring(R.string.england), "-7.80", "48.93", "2.41", "56.14",
- 937728414L, 1),
- new OsmMapValues(getTstring(R.string.buckinghamshire), "-1.19", "51.44", "-0.43",
- "52.25", 142256978L, 2),
- new OsmMapValues(getTstring(R.string.cambridgeshire), "-0.55", "51.96", "0.56",
- "52.79", 142334001L, 2),
- new OsmMapValues(getTstring(R.string.cumbria), "-3.96", "53.85", "-2.11", "55.24",
- 144422460L, 2),
- new OsmMapValues(getTstring(R.string.east_yorkshire_with_hull), "-1.16", "53.50",
- "0.54", "54.26", 141518744L, 2),
- new OsmMapValues(getTstring(R.string.essex), "-0.07", "51.40", "1.36", "52.14",
- 162542730L, 2),
- new OsmMapValues(getTstring(R.string.herefordshire), "-3.19", "51.78", "-2.29",
- "52.45", 129368660L, 2),
- new OsmMapValues(getTstring(R.string.kent), "-0.02", "50.81", "1.65", "51.53",
- 145482562L, 2),
- new OsmMapValues(getTstring(R.string.lancashire), "-3.20", "53.43", "-2.00",
- "54.29", 148964975L, 2),
- new OsmMapValues(getTstring(R.string.leicestershire), "-1.65", "52.34", "-0.61",
- "53.03", 154199956L, 2),
- new OsmMapValues(getTstring(R.string.norfolk), "0.10", "52.30", "2.04", "53.41",
- 146017009L, 2),
- new OsmMapValues(getTstring(R.string.nottinghamshire), "-1.39", "52.73", "-0.62",
- "53.55", 147986548L, 2),
- new OsmMapValues(getTstring(R.string.oxfordshire), "-1.77", "51.41", "-0.82",
- "52.22", 142240992L, 2),
- new OsmMapValues(getTstring(R.string.shropshire), "-3.29", "52.26", "-2.18",
- "53.05", 136909363L, 2),
- new OsmMapValues(getTstring(R.string.somerset), "-3.89", "50.77", "-2.20",
- "51.40", 145186096L, 2),
- new OsmMapValues(getTstring(R.string.south_yorkshire), "-1.88", "53.25", "-0.80",
- "53.71", 145902650L, 2),
- new OsmMapValues(getTstring(R.string.suffolk), "0.29", "51.88", "1.81", "52.60",
- 143799697L, 2),
- new OsmMapValues(getTstring(R.string.surrey), "-0.90", "51.02", "0.10", "51.52",
- 157987139L, 2),
- new OsmMapValues(getTstring(R.string.wiltshire), "-2.41", "50.90", "-1.44",
- "51.76", 138652346L, 2),
- new OsmMapValues(getTstring(R.string.scotland), "-8.13", "54.49", "-0.15",
- "61.40", 258853845L, 2),
- new OsmMapValues(getTstring(R.string.wales), "-5.56", "51.28", "-2.60", "53.60",
- 193593409L, 2),
- new OsmMapValues(getTstring(R.string.albania), "19.09", "39.55", "21.12", "42.72",
- 146199817L, 1),
- new OsmMapValues(getTstring(R.string.belarus), "23.12", "51.21", "32.87", "56.23",
- 324470696L, 1),
- new OsmMapValues(getTstring(R.string.russian_federation), "27.9", "41.5", "190.4",
- "77.6", 2148314279L, 1),
- new OsmMapValues(getTstring(R.string.bulgaria), "24.7", "42.1", "24.8", "42.1",
- 109869373L, 1),
- new OsmMapValues(getTstring(R.string.bosnia_and_herzegovina), "15.69", "42.52",
- "19.67", "45.32", 187122485L, 1),
- new OsmMapValues(getTstring(R.string.czech_republic), "11.91", "48.48", "19.02",
- "51.17", 904838442L, 1),
- new OsmMapValues(getTstring(R.string.croatia), "13.4", "42.1", "19.4", "46.9",
- 460854751L, 1),
- new OsmMapValues(getTstring(R.string.estonia), "21.5", "57.5", "28.2", "59.6",
- 173378927L, 1),
- new OsmMapValues(getTstring(R.string.greece), "28.9", "37.8", "29.0", "37.8",
- 109435051L, 1),
- new OsmMapValues(getTstring(R.string.crete), "23.3", "34.5", "26.8", "36.0",
- 115985063L, 1),
- new OsmMapValues(getTstring(R.string.hungary), "16.08", "45.57", "23.03", "48.39",
- 350318541L, 1),
- new OsmMapValues(getTstring(R.string.latvia), "20.7", "55.6", "28.3", "58.1",
- 188188140L, 1),
- new OsmMapValues(getTstring(R.string.lithuania), "20.9", "53.8", "26.9", "56.5",
- 217852597L, 1),
- new OsmMapValues(getTstring(R.string.poland), "13.6", "48.8", "24.5", "55.0",
- 1464968657L, 1),
- new OsmMapValues(getTstring(R.string.romania), "20.3", "43.5", "29.9", "48.4",
- 347931565L, 1),
- new OsmMapValues(getTstring(R.string.slovakia), "16.8", "47.7", "22.6", "49.7",
- 420533039L, 1),
- new OsmMapValues(getTstring(R.string.ukraine), "22.0", "44.3", "40.4", "52.4",
- 793611912L, 1),
- new OsmMapValues(getTstring(R.string.north_america), "-178.1", "6.5", "-10.4",
- "84.0", 5601866516L, 0),
- new OsmMapValues(getTstring(R.string.alaska), "-179.5", "49.5", "-129", "71.6",
- 207746039L, 1),
- new OsmMapValues(getTstring(R.string.canada), "-141.3", "41.5", "-52.2", "70.2",
- 2635719651L, 1),
- new OsmMapValues(getTstring(R.string.hawaii), "-161.07", "18.49", "-154.45",
- "22.85", 115016656L, 1),
- new OsmMapValues(getTstring(R.string.usa) + getTstring(R.string.except_alaska_and_hawaii),
- "-125.4", "24.3", "-66.5", "49.3", 4060487198L, 1),
- new OsmMapValues(getTstring(R.string.midwest), "-104.11", "35.92", "-80.46",
- "49.46", 1145596450L, 2),
- new OsmMapValues(getTstring(R.string.michigan), "-90.47", "41.64", "-79.00",
- "49.37", 538247019L, 2),
- new OsmMapValues(getTstring(R.string.ohio), "-84.87", "38.05", "-79.85", "43.53",
- 277022336L, 2),
- new OsmMapValues(getTstring(R.string.northeast), "-80.58", "38.72", "-66.83",
- "47.53", 1017160709L, 2),
- new OsmMapValues(getTstring(R.string.massachusetts), "-73.56", "40.78", "-68.67",
- "42.94", 340055487L, 2),
- new OsmMapValues(getTstring(R.string.vermont), "-73.49", "42.68", "-71.41",
- "45.07", 139626067L, 2),
- new OsmMapValues(getTstring(R.string.pacific), "-180.05", "15.87", "-129.75",
- "73.04", 207090640L, 2),
- new OsmMapValues(getTstring(R.string.south), "-106.70", "23.98", "-71.46",
- "40.70", 1747935356L, 2),
- new OsmMapValues(getTstring(R.string.arkansas), "-94.67", "32.95", "-89.59",
- "36.60", 155658661L, 2),
- new OsmMapValues(getTstring(R.string.district_of_columbia), "-77.17", "38.74",
- "-76.86", "39.05", 129235755L, 2),
- new OsmMapValues(getTstring(R.string.florida), "-88.75", "23.63", "-77.67",
- "31.05", 224022108L, 2),
- new OsmMapValues(getTstring(R.string.louisiana), "-94.09", "28.09", "-88.62",
- "33.07", 210120605L, 2),
- new OsmMapValues(getTstring(R.string.maryland), "-79.54", "37.83", "-74.99",
- "40.22", 276462622L, 2),
- new OsmMapValues(getTstring(R.string.mississippi), "-91.71", "29.99", "-88.04",
- "35.05", 177858031L, 2),
- new OsmMapValues(getTstring(R.string.oklahoma), "-103.41", "33.56", "-94.38",
- "37.38", 200061473L, 2),
- new OsmMapValues(getTstring(R.string.texas), "-106.96", "25.62", "-92.97",
- "36.58", 430089141L, 2),
- new OsmMapValues(getTstring(R.string.virginia), "-83.73", "36.49", "-74.25",
- "39.52", 384187569L, 2),
- new OsmMapValues(getTstring(R.string.west_virginia), "-82.70", "37.15", "-77.66",
- "40.97", 220552071L, 2),
- new OsmMapValues(getTstring(R.string.west), "-133.11", "31.28", "-101.99",
- "49.51", 1152909162L, 2),
- new OsmMapValues(getTstring(R.string.arizona), "-114.88", "30.01", "-108.99",
- "37.06", 182826833L, 2),
- new OsmMapValues(getTstring(R.string.california), "-125.94", "32.43", "-114.08",
- "42.07", 586923326L, 2),
- new OsmMapValues(getTstring(R.string.colorado), "-109.11", "36.52", "-100.41",
- "41.05", 228623724L, 2),
- new OsmMapValues(getTstring(R.string.idaho), "-117.30", "41.93", "-110.99",
- "49.18", 170684507L, 2),
- new OsmMapValues(getTstring(R.string.montana), "-116.10", "44.31", "-102.64",
- "49.74", 176229800L, 2),
- new OsmMapValues(getTstring(R.string.new_mexico), "-109.10", "26.98", "-96.07",
- "37.05", 361793070L, 2),
- new OsmMapValues(getTstring(R.string.nevada), "-120.2", "35.0", "-113.8", "42.1",
- 200614482L, 2),
- new OsmMapValues(getTstring(R.string.oregon), "-124.8", "41.8", "-116.3", "46.3",
- 211462685L, 2),
- new OsmMapValues(getTstring(R.string.utah), "-114.11", "36.95", "-108.99",
- "42.05", 151590197L, 2),
- new OsmMapValues(getTstring(R.string.washington_state), "-125.0", "45.5",
- "-116.9", "49.0", 222553768L, 2),
- new OsmMapValues(getTstring(R.string.south_middle_america), "-83.5", "-56.3",
- "-30.8", "13.7", 958895383L, 0),
- new OsmMapValues(getTstring(R.string.argentina), "-73.9", "-57.3", "-51.6",
- "-21.0", 376857648L, 1),
- new OsmMapValues(getTstring(R.string.argentina) + "+" + getTstring(R.string.chile),
- "-77.2", "-56.3", "-52.7", "-16.1", 420275812L, 1),
- new OsmMapValues(getTstring(R.string.bolivia), "-70.5", "-23.1", "-57.3", "-9.3",
- 175937824L, 1),
- new OsmMapValues(getTstring(R.string.brazil), "-71.4", "-34.7", "-32.8", "5.4",
- 664872975L, 1),
- new OsmMapValues(getTstring(R.string.chile), "-81.77", "-58.50", "-65.46",
- "-17.41", 241657330L, 1),
- new OsmMapValues(getTstring(R.string.cuba), "-85.3", "19.6", "-74.0", "23.6",
- 129043575L, 1),
- new OsmMapValues(getTstring(R.string.colombia), "-79.1", "-4.0", "-66.7", "12.6",
- 212016580L, 1),
- new OsmMapValues(getTstring(R.string.ecuador), "-82.6", "-5.4", "-74.4", "2.3",
- 158857591L, 1),
- new OsmMapValues(getTstring(R.string.guyana) + "+" + getTstring(R.string.suriname) + "+"
- + getTstring(R.string.guyane_francaise), "-62.0", "1.0", "-51.2",
- "8.9", 123000072L, 1),
- new OsmMapValues(getTstring(R.string.haiti) + "+" + getTstring(R.string.dominican_republic),
- "-74.8", "17.3", "-68.2", "20.1", 149925689L, 1),
- new OsmMapValues(getTstring(R.string.jamaica), "-78.6", "17.4", "-75.9", "18.9",
- 113961998L, 1),
- new OsmMapValues(getTstring(R.string.mexico), "-117.6", "14.1", "-86.4", "32.8",
- 551307973L, 1),
- new OsmMapValues(getTstring(R.string.paraguay), "-63.8", "-28.1", "-53.6",
- "-18.8", 159498397L, 1),
- new OsmMapValues(getTstring(R.string.peru), "-82.4", "-18.1", "-67.5", "0.4",
- 212490557L, 1),
- new OsmMapValues(getTstring(R.string.uruguay), "-59.2", "-36.5", "-51.7", "-29.7",
- 157482719L, 1),
- new OsmMapValues(getTstring(R.string.venezuela), "-73.6", "0.4", "-59.7", "12.8",
- 167295729L, 1)
+
+ // size estimations updated 2019-10-28
+ new OsmMapValues(R.string.whole_planet, "-180", "-90", "180", "90",
+ 35471336933L, 0),
+ new OsmMapValues(R.string.africa, "-30.89", "-36.17", "61.68", "38.40",
+ 3941558472L, 0),
+ new OsmMapValues(R.string.angola, "11.4", "-18.1", "24.2", "-5.3",
+ 224809554L, 1),
+ new OsmMapValues(R.string.burundi, "28.9", "-4.5", "30.9", "-2.2",
+ 201346208L, 1),
+ new OsmMapValues(R.string.canary_islands, "-18.69", "26.52", "-12.79", "29.99",
+ 191823973L, 1),
+ new OsmMapValues(R.string.congo, "11.7", "-13.6", "31.5", "5.7",
+ 558204116L, 1),
+ new OsmMapValues(R.string.ethiopia, "32.89", "3.33", "48.07", "14.97",
+ 249153700L, 1),
+ new OsmMapValues(R.string.guinea, "-15.47", "7.12", "-7.58", "12.74",
+ 290456408L, 1),
+ new OsmMapValues(R.string.cotedivoire, "-8.72", "4.09", "-2.43", "10.80",
+ 220210996L, 1),
+ new OsmMapValues(R.string.kenya, "33.8", "-5.2", "42.4", "4.9",
+ 402046406L, 1),
+ new OsmMapValues(R.string.lesotho, "26.9", "-30.7", "29.6", "-28.4",
+ 250430629L, 1),
+ new OsmMapValues(R.string.liberia, "-15.00", "-0.73", "-7.20", "8.65",
+ 220130148L, 1),
+ new OsmMapValues(R.string.libya, "9.32", "19.40", "25.54", "33.63",
+ 202766153L, 1),
+ new OsmMapValues(R.string.madagascar, "42.25", "-26.63", "51.20", "-11.31",
+ 231793632L, 1),
+ new OsmMapValues(R.string.namibia, R.string.botswana, "11.4", "-29.1", "29.5", "-16.9",
+ 355183133L, 1),
+ new OsmMapValues(R.string.reunion, "55.2", "-21.4", "55.9", "-20.9",
+ 170953086L, 1),
+ new OsmMapValues(R.string.rwanda, "28.8", "-2.9", "30.9", "-1.0",
+ 213213966L, 1),
+ new OsmMapValues(R.string.south_africa, R.string.lesotho, "15.93", "-36.36", "33.65", "-22.08",
+ 412557227L, 1),
+ new OsmMapValues(R.string.tanzania, "29.19", "-11.87", "40.74", "-0.88",
+ 659878114L, 1),
+ new OsmMapValues(R.string.uganda, "29.3", "-1.6", "35.1", "4.3",
+ 424948047L, 1),
+ new OsmMapValues(R.string.asia, "23.8", "0.1", "195.0", "82.4",
+ 8633755849L, 0),
+ new OsmMapValues(R.string.azerbaijan, "44.74", "38.34", "51.69", "42.37",
+ 208193716L, 1),
+ new OsmMapValues(R.string.china, "67.3", "5.3", "135.0", "54.5",
+ 3071225422L, 1),
+ new OsmMapValues(R.string.cyprus, "32.0", "34.5", "34.9", "35.8",
+ 178895753L, 1),
+ new OsmMapValues(R.string.india, R.string.nepal, "67.9", "5.5", "89.6", "36.0",
+ 1046746656L, 1),
+ new OsmMapValues(R.string.indonesia, "93.7", "-17.3", "155.5", "7.6",
+ 1182281967L, 1),
+ new OsmMapValues(R.string.iran, "43.5", "24.4", "63.6", "40.4",
+ 391459887L, 1),
+ new OsmMapValues(R.string.iraq, "38.7", "28.5", "49.2", "37.4",
+ 244896621L, 1),
+ new OsmMapValues(R.string.israel, "33.99", "29.8", "35.95", "33.4",
+ 236037295L, 1),
+ new OsmMapValues(R.string.japan, R.string.korea, "123.6", "25.2", "151.3", "47.1",
+ 1337474060L, 1),
+ new OsmMapValues(R.string.kazakhstan, "46.44", "40.89", "87.36", "55.45",
+ 661252271L, 1),
+ new OsmMapValues(R.string.kyrgyzsyan, "69.23", "39.13", "80.33", "43.29",
+ 215786962L, 1),
+ new OsmMapValues(R.string.malaysia, R.string.singapore, "94.3", "-5.9", "108.6", "6.8",
+ 339511849L, 1),
+ new OsmMapValues(R.string.mongolia, "87.5", "41.4", "120.3", "52.7",
+ 231652214L, 1),
+ new OsmMapValues(R.string.pakistan, "60.83", "23.28", "77.89", "37.15",
+ 316649335L, 1),
+ new OsmMapValues(R.string.philippines, "115.58", "4.47", "127.85", "21.60",
+ 417733117L, 1),
+ new OsmMapValues(R.string.saudi_arabia, "33.2", "16.1", "55.9", "33.5",
+ 374101149L, 1),
+ new OsmMapValues(R.string.taiwan, "119.1", "21.5", "122.5", "25.2",
+ 213310839L, 1),
+ new OsmMapValues(R.string.thailand, "97.5", "5.7", "105.2", "19.7",
+ 345327944L, 1),
+ new OsmMapValues(R.string.turkey, "25.1", "35.8", "46.4", "42.8",
+ 547969022L, 1),
+ new OsmMapValues(R.string.turkmenistan, "51.78", "35.07", "66.76", "42.91",
+ 197833565L, 1),
+ new OsmMapValues(R.string.uae_other, "51.5", "22.6", "56.7", "26.5",
+ 188885191L, 1),
+ new OsmMapValues(R.string.australia, R.string.oceania, "89.84", "-57.39", "179.79", "7.26",
+ 1767156679L, 0),
+ new OsmMapValues(R.string.australia, "110.5", "-44.2", "154.9", "-9.2",
+ 550526915L, 0),
+ new OsmMapValues(R.string.tasmania, "144.0", "-45.1", "155.3", "-24.8",
+ 377084650L, 1),
+ new OsmMapValues(R.string.victoria, R.string.new_south_wales, "140.7", "-39.4", "153.7", "-26.9",
+ 364316999L, 1),
+ new OsmMapValues(R.string.new_caledonia, "157.85", "-25.05", "174.15", "-16.85",
+ 164225513L, 1),
+ new OsmMapValues(R.string.newzealand, "165.2", "-47.6", "179.1", "-33.7",
+ 350750954L, 1),
+ new OsmMapValues(R.string.europe, "-12.97", "33.59", "34.15", "72.10",
+ 15902268761L, 0),
+ // Is more than 'Europe' from above where 'western europe' should be smaller than europe
+ //new OsmMapValues(R.string.western_europe, "-17.6", "34.5", "42.9", "70.9",
+ // 16879410713L, 1),
+ new OsmMapValues(R.string.austria, "9.4", "46.32", "17.21", "49.1",
+ 1184302570L, 1),
+ new OsmMapValues(R.string.azores, "-31.62", "36.63", "-24.67", "40.13",
+ 171415530L, 1),
+ new OsmMapValues(R.string.belgium, "2.3", "49.5", "6.5", "51.6",
+ 866194492L, 1),
+ new OsmMapValues(R.string.benelux, "2.08", "48.87", "7.78", "54.52",
+ 2075973265L, 1),
+ new OsmMapValues(R.string.netherlands, "3.07", "50.75", "7.23", "53.73",
+ 1388530557L, 1),
+ new OsmMapValues(R.string.denmark, "7.65", "54.32", "15.58", "58.07",
+ 552080821L, 1),
+ new OsmMapValues(R.string.faroe_islands, "-7.8", "61.3", "-6.1", "62.5",
+ 162933852L, 1),
+ new OsmMapValues(R.string.france, R.string.belgium, R.string.luxembourg,
+ "-5.20", "42.20", "8.20", "51.68",
+ 4575442134L, 1),
+ new OsmMapValues(R.string.france, R.string.luxembourg,"-5.20", "42.20", "8.20", "51.10",
+ 3984216361L, 1),
+ new OsmMapValues(R.string.alsace, "6.79", "47.27", "8.48", "49.17",
+ 457980795L, 2),
+ new OsmMapValues(R.string.aquitaine, "-2.27", "42.44", "1.50", "45.76",
+ 590247901L, 2),
+ new OsmMapValues(R.string.auvergne, "2.01", "44.57", "4.54", "46.85",
+ 404857899L, 2),
+ new OsmMapValues(R.string.basse_normandie, "-2.09", "48.13", "1.03", "49.98",
+ 350392952L, 2),
+ new OsmMapValues(R.string.bourgogne, "2.80", "46.11", "5.58", "48.45",
+ 429259997L, 2),
+ new OsmMapValues(R.string.bretagne, "-5.58", "46.95", "-0.96", "48.99",
+ 506377685L, 2),
+ new OsmMapValues(R.string.centre, "0.01", "46.29", "3.18", "48.99",
+ 620373774L, 2),
+ new OsmMapValues(R.string.champagne_ardenne, "3.34", "47.53", "5.94", "50.28",
+ 404110051L, 2),
+ new OsmMapValues(R.string.corse, "8.12", "41.32", "9.95", "43.28",
+ 196000318L, 2),
+ new OsmMapValues(R.string.franche_comte, "5.20", "46.21", "7.83", "48.07",
+ 448854594L, 2),
+ new OsmMapValues(R.string.haute_normandie, "-0.15", "48.62", "1.85", "50.18",
+ 291794192L, 2),
+ new OsmMapValues(R.string.ile_de_france, "1.40", "48.07", "3.61", "49.29",
+ 404250888L, 2),
+ new OsmMapValues(R.string.languedoc_roussillon, "1.53", "42.25", "4.89", "45.02",
+ 509739604L, 2),
+ new OsmMapValues(R.string.limousin, "0.58", "44.87", "2.66", "46.50",
+ 315805128L, 2),
+ new OsmMapValues(R.string.lorraine, "4.84", "47.77", "7.72", "49.73",
+ 433828147L, 2),
+ new OsmMapValues(R.string.midi_pyrenees, "-0.37", "42.18", "3.50", "45.10",
+ 609387039L, 2),
+ new OsmMapValues(R.string.nord_pas_de_calais, "1.42", "49.92", "4.49", "51.31",
+ 480042491L, 2),
+ new OsmMapValues(R.string.pays_de_la_loire, "-2.88", "46.20", "0.97", "48.62",
+ 638031978L, 2),
+ new OsmMapValues(R.string.picardie, "1.25", "48.79", "4.31", "50.43",
+ 480802771L, 2),
+ new OsmMapValues(R.string.poitou_charentes, "-1.69", "45.04", "1.26", "47.23",
+ 459723694L, 2),
+ new OsmMapValues(R.string.provence_alpes_cote_d_azur, "4.21", "42.91", "7.99", "45.18",
+ 491232080L, 2),
+ new OsmMapValues(R.string.rhone_alpes, "3.65", "44.07", "7.88", "46.64",
+ 656454467L, 2),
+ new OsmMapValues(R.string.luxembourg, "5.7", "49.4", "6.5", "50.2",
+ 207870816L, 1),
+ new OsmMapValues(R.string.germany, "5.18", "46.84", "15.47", "55.64",
+ 4258366162L, 1),
+ new OsmMapValues(R.string.baden_wuerttemberg, "7.32", "47.14", "10.57", "49.85",
+ 859363389L, 2),
+ new OsmMapValues(R.string.bayern, "8.92", "47.22", "13.90", "50.62",
+ 1089590692L, 2),
+ new OsmMapValues(R.string.mittelfranken, "9.86", "48.78", "11.65", "49.84",
+ 278839689L, 2),
+ new OsmMapValues(R.string.niederbayern, "11.55", "47.75", "14.12", "49.42",
+ 409234523L, 2),
+ new OsmMapValues(R.string.oberbayern, "10.67", "47.05", "13.57", "49.14",
+ 494705080L, 2),
+ new OsmMapValues(R.string.oberfranken, "10.31", "49.54", "12.49", "50.95",
+ 320127656L, 2),
+ new OsmMapValues(R.string.oberpfalz, "11.14", "48.71", "13.47", "50.43",
+ 345835711L, 2),
+ new OsmMapValues(R.string.schwaben, "9.27", "47.10", "11.36", "49.09",
+ 425231381L, 2),
+ new OsmMapValues(R.string.unterfranken, "8.59", "49.16", "10.93", "50.67",
+ 407153157L, 2),
+ new OsmMapValues(R.string.berlin, "13.03", "52.28", "13.81", "52.73",
+ 232299113L, 2),
+ new OsmMapValues(R.string.brandenburg, "11.17", "51.30", "14.83", "53.63",
+ 429938728L, 2),
+ new OsmMapValues(R.string.bremen, "8.43", "52.96", "9.04", "53.66",
+ 210480663L, 2),
+ new OsmMapValues(R.string.hamburg, "9.56", "53.34", "10.39", "53.80",
+ 215777707L, 2),
+ new OsmMapValues(R.string.hessen, "7.72", "49.34", "10.29", "51.71",
+ 549304606L, 2),
+ new OsmMapValues(R.string.mecklenburg_vorpommern, "10.54", "53.05", "14.48", "55.05",
+ 298273965L, 2),
+ new OsmMapValues(R.string.niedersachsen, "6.40", "51.24", "11.69", "54.22",
+ 973888436L, 2),
+ new OsmMapValues(R.string.nordrhein_westfalen, "5.46", "50.26", "9.52", "52.59",
+ 1121091906L, 2),
+ new OsmMapValues(R.string.rheinland_pfalz, "6.06", "48.91", "8.56", "51.00",
+ 562406978L, 2),
+ new OsmMapValues(R.string.saarland, "6.30", "49.06", "7.46", "49.69",
+ 223614951L, 2),
+ new OsmMapValues(R.string.sachsen_anhalt, "10.50", "50.88", "13.26", "53.11",
+ 380652800L, 2),
+ new OsmMapValues(R.string.sachsen, "11.82", "50.11", "15.10", "51.73",
+ 452296960L, 2),
+ new OsmMapValues(R.string.schleswig_holstein, "7.41", "53.30", "11.98", "55.20",
+ 375552150L, 2),
+ new OsmMapValues(R.string.thueringen, "9.81", "50.15", "12.72", "51.70",
+ 362501525L, 2),
+ new OsmMapValues(R.string.iceland, "-25.3", "62.8", "-11.4", "67.5",
+ 198263647L, 1),
+ new OsmMapValues(R.string.ireland, "-11.17", "51.25", "-5.23", "55.9",
+ 326472032L, 1),
+ new OsmMapValues(R.string.italy, "6.52", "36.38", "18.96", "47.19",
+ 2199756999L, 1),
+ new OsmMapValues(R.string.spain, R.string.portugal, "-11.04", "34.87", "4.62", "44.41",
+ 1442482175L, 1),
+ new OsmMapValues(R.string.mallorca, "2.2", "38.8", "4.7", "40.2",
+ 246286923L, 2),
+ new OsmMapValues(R.string.galicia, "-10.0", "41.7", "-6.3", "44.1",
+ 269729717L, 2),
+ new OsmMapValues(R.string.scandinavia, "4.0", "54.4", "32.1", "71.5",
+ 2545082361L, 1),
+ new OsmMapValues(R.string.finland, "18.6", "59.2", "32.3", "70.3",
+ 919020354L, 1),
+ new OsmMapValues(R.string.denmark, "7.49", "54.33", "13.05", "57.88",
+ 488352770L, 1),
+ new OsmMapValues(R.string.switzerland, "5.79", "45.74", "10.59", "47.84",
+ 731538216L, 1),
+ new OsmMapValues(R.string.united_kingdom, "-9.7", "49.6", "2.2", "61.2",
+ 1205714793L, 1),
+ new OsmMapValues(R.string.england, "-7.80", "48.93", "2.41", "56.14",
+ 1234829532L, 1),
+ new OsmMapValues(R.string.buckinghamshire, "-1.19", "51.44", "-0.43", "52.25",
+ 216717402L, 2),
+ new OsmMapValues(R.string.cambridgeshire, "-0.55", "51.96", "0.56", "52.79",
+ 216306889L, 2),
+ new OsmMapValues(R.string.cumbria, "-3.96", "53.85", "-2.11", "55.24",
+ 227066588L, 2),
+ new OsmMapValues(R.string.east_yorkshire_with_hull, "-1.16", "53.50", "0.54", "54.26",
+ 214532411L, 2),
+ new OsmMapValues(R.string.essex, "-0.07", "51.40", "1.36", "52.14",
+ 242803228L, 2),
+ new OsmMapValues(R.string.herefordshire, "-3.19", "51.78", "-2.29", "52.45",
+ 201746914L, 2),
+ new OsmMapValues(R.string.kent, "-0.02", "50.81", "1.65", "51.53",
+ 222224232L, 2),
+ new OsmMapValues(R.string.lancashire, "-3.20", "53.43", "-2.00", "54.29",
+ 231719236L, 2),
+ new OsmMapValues(R.string.leicestershire, "-1.65", "52.34", "-0.61", "53.03",
+ 231608922L, 2),
+ new OsmMapValues(R.string.norfolk, "0.10", "52.30", "2.04", "53.41",
+ 220583805L, 2),
+ new OsmMapValues(R.string.nottinghamshire, "-1.39", "52.73", "-0.62", "53.55",
+ 222001309L, 2),
+ new OsmMapValues(R.string.oxfordshire, "-1.77", "51.41", "-0.82", "52.22",
+ 215858382L, 2),
+ new OsmMapValues(R.string.shropshire, "-3.29", "52.26", "-2.18", "53.05",
+ 210489688L, 2),
+ new OsmMapValues(R.string.somerset, "-3.89", "50.77", "-2.20", "51.40",
+ 221498821L, 2),
+ new OsmMapValues(R.string.south_yorkshire, "-1.88", "53.25", "-0.80", "53.71",
+ 217566765L, 2),
+ new OsmMapValues(R.string.suffolk, "0.29", "51.88", "1.81", "52.60",
+ 218109848L, 2),
+ new OsmMapValues(R.string.surrey, "-0.90", "51.02", "0.10", "51.52",
+ 238058353L, 2),
+ new OsmMapValues(R.string.wiltshire, "-2.41", "50.90", "-1.44", "51.76",
+ 212963156L, 2),
+ new OsmMapValues(R.string.scotland, "-8.13", "54.49", "-0.15", "61.40",
+ 372486133L, 2),
+ new OsmMapValues(R.string.wales, "-5.56", "51.28", "-2.60", "53.60",
+ 281554024L, 2),
+ new OsmMapValues(R.string.albania, "19.09", "39.55", "21.12", "42.72",
+ 227718134L, 1),
+ new OsmMapValues(R.string.belarus, "23.12", "51.21", "32.87", "56.23",
+ 475885189L, 1),
+ new OsmMapValues(R.string.russian_federation, "27.9", "41.5", "190.4", "77.6",
+ 3368130201L, 1),
+ new OsmMapValues(R.string.bulgaria, "24.7", "42.1", "24.8", "42.1",
+ 162974147L, 1),
+ new OsmMapValues(R.string.bosnia_and_herzegovina, "15.69", "42.52", "19.67", "45.32",
+ 272871917L, 1),
+ new OsmMapValues(R.string.czech_republic, "11.91", "48.48", "19.02", "51.17",
+ 1100792845L, 1),
+ new OsmMapValues(R.string.croatia, "13.4", "42.1", "19.4", "46.9",
+ 718506859L, 1),
+ new OsmMapValues(R.string.estonia, "21.5", "57.5", "28.2", "59.6",
+ 239147853L, 1),
+ new OsmMapValues(R.string.greece, "28.9", "37.8", "29.0", "37.8",
+ 165328625L, 1),
+ new OsmMapValues(R.string.crete, "23.3", "34.5", "26.8", "36.0",
+ 174905198L, 1),
+ new OsmMapValues(R.string.hungary, "16.08", "45.57", "23.03", "48.39",
+ 499823508L, 1),
+ new OsmMapValues(R.string.latvia, "20.7", "55.6", "28.3", "58.1",
+ 272931650L, 1),
+ new OsmMapValues(R.string.lithuania, "20.9", "53.8", "26.9", "56.5",
+ 332328437L, 1),
+ new OsmMapValues(R.string.poland, "13.6", "48.8", "24.5", "55.0",
+ 1849496038L, 1),
+ new OsmMapValues(R.string.romania, "20.3", "43.5", "29.9", "48.4",
+ 497623904L, 1),
+ new OsmMapValues(R.string.slovakia, "16.8", "47.7", "22.6", "49.7",
+ 518251489L, 1),
+ new OsmMapValues(R.string.ukraine, "22.0", "44.3", "40.4", "52.4",
+ 1105659895L, 1),
+ new OsmMapValues(R.string.north_america, "-178.1", "6.5", "-10.4", "84.0",
+ 7727821782L, 0),
+ new OsmMapValues(R.string.alaska, "-179.5", "49.5", "-129", "71.6",
+ 309103093L, 1),
+ new OsmMapValues(R.string.canada, "-141.3", "41.5", "-52.2", "70.2",
+ 3564630901L, 1),
+ new OsmMapValues(R.string.hawaii, "-161.07", "18.49", "-154.45", "22.85",
+ 170132156L, 1),
+ new OsmMapValues(R.string.usa, R.string.except_alaska_and_hawaii, "-125.4", "24.3", "-66.5", "49.3",
+ 5533181627L, 1),
+ new OsmMapValues(R.string.midwest, "-104.11", "35.92", "-80.46", "49.46",
+ 1565753619L, 2),
+ new OsmMapValues(R.string.michigan, "-90.47", "41.64", "-79.00", "49.37",
+ 794434442L, 2),
+ new OsmMapValues(R.string.ohio, "-84.87", "38.05", "-79.85", "43.53",
+ 428282496L, 2),
+ new OsmMapValues(R.string.northeast, "-80.58", "38.72", "-66.83", "47.53",
+ 1391521085L, 2),
+ new OsmMapValues(R.string.massachusetts, "-73.56", "40.78", "-68.67", "42.94",
+ 438012615L, 2),
+ new OsmMapValues(R.string.vermont, "-73.49", "42.68", "-71.41", "45.07",
+ 206957907L, 2),
+ new OsmMapValues(R.string.pacific, "-180.05", "15.87", "-129.75", "73.04",
+ 309809468L, 2),
+ new OsmMapValues(R.string.south, "-106.70", "23.98", "-71.46", "40.70",
+ 2466350986L, 2),
+ new OsmMapValues(R.string.arkansas, "-94.67", "32.95", "-89.59", "36.60",
+ 223752575L, 2),
+ new OsmMapValues(R.string.district_of_columbia, "-77.17", "38.74", "-76.86", "39.05",
+ 201055647L, 2),
+ new OsmMapValues(R.string.florida, "-88.75", "23.63", "-77.67", "31.05",
+ 372359367L, 2),
+ new OsmMapValues(R.string.louisiana, "-94.09", "28.09", "-88.62", "33.07",
+ 290673534L, 2),
+ new OsmMapValues(R.string.maryland, "-79.54", "37.83", "-74.99", "40.22",
+ 409820479L, 2),
+ new OsmMapValues(R.string.mississippi, "-91.71", "29.99", "-88.04", "35.05",
+ 246036091L, 2),
+ new OsmMapValues(R.string.oklahoma, "-103.41", "33.56", "-94.38", "37.38",
+ 265042769L, 2),
+ new OsmMapValues(R.string.texas, "-106.96", "25.62", "-92.97", "36.58",
+ 625570538L, 2),
+ new OsmMapValues(R.string.virginia, "-83.73", "36.49", "-74.25", "39.52",
+ 546119530L, 2),
+ new OsmMapValues(R.string.west_virginia, "-82.70", "37.15", "-77.66", "40.97",
+ 319698480L, 2),
+ new OsmMapValues(R.string.west, "-133.11", "31.28", "-101.99", "49.51",
+ 1501540635L, 2),
+ new OsmMapValues(R.string.arizona, "-114.88", "30.01", "-108.99", "37.06",
+ 276838815L, 2),
+ new OsmMapValues(R.string.california, "-125.94", "32.43", "-114.08", "42.07",
+ 725286705L, 2),
+ new OsmMapValues(R.string.colorado, "-109.11", "36.52", "-100.41", "41.05",
+ 328730867L, 2),
+ new OsmMapValues(R.string.idaho, "-117.30", "41.93", "-110.99", "49.18",
+ 241725898L, 2),
+ new OsmMapValues(R.string.montana, "-116.10", "44.31", "-102.64", "49.74",
+ 246850772L, 2),
+ new OsmMapValues(R.string.new_mexico, "-109.10", "26.98", "-96.07", "37.05",
+ 542205524L, 2),
+ new OsmMapValues(R.string.nevada, "-120.2", "35.0", "-113.8", "42.1",
+ 269630259L, 2),
+ new OsmMapValues(R.string.oregon, "-124.8", "41.8", "-116.3", "46.3",
+ 290552225L, 2),
+ new OsmMapValues(R.string.utah, "-114.11", "36.95", "-108.99", "42.05",
+ 222549404L, 2),
+ new OsmMapValues(R.string.washington_state, "-125.0", "45.5", "-116.9", "49.0",
+ 323577562L, 2),
+ new OsmMapValues(R.string.south_middle_america, "-83.5", "-56.3", "-30.8", "13.7",
+ 1803470489L, 0),
+ new OsmMapValues(R.string.argentina, "-73.9", "-57.3", "-51.6", "-21.0",
+ 640249385L, 1),
+ new OsmMapValues(R.string.argentina, R.string.chile, "-77.2", "-56.3", "-52.7", "-16.1",
+ 713424629L, 1),
+ new OsmMapValues(R.string.bolivia, "-70.5", "-23.1", "-57.3", "-9.3",
+ 257531768L, 1),
+ new OsmMapValues(R.string.brazil, "-71.4", "-34.7", "-32.8", "5.4",
+ 1275564517L, 1),
+ new OsmMapValues(R.string.chile, "-81.77", "-58.50", "-65.46", "-17.41",
+ 400742681L, 1),
+ new OsmMapValues(R.string.cuba, "-85.3", "19.6", "-74.0", "23.6",
+ 190849399L, 1),
+ new OsmMapValues(R.string.colombia, "-79.1", "-4.0", "-66.7", "12.6",
+ 337606776L, 1),
+ new OsmMapValues(R.string.ecuador, "-82.6", "-5.4", "-74.4", "2.3",
+ 231183832L, 1),
+ new OsmMapValues(R.string.guyana, R.string.suriname, R.string.guyane_francaise,
+ "-62.0", "1.0", "-51.2", "8.9",
+ 123000072L, 1),
+ new OsmMapValues(R.string.haiti, R.string.dominican_republic, "-74.8", "17.3", "-68.2", "20.1",
+ 213013324L, 1),
+ new OsmMapValues(R.string.jamaica, "-78.6", "17.4", "-75.9", "18.9",
+ 168748968L, 1),
+ new OsmMapValues(R.string.mexico, "-117.6", "14.1", "-86.4", "32.8",
+ 829539696L, 1),
+ new OsmMapValues(R.string.paraguay, "-63.8", "-28.1", "-53.6", "-18.8",
+ 262841159L, 1),
+ new OsmMapValues(R.string.peru, "-82.4", "-18.1", "-67.5", "0.4",
+ 328138464L, 1),
+ new OsmMapValues(R.string.uruguay, "-59.2", "-36.5", "-51.7", "-29.7",
+ 227796557L, 1),
+ new OsmMapValues(R.string.venezuela, "-73.6", "0.4", "-59.7", "12.8",
+ 262760703L, 1)
};
//we should try to resume
private static final int SOCKET_CONNECT_TIMEOUT = 60000; // 60 secs.
@@ -473,7 +474,6 @@ public class NavitMapDownloader extends Thread {
private static final int UPDATE_PROGRESS_TIME_NS = 1000 * 1000000; // 1ns=1E-9s
private static final int MAX_RETRIES = 5;
private static final String TAG = "NavitMapDownLoader";
- private final String mMapFilenamePath;
private final OsmMapValues mMapValues;
private final int mMapId;
private Boolean mStopMe = false;
@@ -484,7 +484,6 @@ public class NavitMapDownloader extends Thread {
NavitMapDownloader(int mapId) {
this.mMapValues = osm_maps[mapId];
this.mMapId = mapId;
- this.mMapFilenamePath = Navit.sMapFilenamePath;
}
static NavitMap[] getAvailableMaps() {
@@ -539,7 +538,7 @@ public class NavitMapDownloader extends Thread {
if (success || mStopMe) {
NavitDialogs.sendDialogMessage(NavitDialogs.MSG_MAP_DOWNLOAD_FINISHED,
- mMapFilenamePath + mMapValues.mMapName + ".bin", null, -1, success ? 1 : 0, mMapId);
+ Navit.sMapFilenamePath + mMapValues.mMapName + ".bin", null, -1, success ? 1 : 0, mMapId);
}
}
@@ -549,7 +548,7 @@ public class NavitMapDownloader extends Thread {
}
private boolean checkFreeSpace(long neededBytes) {
- long freeSpace = getFreeSpace();
+ long freeSpace = NavitUtils.getFreeSpace(Navit.sMapFilenamePath);
if (neededBytes <= 0) {
neededBytes = MAP_WRITE_FILE_BUFFER;
@@ -575,8 +574,8 @@ public class NavitMapDownloader extends Thread {
File finalOutputFile = getMapFile();
if (finalOutputFile.exists()) {
- Message msg = Message.obtain(NavitGraphics.sCallbackHandler,
- NavitGraphics.MsgType.CLB_DELETE_MAP.ordinal());
+ Message msg = Message.obtain(NavitCallbackHandler.sCallbackHandler,
+ NavitCallbackHandler.MsgType.CLB_DELETE_MAP.ordinal());
Bundle b = new Bundle();
b.putString("title", finalOutputFile.getAbsolutePath());
msg.setData(b);
@@ -649,7 +648,7 @@ public class NavitMapDownloader extends Thread {
}
private File getDestinationFile() {
- File outputFile = new File(mMapFilenamePath, mMapValues.mMapName + ".tmp");
+ File outputFile = new File(Navit.sMapFilenamePath, mMapValues.mMapName + ".tmp");
outputFile.getParentFile().mkdir();
return outputFile;
}
@@ -691,14 +690,6 @@ public class NavitMapDownloader extends Thread {
return url;
}
- private long getFreeSpace() {
- try {
- StatFs fsInfo = new StatFs(mMapFilenamePath);
- return (long) fsInfo.getAvailableBlocks() * fsInfo.getBlockSize();
- } catch (Exception e) {
- return -1;
- }
- }
private BufferedInputStream getInputStream(URLConnection c) {
BufferedInputStream bif;
@@ -720,11 +711,11 @@ public class NavitMapDownloader extends Thread {
}
private File getMapFile() {
- return new File(mMapFilenamePath, mMapValues.mMapName + ".bin");
+ return new File(Navit.sMapFilenamePath, mMapValues.mMapName + ".bin");
}
private File getMapInfoFile() {
- return new File(mMapFilenamePath, mMapValues.mMapName + ".tmp.info");
+ return new File(Navit.sMapFilenamePath, mMapValues.mMapName + ".tmp.info");
}
private BufferedOutputStream getOutputStream(File outputFile, boolean resume) {
@@ -888,21 +879,18 @@ public class NavitMapDownloader extends Thread {
mRetryCounter++;
}
+
static class OsmMapValues {
- final String mLon1;
- final String mLat1;
- final String mLon2;
- final String mLat2;
+ String mLon1;
+ String mLat1;
+ String mLon2;
+ String mLat2;
final String mMapName;
- final long mEstSizeBytes;
- final int mLevel;
+ long mEstSizeBytes;
+ int mLevel;
-
- private OsmMapValues(String mapName, String lon1, String lat1, String lon2,
- String lat2,
- long bytesEst, int level) {
- this.mMapName = mapName;
+ private void setMapValues(String lon1, String lat1, String lon2, String lat2, long bytesEst, int level) {
this.mLon1 = lon1;
this.mLat1 = lat1;
this.mLon2 = lon2;
@@ -911,6 +899,29 @@ public class NavitMapDownloader extends Thread {
this.mLevel = level;
}
+ private OsmMapValues(int id1, String lon1, String lat1, String lon2, String lat2,
+ long bytesEst, int level) {
+
+ this.mMapName = getTstring(id1);
+ setMapValues(lon1, lat1, lon2, lat2, bytesEst, level);
+ }
+
+ private OsmMapValues(int id1, int id2, String lon1, String lat1, String lon2, String lat2,
+ long bytesEst, int level) {
+
+ this.mMapName = getTstring(id1) + " + " + getTstring(id2);
+ setMapValues(lon1, lat1, lon2, lat2, bytesEst, level);
+ }
+
+
+ private OsmMapValues(int id1, int id2, int id3, String lon1, String lat1, String lon2, String lat2,
+ long bytesEst, int level) {
+
+ mMapName = getTstring(id1) + " + " + getTstring(id2) + " + " + getTstring(id3);
+ setMapValues(lon1, lat1, lon2, lat2, bytesEst, level);
+ }
+
+
boolean isInMap(Location location) {
if (location.getLongitude() < Double.valueOf(this.mLon1)) {
diff --git a/navit/android/src/org/navitproject/navit/NavitRestoreTask.java b/navit/android/src/org/navitproject/navit/NavitRestoreTask.java
index 2e10e896e..d5fe43afd 100644
--- a/navit/android/src/org/navitproject/navit/NavitRestoreTask.java
+++ b/navit/android/src/org/navitproject/navit/NavitRestoreTask.java
@@ -58,18 +58,18 @@ public class NavitRestoreTask extends AsyncTask<Void, Void, String> {
ObjectInputStream preferenceOis = null;
try {
/* Delete all old Files in Home */
- NavitUtils.removeFileIfExists(Navit.sNavitDataDir + "/home/bookmark.txt");
- NavitUtils.removeFileIfExists(Navit.sNavitDataDir + "/home/destination.txt");
- NavitUtils.removeFileIfExists(Navit.sNavitDataDir + "/home/gui_internal.txt");
+ NavitUtils.removeFileIfExists(Navit.sMapFilenamePath + "/home/bookmark.txt");
+ NavitUtils.removeFileIfExists(Navit.sMapFilenamePath + "/home/destination.txt");
+ NavitUtils.removeFileIfExists(Navit.sMapFilenamePath + "/home/gui_internal.txt");
/* Restore Files in home */
NavitUtils.copyFileIfExists(backupDir.getPath() + "/bookmark.txt",
- Navit.sNavitDataDir + "/home/bookmark.txt");
+ Navit.sMapFilenamePath + "/home/bookmark.txt");
NavitUtils.copyFileIfExists(backupDir.getPath() + "/destination.txt",
- Navit.sNavitDataDir + "/home/destination.txt");
+ Navit.sMapFilenamePath + "/home/destination.txt");
NavitUtils.copyFileIfExists(backupDir.getPath() + "/gui_internal.txt",
- Navit.sNavitDataDir + "/home/gui_internal.txt");
+ Navit.sMapFilenamePath + "/home/gui_internal.txt");
/* Restore Shared Preferences */
preferenceOis = new ObjectInputStream(
diff --git a/navit/android/src/org/navitproject/navit/NavitSensors.java b/navit/android/src/org/navitproject/navit/NavitSensors.java
index 3ffb6457a..828825d41 100644
--- a/navit/android/src/org/navitproject/navit/NavitSensors.java
+++ b/navit/android/src/org/navitproject/navit/NavitSensors.java
@@ -46,8 +46,10 @@ class NavitSensors implements SensorEventListener {
}
public void onSensorChanged(SensorEvent sev) {
- Log.v("NavitSensor","Type:" + sev.sensor.getType() + " X:" + sev.values[0] + " Y:"
- + sev.values[1] + " Z:" + sev.values[2]);
+ // type TYPE_MAGNETIC_FIELD = 2
+ // type TYPE_ACCELEROMETER = 1
+ //Log.v("NavitSensor","Type:" + sev.sensor.getType() + " X:" + sev.values[0] + " Y:"
+ // + sev.values[1] + " Z:" + sev.values[2]);
sensorCallback(mCallbackid, sev.sensor.getType(), sev.values[0], sev.values[1], sev.values[2]);
}
}
diff --git a/navit/android/src/org/navitproject/navit/NavitUtils.java b/navit/android/src/org/navitproject/navit/NavitUtils.java
index bbdf6539e..e163c5576 100644
--- a/navit/android/src/org/navitproject/navit/NavitUtils.java
+++ b/navit/android/src/org/navitproject/navit/NavitUtils.java
@@ -8,6 +8,12 @@ import java.io.IOException;
class NavitUtils {
+ static long getFreeSpace(String path) {
+
+ File file = new File(path);
+ return file.getUsableSpace();
+ }
+
static void removeFileIfExists(String source) {
File file = new File(source);
diff --git a/navit/android/src/org/navitproject/navit/NavitVehicle.java b/navit/android/src/org/navitproject/navit/NavitVehicle.java
index e8c43e474..e72679c3e 100644
--- a/navit/android/src/org/navitproject/navit/NavitVehicle.java
+++ b/navit/android/src/org/navitproject/navit/NavitVehicle.java
@@ -67,6 +67,7 @@ public class NavitVehicle {
sLocationManager.removeUpdates(sFastLocationListener);
mFastProvider = null;
}
+ sLastLocation = location;
vehicleCallback(mVehiclePcbid, location);
vehicleCallback(mVehicleFcbid, 1);
}
diff --git a/navit/coord.h b/navit/coord.h
index cad6a86e8..f3601830d 100644
--- a/navit/coord.h
+++ b/navit/coord.h
@@ -113,13 +113,13 @@ struct coord_geo_cart {
enum coord_format
{
/**
- * Degrees with absolute decimal places (positive or negative)
- * ie -20.500000 -110.500000
- */
+ * Degrees with absolute decimal places (positive or negative)
+ * ie -20.500000 -110.500000
+ */
DEGREES_DECIMAL_ABSOLUTE,
/**
- * Degrees with decimal places.
+ * Degrees with decimal places (positive with heading)
* ie 20.500000°N 110.500000°E
*/
DEGREES_DECIMAL,
diff --git a/navit/graphics.c b/navit/graphics.c
index bc3177322..b3b9e54c2 100644
--- a/navit/graphics.c
+++ b/navit/graphics.c
@@ -1120,10 +1120,21 @@ static void graphics_draw_polygon_with_holes(struct graphics *gra, struct graphi
graphics_draw_polygon(gra, gc, pin, count_in);
return;
} else {
- struct point * pin_scaled = g_alloca(sizeof (struct point)*count_in);
- struct point ** holes_scaled = g_alloca(sizeof (struct point *)*hole_count);
+ int limit=10000;
+ struct point * pin_scaled;
+ struct point ** holes_scaled;
int a;
int b;
+ if(count_in < limit) {
+ pin_scaled = g_alloca(sizeof (struct point)*count_in);
+ } else {
+ pin_scaled = g_malloc(sizeof (struct point)*count_in);
+ }
+ if(hole_count < limit) {
+ holes_scaled = g_alloca(sizeof (struct point *)*hole_count);
+ } else {
+ holes_scaled = g_malloc(sizeof (struct point *)*hole_count);
+ }
/* scale the outline */
for(a=0; a < count_in; a ++)
pin_scaled[a] = graphics_dpi_scale_point(gra,&(pin[a]));
@@ -1137,6 +1148,10 @@ static void graphics_draw_polygon_with_holes(struct graphics *gra, struct graphi
/* free the hole arrays */
for(b=0; b < hole_count; b ++)
g_free(holes_scaled[b]);
+ if(count_in >= limit)
+ g_free(pin_scaled);
+ if(hole_count >= limit)
+ g_free(holes_scaled);
}
}
@@ -2321,14 +2336,13 @@ static void graphics_clip_polygon(struct point_rect * r, struct point * in, int
void graphics_draw_polygon_clipped(struct graphics *gra, struct graphics_gc *gc, struct point *pin, int count_in) {
struct point_rect r=gra->r;
int limit=10000;
- struct point *pa1=g_alloca(sizeof(struct point) * (count_in < limit ? count_in*8+1:0));
struct point *clipped;
int count_out = count_in*8+1;
/* prepare buffer */
if (count_in < limit) {
/* use on stack buffer */
- clipped=pa1;
+ clipped=g_alloca(sizeof(struct point) * (count_in < limit ? count_in*8+1:0));
} else {
/* too big. allocate buffer (slower) */
clipped=g_new(struct point, count_in*8+1);
@@ -2360,7 +2374,6 @@ static void graphics_draw_polygon_with_holes_clipped(struct graphics *gra, struc
int i;
struct point_rect r=gra->r;
int limit=10000;
- struct point *pa1;
struct point *clipped;
int total_count_in;
int count_out;
@@ -2368,6 +2381,7 @@ static void graphics_draw_polygon_with_holes_clipped(struct graphics *gra, struc
int found_hole_count;
int *found_ccount;
struct point ** found_holes;
+ int need_free;
/* get total node count for polygon plus all holes */
total_count_in = count_in;
for(i = 0; i < hole_count; i ++) {
@@ -2375,20 +2389,28 @@ static void graphics_draw_polygon_with_holes_clipped(struct graphics *gra, struc
}
count_out = total_count_in*8+1+hole_count;
- /* prepare buffer */
- pa1=g_alloca(sizeof(struct point) * (total_count_in < limit ? total_count_in*8+1:0));
- if (count_in < limit) {
+ /* prepare buffer for outer and all holes!*/
+ if (count_out < limit) {
/* use on stack buffer */
- clipped=pa1;
+ clipped=g_alloca(sizeof(struct point) * count_out);
+ /* no need to free on stack buffer */
+ need_free=0;
} else {
/* too big. allocate buffer (slower) */
- clipped=g_new(struct point, count_in*8+1);
+ clipped=g_new(struct point, count_out);
+ /* remember to free this, as we change count_out soon */
+ need_free=1;
}
count_used=0;
/* prepare arrays for new holes */
- found_ccount=g_alloca(sizeof(int)*hole_count);
- found_holes=g_alloca(sizeof(struct point*)*hole_count);
+ if(hole_count < limit) {
+ found_ccount=g_alloca(sizeof(int)* hole_count);
+ found_holes=g_alloca(sizeof(struct point*)* hole_count);
+ } else {
+ found_ccount=g_malloc(sizeof(int)* hole_count);
+ found_holes=g_malloc(sizeof(struct point*)* hole_count);
+ }
found_hole_count=0;
/* clip outer polygon */
@@ -2409,9 +2431,12 @@ static void graphics_draw_polygon_with_holes_clipped(struct graphics *gra, struc
}
/* call drawing function */
graphics_draw_polygon_with_holes(gra, gc, clipped, count_out, found_hole_count, found_ccount, found_holes);
-
+ if(hole_count >= limit) {
+ g_free(found_ccount);
+ g_free(found_holes);
+ }
/* if we had to allocate buffer, free it */
- if (total_count_in >= limit) {
+ if (need_free) {
g_free(clipped);
}
}
diff --git a/navit/graphics/android/graphics_android.c b/navit/graphics/android/graphics_android.c
index 36a1ce589..030c9f3ab 100644
--- a/navit/graphics/android/graphics_android.c
+++ b/navit/graphics/android/graphics_android.c
@@ -546,7 +546,7 @@ static void resize_callback(struct graphics_priv *gra, int w, int h) {
static void padding_changed_callback(struct graphics_priv *gra, int left, int top, int right,
int bottom) {
- dbg(lvl_error, "win.padding left=%d top=%d right=%d bottom=%d", left, top, right, bottom);
+ dbg(lvl_debug, "win.padding left=%d top=%d right=%d bottom=%d", left, top, right, bottom);
gra->padding->left = left;
gra->padding->top = top;
gra->padding->right = right;
diff --git a/navit/graphics/qt5/event_qt5.cpp b/navit/graphics/qt5/event_qt5.cpp
index 99361011c..1c6f0e685 100644
--- a/navit/graphics/qt5/event_qt5.cpp
+++ b/navit/graphics/qt5/event_qt5.cpp
@@ -92,7 +92,6 @@ void qt5_navit_timer::timerEvent(QTimerEvent* event) {
qt5_navit_timer* qt5_timer = NULL;
static void event_qt5_main_loop_run(void) {
-
dbg(lvl_debug, "enter");
if (navit_app != NULL)
navit_app->exec();
diff --git a/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp b/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
index 423f3d5fb..b293b2a56 100644
--- a/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
+++ b/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
@@ -39,17 +39,17 @@ static void overlay_rect(struct graphics_priv *parent, struct graphics_priv *ove
struct point p;
int w,h;
if (clean) {
- p=overlay->pclean;
+ p = overlay->pclean;
} else {
- p=overlay->p;;
+ p = overlay->p;;
}
- w=overlay->widget->pixmap->width();
- h=overlay->widget->pixmap->height();
+ w = overlay->widget->pixmap->width();
+ h = overlay->widget->pixmap->height();
if (overlay->wraparound) {
if (p.x < 0)
- p.x+=parent->widget->pixmap->width();
+ p.x += parent->widget->pixmap->width();
if (p.y < 0)
- p.y+=parent->widget->pixmap->height();
+ p.y += parent->widget->pixmap->height();
if (w < 0)
w += parent->widget->pixmap->width();
if (h < 0)
@@ -77,9 +77,9 @@ void qt_qpainter_draw(struct graphics_priv *gr, const QRect *r, int paintev) {
}
QPixmap pixmap(r->width(),r->height());
QPainter painter(&pixmap);
- struct graphics_priv *overlay=NULL;
+ struct graphics_priv *overlay = NULL;
if (! gr->overlay_disable)
- overlay=gr->overlays;
+ overlay = gr->overlays;
if ((gr->p.x || gr->p.y) && gr->background_gc) {
painter.setPen(*gr->background_gc->pen);
painter.fillRect(0, 0, gr->widget->pixmap->width(), gr->widget->pixmap->height(), *gr->background_gc->brush);
@@ -90,17 +90,17 @@ void qt_qpainter_draw(struct graphics_priv *gr, const QRect *r, int paintev) {
overlay_rect(gr, overlay, 0, &ovr);
if (!overlay->overlay_disable && r->intersects(ovr)) {
unsigned char *data;
- int i,size=ovr.width()*ovr.height();
- QImage img=overlay->widget->pixmap->toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied);
- data=img.bits();
+ int i,size = ovr.width()*ovr.height();
+ QImage img = overlay->widget->pixmap->toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied);
+ data = img.bits();
for (i = 0 ; i < size ; i++) {
if (data[0] == overlay->rgba[0] && data[1] == overlay->rgba[1] && data[2] == overlay->rgba[2])
- data[3]=overlay->rgba[3];
- data+=4;
+ data[3] = overlay->rgba[3];
+ data += 4;
}
painter.drawImage(QPoint(ovr.x()-r->x(),ovr.y()-r->y()), img);
}
- overlay=overlay->next;
+ overlay = overlay->next;
}
#ifndef QT_QPAINTER_NO_WIDGET
QPainter painterw(gr->widget);
@@ -153,7 +153,6 @@ static void graphics_destroy(struct graphics_priv *gr) {
//# Authors: Martin Schaller (04/2008)
//##############################################################################################################
static void font_destroy(struct graphics_font_priv *font) {
-
}
//##############################################################################################################
@@ -170,10 +169,11 @@ static struct graphics_font_methods font_methods = {
//# Comment:
//# Authors: Martin Schaller (04/2008)
//##############################################################################################################
-static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, char *fontfamily, int size, int flags) {
- struct graphics_font_priv *ret=g_new0(struct graphics_font_priv, 1);
- ret->font=new QFont("Arial",size/20);
- *meth=font_methods;
+static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth,
+ char *fontfamily, int size, int flags) {
+ struct graphics_font_priv *ret = g_new0(struct graphics_font_priv, 1);
+ ret->font = new QFont("Arial",size/20);
+ *meth = font_methods;
return ret;
}
@@ -214,7 +214,7 @@ static void gc_set_foreground(struct graphics_gc_priv *gc, struct color *c) {
QColor col(c->r >> 8, c->g >> 8, c->b >> 8 /* , c->a >> 8 */);
gc->pen->setColor(col);
gc->brush->setColor(col);
- gc->c=*c;
+ gc->c = *c;
}
//##############################################################################################################
@@ -244,10 +244,10 @@ static struct graphics_gc_methods gc_methods = {
//# Authors: Martin Schaller (04/2008)
//##############################################################################################################
static struct graphics_gc_priv *gc_new(struct graphics_priv *gr, struct graphics_gc_methods *meth) {
- *meth=gc_methods;
- struct graphics_gc_priv *ret=g_new0(struct graphics_gc_priv, 1);
- ret->pen=new QPen();
- ret->brush=new QBrush(Qt::SolidPattern);
+ *meth = gc_methods;
+ struct graphics_gc_priv *ret = g_new0(struct graphics_gc_priv, 1);
+ ret->pen = new QPen();
+ ret->brush = new QBrush(Qt::SolidPattern);
return ret;
}
@@ -256,14 +256,15 @@ static struct graphics_gc_priv *gc_new(struct graphics_priv *gr, struct graphics
//# Comment:
//# Authors: Martin Schaller (04/2008)
//##############################################################################################################
-static struct graphics_image_priv * image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *path, int *w, int *h, struct point *hot, int rotation) {
+static struct graphics_image_priv * image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *path,
+ int *w, int *h, struct point *hot, int rotation) {
struct graphics_image_priv *ret;
QPixmap *cachedPixmap;
QString key(path);
- ret=g_new0(struct graphics_image_priv, 1);
+ ret = g_new0(struct graphics_image_priv, 1);
- cachedPixmap=QPixmapCache::find(key);
+ cachedPixmap = QPixmapCache::find(key);
if (!cachedPixmap) {
#ifdef HAVE_QT_SVG
if(key.endsWith(".svg", Qt::CaseInsensitive)) {
@@ -272,18 +273,15 @@ static struct graphics_image_priv * image_new(struct graphics_priv *gr, struct g
g_free(ret);
return NULL;
}
- ret->pixmap=new QPixmap(renderer.defaultSize());
+ ret->pixmap = new QPixmap(renderer.defaultSize());
ret->pixmap->fill(Qt::transparent);
QPainter painter(ret->pixmap);
renderer.render(&painter);
-
} else {
-
- ret->pixmap=new QPixmap(path);
-
+ ret->pixmap = new QPixmap(path);
}
#else
- ret->pixmap=new QPixmap(path);
+ ret->pixmap = new QPixmap(path);
#endif /* QT__VERSION */
if (ret->pixmap->isNull()) {
g_free(ret);
@@ -292,14 +290,14 @@ static struct graphics_image_priv * image_new(struct graphics_priv *gr, struct g
QPixmapCache::insert(key,QPixmap(*ret->pixmap));
} else {
- ret->pixmap=new QPixmap(*cachedPixmap);
+ ret->pixmap = new QPixmap(*cachedPixmap);
}
- *w=ret->pixmap->width();
- *h=ret->pixmap->height();
+ *w = ret->pixmap->width();
+ *h = ret->pixmap->height();
if (hot) {
- hot->x=*w/2;
- hot->y=*h/2;
+ hot->x = *w/2;
+ hot->y = *h/2;
}
return ret;
@@ -354,7 +352,6 @@ static void draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc
static void draw_circle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int r) {
gr->painter->setPen(*gc->pen);
gr->painter->drawArc(p->x-r/2, p->y-r/2, r, r, 0, 360*16);
-
}
//##############################################################################################################
@@ -362,12 +359,13 @@ static void draw_circle(struct graphics_priv *gr, struct graphics_gc_priv *gc, s
//# Comment:
//# Authors: Martin Schaller (04/2008)
//##############################################################################################################
-static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy) {
- QPainter *painter=gr->painter;
+static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg,
+ struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy) {
+ QPainter *painter = gr->painter;
#ifndef QT_QPAINTER_USE_FREETYPE
- QString tmp=QString::fromUtf8(text);
+ QString tmp = QString::fromUtf8(text);
#ifndef QT_NO_TRANSFORMATIONS
- QMatrix sav=gr->painter->worldMatrix();
+ QMatrix sav = gr->painter->worldMatrix();
QMatrix m(dx/65535.0,dy/65535.0,-dy/65535.0,dx/65535.0,p->x,p->y);
painter->setWorldMatrix(m,TRUE);
painter->setPen(*fg->pen);
@@ -383,48 +381,48 @@ static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, str
struct font_freetype_text *t;
struct font_freetype_glyph *g, **gp;
struct color transparent = {0x0000, 0x0000, 0x0000, 0x0000};
- struct color *fgc=&fg->c, *bgc=&bg->c;
+ struct color *fgc = &fg->c, *bgc = &bg->c;
int i,x,y;
if (! font)
return;
- t=gr->freetype_methods.text_new(text, (struct font_freetype_font *)font, dx, dy);
- x=p->x << 6;
- y=p->y << 6;
- gp=t->glyph;
- i=t->glyph_count;
+ t = gr->freetype_methods.text_new(text, (struct font_freetype_font *)font, dx, dy);
+ x = p->x << 6;
+ y = p->y << 6;
+ gp = t->glyph;
+ i = t->glyph_count;
if (bg) {
while (i-- > 0) {
- g=*gp++;
+ g = *gp++;
if (g->w && g->h) {
unsigned char *data;
QImage img(g->w+2, g->h+2, QImage::Format_ARGB32_Premultiplied);
- data=img.bits();
+ data = img.bits();
gr->freetype_methods.get_shadow(g,(unsigned char *)data,img.bytesPerLine(),bgc,&transparent);
painter->drawImage(((x+g->x)>>6)-1, ((y+g->y)>>6)-1, img);
}
- x+=g->dx;
- y+=g->dy;
+ x += g->dx;
+ y += g->dy;
}
} else
- bgc=&transparent;
- x=p->x << 6;
- y=p->y << 6;
- gp=t->glyph;
- i=t->glyph_count;
+ bgc = &transparent;
+ x = p->x << 6;
+ y = p->y << 6;
+ gp = t->glyph;
+ i = t->glyph_count;
while (i-- > 0) {
- g=*gp++;
+ g = *gp++;
if (g->w && g->h) {
unsigned char *data;
QImage img(g->w, g->h, QImage::Format_ARGB32_Premultiplied);
- data=img.bits();
+ data = img.bits();
gr->freetype_methods.get_glyph(g,(unsigned char *)data,img.bytesPerLine(),fgc,bgc,&transparent);
painter->drawImage((x+g->x)>>6, (y+g->y)>>6, img);
}
- x+=g->dx;
- y+=g->dy;
+ x += g->dx;
+ y += g->dy;
}
gr->freetype_methods.text_destroy(t);
#endif
@@ -435,20 +433,21 @@ static void draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, str
//# Comment:
//# Authors: Martin Schaller (04/2008)
//##############################################################################################################
-static void draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img) {
+static void draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p,
+ struct graphics_image_priv *img) {
gr->painter->drawPixmap(p->x, p->y, *img->pixmap);
}
static void draw_drag(struct graphics_priv *gr, struct point *p) {
if (!gr->cleanup) {
- gr->pclean=gr->p;
- gr->cleanup=1;
+ gr->pclean = gr->p;
+ gr->cleanup = 1;
}
if (p)
- gr->p=*p;
+ gr->p = *p;
else {
- gr->p.x=0;
- gr->p.y=0;
+ gr->p.x = 0;
+ gr->p.y = 0;
}
}
@@ -458,11 +457,11 @@ static void draw_drag(struct graphics_priv *gr, struct point *p) {
//# Authors: Martin Schaller (04/2008)
//##############################################################################################################
static void background_gc(struct graphics_priv *gr, struct graphics_gc_priv *gc) {
- gr->background_gc=gc;
- gr->rgba[2]=gc->c.r >> 8;
- gr->rgba[1]=gc->c.g >> 8;
- gr->rgba[0]=gc->c.b >> 8;
- gr->rgba[3]=gc->c.a >> 8;
+ gr->background_gc = gc;
+ gr->rgba[2] = gc->c.r >> 8;
+ gr->rgba[1] = gc->c.g >> 8;
+ gr->rgba[0] = gc->c.b >> 8;
+ gr->rgba[3] = gc->c.a >> 8;
}
@@ -486,7 +485,7 @@ static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode) {
if (gr->cleanup) {
overlay_rect(gr->parent, gr, 1, &r);
qt_qpainter_draw(gr->parent, &r, 0);
- gr->cleanup=0;
+ gr->cleanup = 0;
}
overlay_rect(gr->parent, gr, 0, &r);
qt_qpainter_draw(gr->parent, &r, 0);
@@ -498,7 +497,7 @@ static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode) {
QCoreApplication::processEvents(
QEventLoop::ExcludeUserInputEvents|QEventLoop::ExcludeSocketNotifiers|QEventLoop::DeferredDeletion|QEventLoop::X11ExcludeTimers);
}
- gr->mode=mode;
+ gr->mode = mode;
}
//##############################################################################################################
@@ -509,17 +508,17 @@ static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode) {
static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p,
int w, int h,int wraparound);
-static int argc=1;
-static char *argv[]= {NULL,NULL,NULL};
+static int argc = 1;
+static char *argv[] = {NULL,NULL,NULL};
static int fullscreen(struct window *win, int on) {
#ifndef QT_QPAINTER_NO_WIDGET
- struct graphics_priv *this_=(struct graphics_priv *)win->priv;
+ struct graphics_priv *this_ = (struct graphics_priv *)win->priv;
QWidget* _outerWidget;
#ifdef QT_QPAINTER_USE_EMBEDDING
- _outerWidget=(QWidget*)this_->widget->parent();
+ _outerWidget = (QWidget*)this_->widget->parent();
#else
- _outerWidget=this_->widget;
+ _outerWidget = this_->widget;
#endif /* QT_QPAINTER_USE_EMBEDDING */
if (on)
_outerWidget->showFullScreen();
@@ -531,7 +530,7 @@ static int fullscreen(struct window *win, int on) {
static void disable_suspend(struct window *win) {
#ifdef HAVE_QPE
- struct graphics_priv *this_=(struct graphics_priv *)win->priv;
+ struct graphics_priv *this_ = (struct graphics_priv *)win->priv;
this_->app->setTempScreenSaverMode(QPEApplication::DisableLightOff);
#endif
}
@@ -556,11 +555,11 @@ static void * get_data(struct graphics_priv *this_, const char *type) {
if (!strcmp(type, "qt_pixmap"))
return this_->widget->pixmap;
if (!strcmp(type, "window")) {
- win=g_new(struct window, 1);
+ win = g_new(struct window, 1);
#ifndef QT_QPAINTER_NO_WIDGET
#ifdef QT_QPAINTER_USE_EMBEDDING
- EmbeddedWidget* _outerWidget=new EmbeddedWidget(this_,this_->widget,NULL);
- xid=getenv("NAVIT_XID");
+ EmbeddedWidget* _outerWidget = new EmbeddedWidget(this_,this_->widget,NULL);
+ xid = getenv("NAVIT_XID");
if (xid.length()>0) {
_outerWidget->embedInto(xid.toULong(&ok,0));
}
@@ -571,9 +570,9 @@ static void * get_data(struct graphics_priv *this_, const char *type) {
else
this_->widget->showMaximized();
#endif /* QT_QPAINTER_NO_WIDGET */
- win->priv=this_;
- win->fullscreen=fullscreen;
- win->disable_suspend=disable_suspend;
+ win->priv = this_;
+ win->fullscreen = fullscreen;
+ win->disable_suspend = disable_suspend;
return win;
}
return NULL;
@@ -584,19 +583,20 @@ static void image_free(struct graphics_priv *gr, struct graphics_image_priv *pri
g_free(priv);
}
-static void get_text_bbox(struct graphics_priv *gr, struct graphics_font_priv *font, char *text, int dx, int dy, struct point *ret, int estimate) {
- QPainter *painter=gr->painter;
- QString tmp=QString::fromUtf8(text);
+static void get_text_bbox(struct graphics_priv *gr, struct graphics_font_priv *font, char *text, int dx, int dy,
+ struct point *ret, int estimate) {
+ QPainter *painter = gr->painter;
+ QString tmp = QString::fromUtf8(text);
painter->setFont(*font->font);
- QRect r=painter->boundingRect(0,0,gr->w,gr->h,0,tmp);
- ret[0].x=0;
- ret[0].y=-r.height();
- ret[1].x=0;
- ret[1].y=0;
- ret[2].x=r.width();
- ret[2].y=0;
- ret[3].x=r.width();
- ret[3].y=-r.height();
+ QRect r = painter->boundingRect(0,0,gr->w,gr->h,0,tmp);
+ ret[0].x = 0;
+ ret[0].y = -r.height();
+ ret[1].x = 0;
+ ret[1].y = 0;
+ ret[2].x = r.width();
+ ret[2].y = 0;
+ ret[3].x = r.width();
+ ret[3].y = -r.height();
}
@@ -606,7 +606,7 @@ static void get_text_bbox(struct graphics_priv *gr, struct graphics_font_priv *f
//# Authors: Martin Schaller (04/2008)
//##############################################################################################################
static void overlay_disable(struct graphics_priv *gr, int disable) {
- gr->overlay_disable=disable;
+ gr->overlay_disable = disable;
}
//##############################################################################################################
@@ -617,14 +617,14 @@ static void overlay_disable(struct graphics_priv *gr, int disable) {
static int set_attr(struct graphics_priv *gr, struct attr *attr) {
switch (attr->type) {
case attr_w:
- gr->w=attr->u.num;
+ gr->w = attr->u.num;
if (gr->w != 0 && gr->h != 0) {
QSize size(gr->w,gr->h);
gr->widget->do_resize(size);
}
break;
case attr_h:
- gr->h=attr->u.num;
+ gr->h = attr->u.num;
if (gr->w != 0 && gr->h != 0) {
QSize size(gr->w,gr->h);
gr->widget->do_resize(size);
@@ -672,26 +672,27 @@ static struct graphics_methods graphics_methods = {
//# Comment:
//# Authors: Martin Schaller (04/2008)
//##############################################################################################################
-static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h,int wraparound) {
- *meth=graphics_methods;
- struct graphics_priv *ret=g_new0(struct graphics_priv, 1);
+static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p,
+ int w, int h,int wraparound) {
+ *meth = graphics_methods;
+ struct graphics_priv *ret = g_new0(struct graphics_priv, 1);
#ifdef QT_QPAINTER_USE_FREETYPE
if (gr->font_freetype_new) {
- ret->font_freetype_new=gr->font_freetype_new;
+ ret->font_freetype_new = gr->font_freetype_new;
gr->font_freetype_new(&ret->freetype_methods);
- meth->font_new=(struct graphics_font_priv *(*)(struct graphics_priv *, struct graphics_font_methods *, char *, int,
- int))ret->freetype_methods.font_new;
- meth->get_text_bbox=(void (*)(struct graphics_priv*, struct graphics_font_priv*, char*, int, int, struct point*,
- int))ret->freetype_methods.get_text_bbox;
+ meth->font_new = (struct graphics_font_priv *(*)(struct graphics_priv *, struct graphics_font_methods *, char *, int,
+ int))ret->freetype_methods.font_new;
+ meth->get_text_bbox = (void (*)(struct graphics_priv*, struct graphics_font_priv*, char*, int, int, struct point*,
+ int))ret->freetype_methods.get_text_bbox;
}
#endif
- ret->widget= new RenderArea(ret,gr->widget,w,h,1);
- ret->wraparound=wraparound;
- ret->painter=new QPainter;
- ret->p=*p;
- ret->parent=gr;
- ret->next=gr->overlays;
- gr->overlays=ret;
+ ret->widget = new RenderArea(ret,gr->widget,w,h,1);
+ ret->wraparound = wraparound;
+ ret->painter = new QPainter;
+ ret->p = *p;
+ ret->parent = gr;
+ ret->next = gr->overlays;
+ gr->overlays = ret;
#ifndef QT_QPAINTER_NO_WIDGET
ret->widget->hide();
#endif
@@ -714,11 +715,11 @@ static void event_qt_main_loop_quit(void) {
static struct event_watch *event_qt_add_watch(int fd, enum event_watch_cond cond, struct callback *cb) {
dbg(lvl_debug,"enter fd=%d",(int)(long)fd);
- struct event_watch *ret=g_new0(struct event_watch, 1);
- ret->fd=fd;
- ret->cb=cb;
+ struct event_watch *ret = g_new0(struct event_watch, 1);
+ ret->fd = fd;
+ ret->cb = cb;
g_hash_table_insert(event_gr->widget->watches, GINT_TO_POINTER(fd), ret);
- ret->sn=new QSocketNotifier(fd, QSocketNotifier::Read, event_gr->widget);
+ ret->sn = new QSocketNotifier(fd, QSocketNotifier::Read, event_gr->widget);
QObject::connect(ret->sn, SIGNAL(activated(int)), event_gr->widget, SLOT(watchEvent(int)));
return ret;
}
@@ -727,12 +728,11 @@ static void event_qt_remove_watch(struct event_watch *ev) {
g_hash_table_remove(event_gr->widget->watches, GINT_TO_POINTER(ev->fd));
delete(ev->sn);
g_free(ev);
-
}
static struct event_timeout *event_qt_add_timeout(int timeout, int multi, struct callback *cb) {
int id;
- id=event_gr->widget->startTimer(timeout);
+ id = event_gr->widget->startTimer(timeout);
g_hash_table_insert(event_gr->widget->timer_callback, (void *)id, cb);
g_hash_table_insert(event_gr->widget->timer_type, (void *)id, (void *)!!multi);
return (struct event_timeout *)id;
@@ -776,7 +776,7 @@ struct event_priv {
struct event_priv *
event_qt_new(struct event_methods *meth) {
dbg(lvl_debug,"enter");
- *meth=event_qt_methods;
+ *meth = event_qt_methods;
return NULL;
}
#endif
@@ -786,7 +786,8 @@ event_qt_new(struct event_methods *meth) {
//# Comment:
//# Authors: Martin Schaller (04/2008)
//##############################################################################################################
-static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct graphics_methods *meth, struct attr **attrs, struct callback_list *cbl) {
+static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct graphics_methods *meth,
+ struct attr **attrs, struct callback_list *cbl) {
struct graphics_priv *ret;
struct font_priv * (*font_freetype_new)(void *meth);
struct attr *attr;
@@ -803,36 +804,36 @@ static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct
return NULL;
#endif
#ifdef QT_QPAINTER_USE_FREETYPE
- font_freetype_new=(struct font_priv *(*)(void *))plugin_get_category_font("freetype");
+ font_freetype_new = (struct font_priv *(*)(void *))plugin_get_category_font("freetype");
if (!font_freetype_new) {
dbg(lvl_error,"no freetype");
return NULL;
}
#endif
- ret=g_new0(struct graphics_priv, 1);
- *meth=graphics_methods;
- ret->nav=nav;
+ ret = g_new0(struct graphics_priv, 1);
+ *meth = graphics_methods;
+ ret->nav = nav;
#ifdef QT_QPAINTER_USE_FREETYPE
- ret->font_freetype_new=font_freetype_new;
+ ret->font_freetype_new = font_freetype_new;
font_freetype_new(&ret->freetype_methods);
- meth->font_new=(struct graphics_font_priv *(*)(struct graphics_priv *, struct graphics_font_methods *, char *, int,
- int))ret->freetype_methods.font_new;
- meth->get_text_bbox=(void (*)(struct graphics_priv*, struct graphics_font_priv*, char*, int, int, struct point*,
- int))ret->freetype_methods.get_text_bbox;
+ meth->font_new = (struct graphics_font_priv *(*)(struct graphics_priv *, struct graphics_font_methods *, char *, int,
+ int))ret->freetype_methods.font_new;
+ meth->get_text_bbox = (void (*)(struct graphics_priv*, struct graphics_font_priv*, char*, int, int, struct point*,
+ int))ret->freetype_methods.get_text_bbox;
#endif
#if defined QT_QPAINTER_USE_EMBEDDING && QT_VERSION >= 0x040500
- if ((attr=attr_search(attrs, NULL, attr_gc_type)))
+ if ((attr = attr_search(attrs, NULL, attr_gc_type)))
QApplication::setGraphicsSystem(attr->u.str);
else
QApplication::setGraphicsSystem("raster");
#endif
- argv[0]=(char*)malloc(255);
+ argv[0] = (char*)malloc(255);
strcpy(argv[0], "navit");
- if ((attr=attr_search(attrs, NULL, attr_flags)))
- ret->flags=attr->u.num;
+ if ((attr = attr_search(attrs, NULL, attr_flags)))
+ ret->flags = attr->u.num;
if (ret->flags & 1) {
- argv[1]=(char*)malloc(255);
+ argv[1] = (char*)malloc(255);
strcpy(argv[1], "-qws");
argc++;
}
@@ -843,22 +844,22 @@ static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct
ret->app = new QApplication(argc, argv);
#endif
#endif
- ret->widget= new RenderArea(ret);
- ret->widget->cbl=cbl;
+ ret->widget = new RenderArea(ret);
+ ret->widget->cbl = cbl;
ret->painter = new QPainter;
#ifdef QT_QPAINTER_USE_EVENT_QT
- event_gr=ret;
+ event_gr = ret;
#endif
- ret->w=800;
- ret->h=600;
- if ((attr=attr_search(attrs, NULL, attr_w)))
- ret->w=attr->u.num;
+ ret->w = 800;
+ ret->h = 600;
+ if ((attr = attr_search(attrs, NULL, attr_w)))
+ ret->w = attr->u.num;
if ((attr=attr_search(attrs, NULL, attr_h)))
- ret->h=attr->u.num;
- if ((attr=attr_search(attrs, NULL, attr_window_title)))
- ret->window_title=g_strdup(attr->u.str);
+ ret->h = attr->u.num;
+ if ((attr = attr_search(attrs, NULL, attr_window_title)))
+ ret->window_title = g_strdup(attr->u.str);
else
- ret->window_title=g_strdup("Navit");
+ ret->window_title = g_strdup("Navit");
dbg(lvl_debug,"return");
return ret;
diff --git a/navit/gui/qml/gui_qml.cpp b/navit/gui/qml/gui_qml.cpp
index 8c6f232f8..764319e78 100644
--- a/navit/gui/qml/gui_qml.cpp
+++ b/navit/gui/qml/gui_qml.cpp
@@ -97,7 +97,6 @@ class NGQMainWindow : public QX11EmbedWidget {
class NGQMainWindow : public QWidget {
#endif /* Q_WS_X11 */
public:
-
#ifdef Q_WS_X11
NGQMainWindow(struct gui_priv* this_,QWidget *parent) : QX11EmbedWidget(parent) {
#else
diff --git a/navit/gui/qml/vehicleProxy.h b/navit/gui/qml/vehicleProxy.h
index 483a1837b..f5ebdad68 100644
--- a/navit/gui/qml/vehicleProxy.h
+++ b/navit/gui/qml/vehicleProxy.h
@@ -16,7 +16,6 @@ protected:
void dropIterFunc(struct attr_iter* iter) { vehicle_attr_iter_destroy(iter); };
private:
-
};
#include "vehicleProxy.moc"
diff --git a/navit/gui/qt5_qml/backend.cpp b/navit/gui/qt5_qml/backend.cpp
index 4b83bad32..7a455c2a6 100644
--- a/navit/gui/qt5_qml/backend.cpp
+++ b/navit/gui/qt5_qml/backend.cpp
@@ -231,7 +231,6 @@ void Backend::get_pois() {
item_coord_get_pro(item, &c, 1, pro) &&
coord_rect_contains(&sel->u.c_rect, &c) &&
(idist=transform_distance(pro, &center, &c)) < dist) {
-
struct attr attr;
char * label;
char * icon = get_icon(this->nav, item);
@@ -564,7 +563,6 @@ void Backend::setSearchContext(QString text) {
} else {
dbg(lvl_error, "Unhandled search context '%s'", text.toUtf8().data());
}
-
}
QString Backend::currentCountry() {
diff --git a/navit/iphone/downloader/Classes/DownloaderDetailViewController.h b/navit/iphone/downloader/Classes/DownloaderDetailViewController.h
index a7238e8ed..33c397304 100644
--- a/navit/iphone/downloader/Classes/DownloaderDetailViewController.h
+++ b/navit/iphone/downloader/Classes/DownloaderDetailViewController.h
@@ -10,11 +10,8 @@
@interface DownloaderDetailViewController : UIViewController {
-
@private
- NSDictionary *locationName_;
-
-
+ NSDictionary *locationName_;
}
@property(nonatomic, retain) NSDictionary *locationName;
diff --git a/navit/map.h b/navit/map.h
index df8f9bf4e..78521bccf 100644
--- a/navit/map.h
+++ b/navit/map.h
@@ -89,8 +89,7 @@ struct map_methods {
struct item * (*map_search_get_item)(struct map_search_priv *ms); /**< Function to get the next item of a search on the map, ignored if `map_search_new` is NULL */
struct item * (*map_rect_create_item)(struct map_rect_priv *mr, enum item_type type); /**< Function to create a new item in the map */
int (*map_get_attr)(struct map_priv *priv, enum attr_type type, struct attr *attr); /**< Function to get a map attribute, can be NULL */
- int (*map_set_attr)(struct map_priv *priv, struct attr *attr); /**< Function to set a map attribute, can be NULL */
-
+ int (*map_set_attr)(struct map_priv *priv, struct attr *attr); /**< Function to set a map attribute, can be NULL */
};
/**
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 a3d63cf17..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
*
@@ -21,19 +21,51 @@
#include "maptool.h"
#include "debug.h"
-
/** Buffer for temporarily storing an item. */
static char misc_item_buffer[20000000];
/** An item_bin for temporary use. */
struct item_bin *tmp_item_bin=(struct item_bin *)(void *)misc_item_buffer;
-/** A node_item for temporary use. */
-static struct node_item *tmp_node_item=(struct node_item *)(void *)misc_item_buffer;
struct node_item *
read_node_item(FILE *in) {
- if (fread(tmp_node_item, sizeof(struct node_item), 1, in) != 1)
- return NULL;
- return tmp_node_item;
+#define ITEM_COUNT 1*1024*1024
+ /* we read in bigger chunks as file IO in small chunks is slow as hell */
+ static FILE * last_in = NULL;
+ static long last_pos = 0;
+ static int in_count;
+ static int out_count;
+ static struct node_item item_buffer[sizeof(struct node_item) * ITEM_COUNT];
+
+ struct node_item * retval = NULL;
+
+ if((last_in != in) || (last_pos != ftell(in))) {
+ if((out_count - in_count) > 0)
+ fprintf(stderr, "change file. Still %d items\n", out_count - in_count);
+ /* got new file. flush buffer. */
+ in_count=0;
+ out_count=0;
+ last_in=in;
+ }
+
+ /* check if we need to really read from file */
+ if ((in_count - out_count) > 0) {
+ /* no, return item from buffer */
+ retval=&(item_buffer[out_count]);
+ } else {
+ out_count=0;
+ in_count=fread(item_buffer, sizeof(struct node_item), ITEM_COUNT, in);
+ //fprintf(stderr, "read %d items\n", in_count);
+ if(in_count < 1) {
+ /* buffer still empty after read */
+ return NULL;
+ }
+ /* yes, try to read full buffer at once */
+ retval=&item_buffer[0];
+ }
+ out_count ++;
+ last_pos=ftell(in);
+
+ return retval;
}
struct item_bin *
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 9c00a9c13..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
*
@@ -830,6 +830,8 @@ static void maptool_assemble_map(struct maptool_params *p, char *suffix, char **
map_information_attrs[1].u.str=p->url;
}
index_init(zip_info, 1);
+ g_free(zipdir);
+ g_free(zipindex);
}
if (!g_strcmp0(suffix,ch_suffix)) { /* Makes compiler happy due to bug 35903 in gcc */
ch_assemble_map(suffix0,suffix,zip_info);
@@ -1125,5 +1127,7 @@ int main(int argc, char **argv) {
}
phase+=2;
start_phase(&p,"done");
+ if(p.timestamp != NULL)
+ g_free(p.timestamp);
return 0;
}
diff --git a/navit/maptool/maptool.h b/navit/maptool/maptool.h
index f0aee6fdf..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;
@@ -345,6 +350,7 @@ void relations_add_relation_member_entry(struct relations *rel, struct relations
void *member_priv, enum relation_member_type type, osmid id);
void relations_add_relation_default_entry(struct relations *rel, struct relations_func *func);
void relations_process(struct relations *rel, FILE *nodes, FILE *ways);
+void relations_process_multi(struct relations **rel, int count, FILE *nodes, FILE *ways);
void relations_destroy(struct relations *rel);
@@ -422,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 caba43e94..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;
@@ -2826,6 +2826,7 @@ static int process_multipolygons_find_loops(osmid relid, int in_count, struct it
sequence_count = process_multipolygons_find_loop(in_count, parts, sequence, used);
if(sequence_count < 0) {
done = 1;
+ g_free(sequence);
} else if(sequence_count == 0) {
osm_warning("relation",relid,0,"multipolygon: skipping non loop sequence\n");
/* skip empty sequence */
@@ -2845,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;
@@ -2890,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);
}
@@ -3082,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)
@@ -3260,11 +3274,15 @@ void process_multipolygons(FILE *in, FILE *coords, FILE *ways, FILE *ways_index,
if(ways)
fseek(ways, 0,SEEK_SET);
fprintf(stderr,"process_multipolygons:process (thread %d)\n", i);
+ /* we could use relations_process_multi here as well, but this would
+ * use way more memory. */
relations_process(relations[i], coords, ways);
fprintf(stderr,"process_multipolygons:finish (thread %d)\n", i);
process_multipolygons_finish(multipolygons[i], out);
relations_destroy(relations[i]);
}
+ if(multipolygons != NULL)
+ g_free(multipolygons);
g_free(relations);
sig_alrm(0);
sig_alrm_end();
@@ -3386,6 +3404,8 @@ static void process_turn_restrictions_finish(GList *tr, FILE *out) {
}
}
+ /* just for fun...*/
+ processed_relations ++;
g_free(t->c[0]);
g_free(t->c[1]);
g_free(t->c[2]);
@@ -3395,60 +3415,64 @@ static void process_turn_restrictions_finish(GList *tr, FILE *out) {
g_list_free(tr);
}
-static GList *process_turn_restrictions_setup(FILE *in, struct relations *relations) {
+/**
+ * @brief prepare one multipolygon relation for relattion processing
+ *
+ * @param ib the relation
+ * @param relations the relation processing structure
+ * @param relations_func function to use for the members
+ * @param turn_restrictions write the resulting turn_restriction to the list
+ */
+static void process_turn_restrictions_setup_one(struct item_bin * ib, struct relations * relations,
+ struct relations_func * relations_func, GList ** turn_restrictions) {
struct relation_member fromm,tom,viam,tmpm;
long long relid;
- struct item_bin *ib;
- struct relations_func *relations_func;
int min_count;
- GList *turn_restrictions=NULL;
- fseek(in, 0, SEEK_SET);
- relations_func=relations_func_new(process_turn_restrictions_member, NULL);
- while ((ib=read_item(in))) {
+ if(ib != NULL) {
struct turn_restriction *turn_restriction;
relid=item_bin_get_relationid(ib);
min_count=0;
if (!search_relation_member(ib, "from",&fromm,&min_count)) {
osm_warning("relation",relid,0,"turn restriction: from member missing\n");
- continue;
+ return;
}
if (search_relation_member(ib, "from",&tmpm,&min_count)) {
osm_warning("relation",relid,0,"turn restriction: multiple from members\n");
- continue;
+ return;
}
min_count=0;
if (!search_relation_member(ib, "to",&tom,&min_count)) {
osm_warning("relation",relid,0,"turn restriction: to member missing\n");
- continue;
+ return;
}
if (search_relation_member(ib, "to",&tmpm,&min_count)) {
osm_warning("relation",relid,0,"turn restriction: multiple to members\n");
- continue;
+ return;
}
min_count=0;
if (!search_relation_member(ib, "via",&viam,&min_count)) {
osm_warning("relation",relid,0,"turn restriction: via member missing\n");
- continue;
+ return;
}
if (search_relation_member(ib, "via",&tmpm,&min_count)) {
osm_warning("relation",relid,0,"turn restriction: multiple via member\n");
- continue;
+ return;
}
if (fromm.type != rel_member_way) {
osm_warning("relation",relid,0,"turn restriction: wrong type for from member ");
osm_warning(osm_types[fromm.type],fromm.id,1,"\n");
- continue;
+ return;
}
if (tom.type != rel_member_way) {
osm_warning("relation",relid,0,"turn restriction: wrong type for to member ");
osm_warning(osm_types[tom.type],tom.id,1,"\n");
- continue;
+ return;
}
if (viam.type != rel_member_node && viam.type != rel_member_way) {
osm_warning("relation",relid,0,"turn restriction: wrong type for via member ");
osm_warning(osm_types[viam.type],viam.id,1,"\n");
- continue;
+ return;
}
turn_restriction=g_new0(struct turn_restriction, 1);
turn_restriction->relid=relid;
@@ -3458,19 +3482,165 @@ static GList *process_turn_restrictions_setup(FILE *in, struct relations *relati
relations_add_relation_member_entry(relations, relations_func, turn_restriction, (gpointer) 0, fromm.type, fromm.id);
relations_add_relation_member_entry(relations, relations_func, turn_restriction, (gpointer) 1, viam.type, viam.id);
relations_add_relation_member_entry(relations, relations_func, turn_restriction, (gpointer) 2, tom.type, tom.id);
- turn_restrictions=g_list_append(turn_restrictions, turn_restriction);
+ *turn_restrictions=g_list_append(*turn_restrictions, turn_restriction);
+ }
+}
+
+/**
+ * @brief worker thread private storage
+ */
+struct process_turn_restrictions_setup_thread {
+ int number;
+ GAsyncQueue * queue;
+ struct relations * relations;
+ struct relations_func * relations_func;
+ GList* turn_restrictions;
+ GThread * thread;
+};
+
+/**
+ * @brief turn restrictions setup worker thread.
+ *
+ * This thread processes any item passed to it via async queue into it's local relations
+ * function.
+ * @param data this threads local storage
+ */
+static gpointer process_turn_restrictions_setup_worker (gpointer data) {
+ struct item_bin * ib;
+ //long long relid;
+ struct process_turn_restrictions_setup_thread * me = (struct process_turn_restrictions_setup_thread*) data;
+ fprintf(stderr,"worker %d up\n", me->number);
+ while((ib=g_async_queue_pop (me->queue)) != &killer) {
+ processed_relations ++;
+ //relid=item_bin_get_relationid(ib);
+ //fprintf(stderr,"worker %d processing %lld\n", me->number, relid);
+ process_turn_restrictions_setup_one(ib, me->relations, me->relations_func, &(me->turn_restrictions));
+ /* done with that. Free the item_bin */
+ g_free(ib);
}
+ fprintf(stderr,"worker %d exit\n", me->number);
+ g_thread_exit(NULL);
+ return NULL;
+}
+
+/**
+ * @brief prepare turn restriction way matching
+ *
+ * This function reads all turn restriction relations and prepares relations structures
+ * for later way matching. Since this scales quite ugly, (O^3) i think, we use multiple threads
+ * creating their own hash each. This way none of the hashes get's that big, and we can utilize
+ * more cpu power.
+ *
+ * @param in file containing the relations
+ * @param thread_count number of threads to use
+ * @param relations array of preallocated relations structures. One per thread.
+ *
+ * @returns array of GLists. One per thread containing the resulting structures.
+ */
+static GList ** process_turn_restrictions_setup(FILE *in, int thread_count, struct relations **relations) {
+ struct process_turn_restrictions_setup_thread *sthread;
+
+ struct item_bin *ib;
+ struct relations_func *relations_func;
+ int i;
+ GList **turn_restrictions=NULL;
+ /* allocate and reference async queue */
+ GAsyncQueue * ib_queue=g_async_queue_new ();
+ g_async_queue_ref(ib_queue);
+ /* allocate per thread storage */
+ sthread=g_malloc0(sizeof(struct process_turn_restrictions_setup_thread) * thread_count);
+
+ fseek(in, 0, SEEK_SET);
+ relations_func=relations_func_new(process_turn_restrictions_member, NULL);
+
+ /* start the threads */
+ for(i=0; i < thread_count; i ++) {
+ sthread[i].number = i;
+ sthread[i].queue = ib_queue;
+ sthread[i].relations_func = relations_func;
+ sthread[i].relations = relations[i];
+ sthread[i].turn_restrictions = NULL;
+ sthread[i].thread = g_thread_new ("process_turn_restrictions_setup_worker", process_turn_restrictions_setup_worker,
+ &(sthread[i]));
+ }
+
+ while ((ib=read_item(in))) {
+ /* get a duplicate of the returned item, as the one returned shares buffer */
+ struct item_bin * dup = item_bin_dup(ib);
+ //long long relid;
+ //relid=item_bin_get_relationid(dup);
+ //fprintf(stderr,"Pushing %lld\n", relid);
+ /* the dup's will be freed by the thread processing them*/
+ g_async_queue_push(ib_queue,dup);
+ /* limit queue size. This is ugly, but since GAsyncQueue doesn't support
+ * push to block when the queue reached a decent size, I help myself
+ * with this ugly hack */
+ while(g_async_queue_length(ib_queue) > 1000)
+ usleep(200);
+ }
+
+ /* stop iand join all remaining threads */
+ for(i = 0; i < thread_count; i ++)
+ g_async_queue_push(ib_queue,&killer);
+ for(i=0; i < thread_count; i ++)
+ g_thread_join(sthread[i].thread);
+
+ /* rescue the resulting glist */
+ turn_restrictions = g_malloc0(sizeof(GList *) * thread_count);
+ for(i =0; i < thread_count; i ++)
+ turn_restrictions[i]=sthread[i].turn_restrictions;
+
+ /* free the thread storage */
+ g_free(sthread);
+
+ /* release the queue */
+ g_async_queue_unref(ib_queue);
+
+ /* return the list of turn_restrictions */
return turn_restrictions;
}
void process_turn_restrictions(FILE *in, FILE *coords, FILE *ways, FILE *ways_index, FILE *out) {
- struct relations *relations=relations_new();
- GList *turn_restrictions;
+ /* thread count is from maptool.c as commandline parameter */
+ int i;
+ struct relations **relations;
+ GList **turn_restrictions = NULL;
+ sig_alrm(0);
+
+ relations = g_malloc0(sizeof(struct relations *) * thread_count);
+ for(i=0; i < thread_count; i ++)
+ relations[i] = relations_new();
fseek(in, 0, SEEK_SET);
- turn_restrictions=process_turn_restrictions_setup(in, relations);
- relations_process(relations, coords, ways);
- process_turn_restrictions_finish(turn_restrictions, out);
- relations_destroy(relations);
+ fprintf(stderr,"process_turn_restrictions:setup (threads %d)\n", thread_count);
+ turn_restrictions=process_turn_restrictions_setup(in,thread_count,relations);
+ /* Here we get an array of resulting relations structures and resultin
+ * GLists.
+ * Of course we need to iterate the ways multiple times, but that's fast
+ * compared to hashing the relations structures
+ * This even saves a lot of main memory, as we can process every result from
+ * every thread at once completely. Since we know it's self containing
+ */
+ sig_alrm(0);
+ processed_relations=0;
+ processed_ways=0;
+ sig_alrm(0);
+ if(coords)
+ fseek(coords, 0,SEEK_SET);
+ if(ways)
+ fseek(ways, 0,SEEK_SET);
+ fprintf(stderr,"process_multipolygons:process (thread %d)\n", i);
+ relations_process_multi(relations, thread_count, coords, ways);
+ for( i=0; i < thread_count; i ++) {
+
+ fprintf(stderr,"process_turn_restrictions:finish (thread %d)\n", i);
+ process_turn_restrictions_finish(turn_restrictions[i], out);
+ relations_destroy(relations[i]);
+ }
+ if(turn_restrictions != NULL)
+ g_free(turn_restrictions);
+ g_free(relations);
+ sig_alrm(0);
+ sig_alrm_end();
}
#if 0
void process_turn_restrictions_old(FILE *in, FILE *coords, FILE *ways, FILE *ways_index, FILE *out) {
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 a6084f21e..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
*
@@ -164,6 +164,67 @@ void relations_process(struct relations *rel, FILE *nodes, FILE *ways) {
}
}
+/*
+ * @brief The actual relations processing: Loop through raw data and process any relations members.
+ * This function reads through all nodes and ways passed in, and looks up each item in the
+ * relations collection. For each relation member found, its processing function is called.
+ * @param in rel relations collection storing pre-processed relations. Built using relations_add_relation_member_entry.
+ * @param in nodes file containing nodes in "coords.tmp" format
+ * @param in ways file containing items in item_bin format. This file may contain both nodes, ways, and relations in that format.
+ */
+void relations_process_multi(struct relations **rel, int count, FILE *nodes, FILE *ways) {
+ char buffer[128];
+ struct item_bin *ib=(struct item_bin *)buffer;
+ osmid *id;
+ struct coord *c=(struct coord *)(ib+1),cn= {0,0};
+ struct node_item *ni;
+ GList *l;
+
+ if(count <= 0)
+ return;
+
+ if (nodes) {
+ item_bin_init(ib, type_point_unkn);
+ item_bin_add_coord(ib, &cn, 1);
+ item_bin_add_attr_longlong(ib, attr_osm_nodeid, 0);
+ id=item_bin_get_attr(ib, attr_osm_nodeid, NULL);
+ while ((ni=read_node_item(nodes))) {
+ int i;
+ *id=ni->nd_id;
+ *c=ni->c;
+ for(i=0; i < count; i ++) {
+ l=g_hash_table_lookup(rel[i]->member_hash[0], id);
+ while (l) {
+ struct relations_member *memb=l->data;
+ memb->func->func(memb->func->func_priv, memb->relation_priv, ib, memb->member_priv);
+ l=g_list_next(l);
+ }
+ }
+ }
+ }
+ if (ways) {
+ while ((ib=read_item(ways))) {
+ int i;
+ for(i=0; i < count; i ++) {
+ l=NULL;
+ if(NULL!=(id=item_bin_get_attr(ib, attr_osm_nodeid, NULL)))
+ l=g_hash_table_lookup(rel[i]->member_hash[0], id);
+ else if(NULL!=(id=item_bin_get_attr(ib, attr_osm_wayid, NULL)))
+ l=g_hash_table_lookup(rel[i]->member_hash[1], id);
+ else if(NULL!=(id=item_bin_get_attr(ib, attr_osm_relationid, NULL)))
+ l=g_hash_table_lookup(rel[i]->member_hash[2], id);
+ if(!l)
+ l=rel[i]->default_members;
+ while (l) {
+ struct relations_member *memb=l->data;
+ memb->func->func(memb->func->func_priv, memb->relation_priv, ib, memb->member_priv);
+ l=g_list_next(l);
+ }
+ }
+ }
+ }
+}
+
static void relations_destroy_func(void *key, GList *l, void *data) {
GList *ll=l;
while (ll) {
@@ -180,5 +241,13 @@ void relations_destroy(struct relations *relations) {
g_hash_table_foreach(relations->member_hash[i], (GHFunc)relations_destroy_func, NULL);
g_hash_table_destroy(relations->member_hash[i]);
}
+ if(relations->default_members != NULL) {
+ GList *ll=relations->default_members;
+ while (ll) {
+ g_free(ll->data);
+ ll=g_list_next(ll);
+ }
+ g_list_free(relations->default_members);
+ }
g_free(relations);
}
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 33fcab6c0..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
*
@@ -230,18 +230,28 @@ int zip_write_directory(struct zip_info *info) {
zip_write_file_data(info, info->dir);
if (info->zip64) {
eoc64.zip64esize=sizeof(eoc64)-12;
+ eoc64.zip64ever=0x031e; /* UNIX, spec 3.0 */
+ eoc64.zip64eneed=0x002d; /* version 4.5 for zip64*/
eoc64.zip64enum=info->zipnum;
eoc64.zip64ecenn=info->zipnum;
eoc64.zip64ecsz=info->dir_size;
eoc64.zip64eofst=info->offset;
zip_write(info, &eoc64, sizeof(eoc64));
eocl.zip64lofst=info->offset+info->dir_size;
+ eocl.zip74lnum=1; /* we only have single disk archives. */
zip_write(info, &eocl, sizeof(eocl));
+
+ /* force to use the 64 bit values */
+ eoc.zipenum=0xFFFF;
+ eoc.zipecenn=0xFFFF;
+ eoc.zipecsz=0xFFFFFFFF;
+ eoc.zipeofst=0xFFFFFFFF;
+ } else {
+ eoc.zipenum=info->zipnum;
+ eoc.zipecenn=info->zipnum;
+ eoc.zipecsz=info->dir_size;
+ eoc.zipeofst=info->offset;
}
- eoc.zipenum=info->zipnum;
- eoc.zipecenn=info->zipnum;
- eoc.zipecsz=info->dir_size;
- eoc.zipeofst=info->offset;
zip_write(info, &eoc, sizeof(eoc));
sig_alrm(0);
#ifndef _WIN32
diff --git a/navit/navit.dtd b/navit/navit.dtd
index 645816a93..6ab800b96 100644
--- a/navit/navit.dtd
+++ b/navit/navit.dtd
@@ -17,13 +17,14 @@
<!ATTLIST log flush_size CDATA #IMPLIED>
<!ATTLIST log flush_time CDATA #IMPLIED>
<!ATTLIST log attr_types CDATA #IMPLIED>
-<!ELEMENT navit (graphics,gui+,log*,osd*,traffic*,vehicle*,tracking?,vehicleprofile*,route,navigation,speech,mapset+,layer+,layout+) >
+<!ELEMENT navit (graphics,gui+,log*,osd*,traffic*,vehicle*,tracking?,vehicleprofile*,route,navigation,speech,mapset+,layer+,xi:include+,layout+) >
<!ATTLIST navit center CDATA #REQUIRED>
<!ATTLIST navit zoom CDATA #REQUIRED>
<!ATTLIST navit tracking CDATA #REQUIRED>
<!ATTLIST navit orientation CDATA #REQUIRED>
<!ATTLIST navit recent_dest CDATA #IMPLIED>
<!ATTLIST navit drag_bitmap CDATA #IMPLIED>
+<!ATTLIST navit default_layout CDATA #IMPLIED>
<!ELEMENT gui ANY>
<!ATTLIST gui type CDATA #REQUIRED>
<!ATTLIST gui menubar CDATA #IMPLIED>
@@ -107,6 +108,10 @@
<!ATTLIST layout font CDATA #IMPLIED>
<!ATTLIST layout daylayout CDATA #IMPLIED>
<!ATTLIST layout nightlayout CDATA #IMPLIED>
+<!ATTLIST layout icon_w CDATA #IMPLIED>
+<!ATTLIST layout icon_h CDATA #IMPLIED>
+<!ATTLIST layout underground_alpha CDATA #IMPLIED>
+<!ATTLIST layout xmlns:xi CDATA #IMPLIED>
<!ELEMENT layer (itemgra*)>
<!ATTLIST layer enabled CDATA #IMPLIED>
<!ATTLIST layer name CDATA #IMPLIED>
@@ -127,22 +132,26 @@
<!ATTLIST itemgra speed_range CDATA #IMPLIED>
<!ELEMENT polygon (coord*)>
<!ATTLIST polygon color CDATA #REQUIRED>
+<!ATTLIST polygon oneway CDATA #IMPLIED>
<!ELEMENT polyline (coord*)>
<!ATTLIST polyline color CDATA #REQUIRED>
<!ATTLIST polyline width CDATA #IMPLIED>
<!ATTLIST polyline dash CDATA #IMPLIED>
<!ATTLIST polyline offset CDATA #IMPLIED>
<!ATTLIST polyline radius CDATA #IMPLIED>
+<!ATTLIST polyline oneway CDATA #IMPLIED>
<!ELEMENT text EMPTY>
<!ATTLIST text text_size CDATA #REQUIRED>
<!ATTLIST text color CDATA #IMPLIED>
<!ATTLIST text background_color CDATA #IMPLIED>
+<!ATTLIST text oneway CDATA #IMPLIED>
<!ELEMENT circle (coord*)>
<!ATTLIST circle color CDATA #REQUIRED>
<!ATTLIST circle radius CDATA #REQUIRED>
<!ATTLIST circle width CDATA #IMPLIED>
<!ATTLIST circle text_size CDATA #IMPLIED>
<!ATTLIST circle background_color CDATA #IMPLIED>
+<!ATTLIST circle oneway CDATA #IMPLIED>
<!ELEMENT icon EMPTY>
<!ATTLIST icon src CDATA #REQUIRED>
<!ATTLIST icon w CDATA #IMPLIED>
@@ -152,6 +161,7 @@
<!ELEMENT arrows EMPTY>
<!ATTLIST arrows color CDATA #REQUIRED>
<!ATTLIST arrows width CDATA #IMPLIED>
+<!ATTLIST arrows oneway CDATA #IMPLIED>
<!ELEMENT image EMPTY>
<!ELEMENT xi:include EMPTY>
<!ATTLIST xi:include href CDATA #IMPLIED>
diff --git a/navit/plugin/pedestrian/pedestrian.c b/navit/plugin/pedestrian/pedestrian.c
index a0407c873..73827077e 100644
--- a/navit/plugin/pedestrian/pedestrian.c
+++ b/navit/plugin/pedestrian/pedestrian.c
@@ -54,15 +54,25 @@
/* #define DEMO 1 */
#ifdef HAVE_API_ANDROID
+
#include <navit/android.h>
+
#endif
+
+#define ORIENTATION_UNKNOWN 0
+#define ORIENTATION_PORTRAIT 1
+#define ORIENTATION_LANDSCAPE 2
+#define ORIENTATION_FLAT 3
+#define TYPE_ACCELEROMETER 1
+#define TYPE_MAGNETIC_FIELD 2
+
static struct map *global_map;
-int orientation,orientation_old;
+int orientation, orientation_old;
struct pedestrian {
struct navit *nav;
- int w,h;
+ int w, h;
int yaw;
} pedestrian_data;
@@ -78,72 +88,78 @@ struct rocket {
struct transformation *trans;
struct displaylist *dl;
struct mapset *ms;
- int a,g,t,hog,v,vscale;
+ int a, g, t, hog, v, vscale;
struct callback *callback;
struct event_idle *idle;
};
static void pedestrian_rocket_idle(struct rocket *rocket) {
struct attr follow;
- follow.type=attr_follow;
- follow.u.num=100;
+ follow.type = attr_follow;
+ follow.u.num = 100;
transform_set_hog(rocket->trans, rocket->hog);
graphics_displaylist_draw(rocket->gra, rocket->dl, rocket->trans, rocket->layout, 0);
- rocket->v+=rocket->a-rocket->g;
- dbg(lvl_debug,"enter v=%d",rocket->v);
- if (rocket->t > 0)
+ rocket->v += rocket->a - rocket->g;
+ dbg(lvl_debug, "enter v=%d", rocket->v);
+ if (rocket->t > 0) {
rocket->t--;
- else
- rocket->a=0;
- rocket->hog+=rocket->v/rocket->vscale;
- dbg(lvl_debug,"hog=%d",rocket->hog);
+ } else {
+ rocket->a = 0;
+ }
+ rocket->hog += rocket->v / rocket->vscale;
+ dbg(lvl_debug, "hog=%d", rocket->hog);
if (rocket->hog < 0) {
transform_set_hog(rocket->trans, 0);
transform_set_order_base(rocket->trans, 14);
transform_set_scale(rocket->trans, transform_get_scale(rocket->trans));
graphics_overlay_disable(rocket->gra, 0);
navit_draw(rocket->navit);
- follow.u.num=1;
+ follow.u.num = 1;
event_remove_idle(rocket->idle);
- rocket->idle=NULL;
- sensors_locked=0;
+ rocket->idle = NULL;
+ sensors_locked = 0;
}
navit_set_attr(rocket->navit, &follow);
}
static void pedestrian_cmd_pedestrian_rocket(struct rocket *rocket) {
struct attr attr;
- int max=0;
+ int max = 0;
#if 0
int i,step=10;
#endif
- rocket->a=2;
- rocket->g=1;
- rocket->t=100;
- rocket->hog=0;
- rocket->v=0;
- rocket->vscale=10;
- if (! navit_get_attr(rocket->navit, attr_graphics, &attr, NULL))
+ rocket->a = 2;
+ rocket->g = 1;
+ rocket->t = 100;
+ rocket->hog = 0;
+ rocket->v = 0;
+ rocket->vscale = 10;
+ if (!navit_get_attr(rocket->navit, attr_graphics, &attr, NULL)) {
return;
- rocket->gra=attr.u.graphics;
- if (! navit_get_attr(rocket->navit, attr_transformation, &attr, NULL))
+ }
+ rocket->gra = attr.u.graphics;
+ if (!navit_get_attr(rocket->navit, attr_transformation, &attr, NULL)) {
return;
- rocket->trans=attr.u.transformation;
- if (! navit_get_attr(rocket->navit, attr_displaylist, &attr, NULL))
+ }
+ rocket->trans = attr.u.transformation;
+ if (!navit_get_attr(rocket->navit, attr_displaylist, &attr, NULL)) {
return;
- rocket->dl=attr.u.displaylist;
- if (! navit_get_attr(rocket->navit, attr_mapset, &attr, NULL))
+ }
+ rocket->dl = attr.u.displaylist;
+ if (!navit_get_attr(rocket->navit, attr_mapset, &attr, NULL)) {
return;
- rocket->ms=attr.u.mapset;
+ }
+ rocket->ms = attr.u.mapset;
transform_set_hog(rocket->trans, max);
transform_set_order_base(rocket->trans, 14);
transform_set_scale(rocket->trans, transform_get_scale(rocket->trans));
transform_setup_source_rect(rocket->trans);
graphics_overlay_disable(rocket->gra, 1);
graphics_draw(rocket->gra, rocket->dl, rocket->ms, rocket->trans, rocket->layout, 0, NULL, 0);
- sensors_locked=1;
- if (!rocket->idle)
- rocket->idle=event_add_idle(50, rocket->callback);
+ sensors_locked = 1;
+ if (!rocket->idle) {
+ rocket->idle = event_add_idle(50, rocket->callback);
+ }
#if 0
while (hog >= 0) {
transform_set_hog(trans, hog);
@@ -172,22 +188,21 @@ static void pedestrian_cmd_pedestrian_rocket(struct rocket *rocket) {
#endif
}
-static struct command_table commands[] = {
- {"pedestrian_rocket",command_cast(pedestrian_cmd_pedestrian_rocket)},
-};
-
+static struct command_table commands[] = {{"pedestrian_rocket", command_cast(pedestrian_cmd_pedestrian_rocket)},};
static void osd_rocket_init(struct navit *nav) {
- struct rocket *rocket=g_new0(struct rocket, 1);
+ struct rocket *rocket = g_new0(struct rocket, 1);
struct attr attr;
- rocket->navit=nav;
- rocket->callback=callback_new_1(callback_cast(pedestrian_rocket_idle), rocket);
- if (navit_get_attr(nav, attr_layout, &attr, NULL))
- rocket->layout=attr.u.layout;
+ rocket->navit = nav;
+ rocket->callback = callback_new_1(callback_cast(pedestrian_rocket_idle), rocket);
+ if (navit_get_attr(nav, attr_layout, &attr, NULL)) {
+ rocket->layout = attr.u.layout;
+ }
if (navit_get_attr(nav, attr_callback_list, &attr, NULL)) {
- dbg(lvl_debug,"ok");
- command_add_table(attr.u.callback_list, commands, sizeof(commands)/sizeof(struct command_table), rocket);
+ dbg(lvl_debug, "ok");
+ command_add_table(attr.u.callback_list, commands,
+ sizeof(commands) / sizeof(struct command_table), rocket);
}
}
@@ -200,8 +215,9 @@ static void osd_marker_draw(struct marker *this, struct navit *nav) {
struct attr graphics;
struct point p;
dbg(lvl_debug,"enter");
- if (!navit_get_attr(nav, attr_graphics, &graphics, NULL))
+ if (!navit_get_attr(nav, attr_graphics, &graphics, NULL)) {
return;
+ }
p.x=40;
p.y=50;
cursor_draw(this->cursor, graphics.u.graphics, &p, 0, 45, 0);
@@ -211,92 +227,88 @@ static void osd_marker_draw(struct marker *this, struct navit *nav) {
static void osd_marker_init(struct marker *this, struct navit *nav) {
struct attr cursor;
- struct attr itemgra,polygon,polygoncoord1,polygoncoord2,polygoncoord3;
- struct attr *color=attr_new_from_text("color","#ff0000");
+ struct attr itemgra, polygon, polygoncoord1, polygoncoord2, polygoncoord3;
+ struct attr *color = attr_new_from_text("color", "#ff0000");
- cursor=(struct attr) {
- attr_cursor, {(void *)cursor_new(NULL, (struct attr *[]) {
- &(struct attr) {
- attr_w, {(void *)26}
- },
+ cursor = (struct attr) {
+ attr_cursor, {(void *) cursor_new(NULL, (struct attr *[]) {
&(struct attr) {
- attr_h, {(void *)26}
- },
- NULL
+ attr_w, {(void *) 26}
+ }, &(struct attr) {
+ attr_h, {(void *) 26}
+ }, NULL
})
}
};
- itemgra=(struct attr) {
- attr_itemgra, {(void *)itemgra_new(&cursor, (struct attr *[]) {
+ itemgra = (struct attr) {
+ attr_itemgra, {(void *) itemgra_new(&cursor, (struct attr *[]) {
NULL
})
}
};
cursor_add_attr(cursor.u.cursor, &itemgra);
- polygon=(struct attr) {
- attr_polygon, {(void *)polygon_new(&itemgra, (struct attr *[]) {
- color,
+ polygoncoord1 = (struct attr) {
+ attr_coord, {(void *) coord_new_from_attrs(&polygon, (struct attr *[]) {
&(struct attr) {
- attr_width, {(void *)2}
- },
- NULL
+ attr_x, {(void *) -7}
+ }, &(struct attr) {
+ attr_y, {(void *) -10}
+ }, NULL
})
- }
+ }
};
itemgra_add_attr(itemgra.u.itemgra, &polygon);
- polygoncoord1=(struct attr) {
- attr_coord, {(void *)coord_new_from_attrs(&polygon, (struct attr *[]) {
- &(struct attr) {
- attr_x, {(void *)-7}
- },
+ polygoncoord1 = (struct attr) {
+ attr_coord, {(void *) coord_new_from_attrs(&polygon, (struct attr *[]) {
&(struct attr) {
- attr_y, {(void *)-10}
- },
- NULL
+ attr_x, {(void *) -7}
+ }, &(struct attr) {
+ attr_y, {(void *) -10}
+ }, NULL
})
}
};
element_add_attr(polygon.u.element, &polygoncoord1);
- polygoncoord2=(struct attr) {
- attr_coord, {(void *)coord_new_from_attrs(&polygon, (struct attr *[]) {
- &(struct attr) {
- attr_x, {(void *)0}
- },
- &(struct attr) {
- attr_y, {(void *)12}
- },
- NULL
- })
- }
+ polygoncoord2 = (struct attr) {
+ attr_coord, {
+ (void *) coord_new_from_attrs(&polygon, (struct attr *[]) {
+ &(struct attr) {
+ attr_x, {(void *) 0}
+ },
+ &(struct attr) {
+ attr_y, {(void *) 12}
+ },
+ NULL
+ })
+ }
};
element_add_attr(polygon.u.element, &polygoncoord2);
- polygoncoord3=(struct attr) {
- attr_coord, {(void *)coord_new_from_attrs(&polygon, (struct attr *[]) {
- &(struct attr) {
- attr_x, {(void *)7}
- },
- &(struct attr) {
- attr_y, {(void *)-10}
- },
- NULL
- })
- }
+ polygoncoord3 = (struct attr) {
+ attr_coord, {
+ (void *) coord_new_from_attrs(&polygon, (struct attr *[]) {
+ &(struct attr) {
+ attr_x, {(void *) 7}
+ },
+ &(struct attr) {
+ attr_y, {(void *) -10}
+ },
+ NULL
+ })
+ }
};
element_add_attr(polygon.u.element, &polygoncoord3);
attr_free(color);
- this->cursor=cursor.u.cursor;
+ this->cursor = cursor.u.cursor;
osd_marker_draw(this, nav);
}
-static struct osd_priv *osd_marker_new(struct navit *nav, struct osd_methods *meth,
- struct attr **attrs) {
+static struct osd_priv * osd_marker_new(struct navit *nav, struct osd_methods *meth, struct attr **attrs) {
struct marker *this = g_new0(struct marker, 1);
navit_add_callback(nav, callback_new_attr_1(callback_cast(osd_marker_init), attr_navit, this));
return (struct osd_priv *) this;
}
-
struct map_priv {
struct navit *navit;
};
@@ -313,7 +325,7 @@ struct map_rect_priv {
int idx_base;
int idx_next;
int idx;
- int first,last;
+ int first, last;
int route_item_done;
struct coord c_out;
struct coord c_next;
@@ -327,59 +339,60 @@ struct map_rect_priv {
static int map_route_occluded_bbox(struct map *map, struct coord_rect *bbox) {
struct coord c[128];
struct coord_rect r;
- int i,first=1,ccount;
- struct map_rect *map_rect=map_rect_new(map, NULL);
+ int i, first = 1, ccount;
+ struct map_rect *map_rect = map_rect_new(map, NULL);
struct item *item;
- while ((item=map_rect_get_item(map_rect))) {
- ccount=item_coord_get(item, c, 128);
+ while ((item = map_rect_get_item(map_rect))) {
+ ccount = item_coord_get(item, c, 128);
if (ccount && first) {
- r.lu=c[0];
- r.rl=c[0];
- first=0;
+ r.lu = c[0];
+ r.rl = c[0];
+ first = 0;
}
- for (i = 0 ; i < ccount ; i++)
+ for (i = 0; i < ccount; i++) {
coord_rect_extend(&r, &c[i]);
+ }
}
map_rect_destroy(map_rect);
if (first)
return 0;
- *bbox=r;
+ *bbox = r;
return 1;
}
static struct building {
struct street_data *sd;
- struct coord left,right;
+ struct coord left, right;
struct building *next;
} *buildings;
static void map_route_occluded_buildings_free(void) {
- struct building *next,*b=buildings;
+ struct building *next, *b = buildings;
while (b) {
street_data_free(b->sd);
- next=b->next;
+ next = b->next;
g_free(b);
- b=next;
+ b = next;
}
- buildings=NULL;
+ buildings = NULL;
}
static void map_route_occluded_get_buildings(struct mapset *mapset, struct coord_rect *r) {
- struct mapset_handle *msh=mapset_open(mapset);
+ struct mapset_handle *msh = mapset_open(mapset);
struct map *map;
struct map_selection sel;
struct map_rect *mr;
struct item *item;
struct building *b;
- sel.next=NULL;
- sel.u.c_rect=*r;
- sel.order=18;
- sel.range.min=type_poly_building;
- sel.range.max=type_poly_building;
+ sel.next = NULL;
+ sel.u.c_rect = *r;
+ sel.order = 18;
+ sel.range.min = type_poly_building;
+ sel.range.max = type_poly_building;
map_route_occluded_buildings_free();
while ((map = mapset_next(msh, 1))) {
- mr=map_rect_new(map, &sel);
+ mr = map_rect_new(map, &sel);
while ((item = map_rect_get_item(mr))) {
if (item->type == type_poly_building) {
#if 0
@@ -397,113 +410,121 @@ static void map_route_occluded_get_buildings(struct mapset *mapset, struct coord
#endif
continue;
#endif
- b=g_new(struct building, 1);
- b->sd=street_get_data(item);
- b->next=buildings;
- buildings=b;
+ b = g_new(struct building, 1);
+ b->sd = street_get_data(item);
+ b->next = buildings;
+ buildings = b;
}
}
map_rect_destroy(mr);
}
}
-FILE *debug,*debug2;
+FILE *debug, *debug2;
/* < 0 left, > 0 right */
static int side(struct coord *l0, struct coord *l1, struct coord *p) {
- int dxl=l1->x-l0->x;
- int dyl=l1->y-l0->y;
- int dxp=p->x-l0->x;
- int dyp=p->y-l0->y;
+ int dxl = l1->x - l0->x;
+ int dyl = l1->y - l0->y;
+ int dxp = p->x - l0->x;
+ int dyp = p->y - l0->y;
- return dxp*dyl-dyp*dxl;
+ return dxp * dyl - dyp * dxl;
}
static void map_route_occluded_check_buildings(struct coord *c0) {
- struct building *b=buildings;
- dbg(lvl_debug,"enter");
- int i,count;
+ struct building *b = buildings;
+ dbg(lvl_debug, "enter");
+ int i, count;
struct coord *c;
#if 1
- FILE *bdebug,*bldebug;
- bdebug=fopen("tstb.txt","w");
- bldebug=fopen("tstbl.txt","w");
+ FILE *bdebug, *bldebug;
+ bdebug = fopen("tstb.txt", "w");
+ bldebug = fopen("tstbl.txt", "w");
#endif
while (b) {
- c=b->sd->c;
- count=b->sd->count;
- if (c[count-1].x == c[0].x && c[count-1].y == c[0].y) {
+ c = b->sd->c;
+ count = b->sd->count;
+ if (c[count - 1].x == c[0].x && c[count - 1].y == c[0].y) {
#if 0
dbg(lvl_debug,"closed");
#endif
count--;
}
- for (i = 0 ; i < count ; i++) {
- if (!i || side(c0, &b->left, &c[i]) < 0)
- b->left=c[i];
- if (!i || side(c0, &b->right, &c[i]) > 0)
- b->right=c[i];
+ for (i = 0; i < count; i++) {
+ if (!i || side(c0, &b->left, &c[i]) < 0) {
+ b->left = c[i];
+ }
+ if (!i || side(c0, &b->right, &c[i]) > 0) {
+ b->right = c[i];
+ }
}
#if 1
if (bdebug) {
- fprintf(bdebug,"0x%x 0x%x type=poi_hospital\n", b->left.x, b->left.y);
- fprintf(bdebug,"0x%x 0x%x type=poi_hospital\n", b->right.x, b->right.y);
+ fprintf(bdebug, "0x%x 0x%x type=poi_hospital", b->left.x, b->left.y);
+ fprintf(bdebug, "0x%x 0x%x type=poi_hospital", b->right.x, b->right.y);
}
if (bldebug) {
- fprintf(bldebug,"type=street_nopass\n");
- fprintf(bldebug,"0x%x 0x%x\n", c0->x, c0->y);
- fprintf(bldebug,"0x%x 0x%x\n", c0->x+(b->left.x-c0->x)*10, c0->y+(b->left.y-c0->y)*10);
- fprintf(bldebug,"type=street_nopass\n");
- fprintf(bldebug,"0x%x 0x%x\n", c0->x, c0->y);
- fprintf(bldebug,"0x%x 0x%x\n", c0->x+(b->right.x-c0->x)*10, c0->y+(b->right.y-c0->y)*10);
+ fprintf(bldebug, "type=street_nopass");
+ fprintf(bldebug, "0x%x 0x%x", c0->x, c0->y);
+ fprintf(bldebug, "0x%x 0x%x", c0->x + (b->left.x - c0->x) * 10,
+ c0->y + (b->left.y - c0->y) * 10);
+ fprintf(bldebug, "type=street_nopass");
+ fprintf(bldebug, "0x%x 0x%x", c0->x, c0->y);
+ fprintf(bldebug, "0x%x 0x%x", c0->x + (b->right.x - c0->x) * 10,
+ c0->y + (b->right.y - c0->y) * 10);
}
#endif
- b=b->next;
+ b = b->next;
}
#if 1
- if (bdebug)
+ if (bdebug) {
fclose(bdebug);
- if (bldebug)
+ }
+ if (bldebug) {
fclose(bldebug);
+ }
#endif
}
static int intersect(struct coord *p1, struct coord *p2, struct coord *p3, struct coord *p4, struct coord *i) {
- double num=(p4->x-p3->x)*(p1->y-p3->y)-(p4->y-p3->y)*(p1->x-p3->x);
- double den=(p4->y-p3->y)*(p2->x-p1->x)-(p4->x-p3->x)*(p2->y-p1->y);
+ double num = (p4->x - p3->x) * (p1->y - p3->y) - (p4->y - p3->y) * (p1->x - p3->x);
+ double den = (p4->y - p3->y) * (p2->x - p1->x) - (p4->x - p3->x) * (p2->y - p1->y);
if (num < 0 && den < 0) {
- num=-num;
- den=-den;
+ num = -num;
+ den = -den;
}
- dbg(lvl_debug,"num=%f den=%f", num, den);
+ dbg(lvl_debug, "num=%f den=%f", num, den);
if (i) {
- i->x=p1->x+(num/den)*(p2->x-p1->x)+0.5;
- i->y=p1->y+(num/den)*(p2->y-p1->y)+0.5;
- dbg(lvl_debug,"i=0x%x,0x%x", i->x, i->y);
+ i->x = p1->x + (num / den) * (p2->x - p1->x) + 0.5;
+ i->y = p1->y + (num / den) * (p2->y - p1->y) + 0.5;
+ dbg(lvl_debug, "i=0x%x,0x%x", i->x, i->y);
if (debug2)
- fprintf(debug2, "0x%x 0x%x type=town_label_5e3\n", i->x, i->y);
+ fprintf(debug2, "0x%x 0x%x type=town_label_5e3", i->x, i->y);
}
- if (num < 0 || den < 0)
+ if (num < 0 || den < 0) {
return -1;
- if (num > den)
+ }
+ if (num > den) {
return 257;
- return 256*num/den;
+ }
+ return 256 * num / den;
}
/* return
- 0=Not clipped
- 1=Start clipped
- 2=End clipped
- 3=Both clipped
- 4=Invisible
+ 0=Not clipped
+ 1=Start clipped
+ 2=End clipped
+ 3=Both clipped
+ 4=Invisible
*/
/* #define DEBUG_VISIBLE */
static int is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2) {
- int res,ret=0;
- struct building *b=buildings;
+ int res, ret = 0;
+ struct building *b = buildings;
struct coord cn;
#ifdef DEBUG_VISIBLE
dbg(lvl_debug,"enter");
@@ -511,8 +532,8 @@ static int is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
while (b) {
if (side(&b->left, &b->right, c1) < 0 || side(&b->left, &b->right, c2) < 0) {
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"sides left: start %d end %d right: start %d end %d", side(c0, &b->left, c1), side(c0, &b->left, c2),
- side(c0, &b->right, c1), side(c0, &b->right, c2));
+ dbg(lvl_debug,"sides left: start %d end %d right: start %d end %d", side(c0, &b->left, c1),
+ side(c0, &b->left, c2), side(c0, &b->right, c1), side(c0, &b->right, c2));
#endif
for (;;) {
if (side(c0, &b->left, c1) <= 0) {
@@ -520,12 +541,13 @@ static int is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
#ifdef DEBUG_VISIBLE
dbg(lvl_debug,"visible: start is left of left corner and end is right of left corner, clipping end");
#endif
- res=intersect(c0, &b->left, c1, c2, &cn);
- if (res < 256)
+ res = intersect(c0, &b->left, c1, c2, &cn);
+ if (res < 256) {
break;
+ }
if (c1->x != cn.x || c1->y != cn.y) {
- *c2=cn;
- ret|=2;
+ *c2 = cn;
+ ret |= 2;
break;
}
} else
@@ -536,12 +558,13 @@ static int is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
#ifdef DEBUG_VISIBLE
dbg(lvl_debug,"visible: start is right of right corner and end is left of right corner, clipping end");
#endif
- res=intersect(c0, &b->right, c1, c2, &cn);
- if (res < 256)
+ res = intersect(c0, &b->right, c1, c2, &cn);
+ if (res < 256) {
break;
+ }
if (c1->x != cn.x || c1->y != cn.y) {
- *c2=cn;
- ret|=2;
+ *c2 = cn;
+ ret |= 2;
break;
}
} else
@@ -552,12 +575,13 @@ static int is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
#ifdef DEBUG_VISIBLE
dbg(lvl_debug,"visible: end is left of left corner and start is right of left corner, clipping start");
#endif
- res=intersect(c0, &b->left, c1, c2, &cn);
- if (res < 256)
+ res = intersect(c0, &b->left, c1, c2, &cn);
+ if (res < 256) {
break;
+ }
if (c2->x != cn.x || c2->y != cn.y) {
- *c1=cn;
- ret|=1;
+ *c1 = cn;
+ ret |= 1;
break;
}
} else
@@ -568,12 +592,12 @@ static int is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
#ifdef DEBUG_VISIBLE
dbg(lvl_debug,"visible: end is right of right corner and start is left of right corner, clipping start");
#endif
- res=intersect(c0, &b->right, c1, c2, &cn);
+ res = intersect(c0, &b->right, c1, c2, &cn);
if (res < 256)
break;
if (c2->x != cn.x || c2->y != cn.y) {
- *c1=cn;
- ret|=1;
+ *c1 = cn;
+ ret |= 1;
break;
}
} else
@@ -585,7 +609,7 @@ static int is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
return 4;
}
}
- b=b->next;
+ b = b->next;
}
#ifdef DEBUG_VISIBLE
dbg(lvl_debug,"return %d",ret);
@@ -595,160 +619,153 @@ static int is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
static void map_route_occluded_coord_rewind(void *priv_data) {
struct map_rect_priv *mr = priv_data;
- dbg(lvl_debug,"enter");
- mr->idx=mr->idx_base;
- mr->first=1;
- mr->lseg_done=mr->lseg_done_base;
- mr->c_next=mr->c_next_base;
- mr->lseg[0]=mr->lseg_base[0];
- mr->lseg[1]=mr->lseg_base[1];
- mr->last=0;
+ dbg(lvl_debug, "enter");
+ mr->idx = mr->idx_base;
+ mr->first = 1;
+ mr->lseg_done = mr->lseg_done_base;
+ mr->c_next = mr->c_next_base;
+ mr->lseg[0] = mr->lseg_base[0];
+ mr->lseg[1] = mr->lseg_base[1];
+ mr->last = 0;
item_coord_rewind(mr->route_item);
}
static void map_route_occluded_attr_rewind(void *priv_data) {
- struct map_rect_priv *mr=priv_data;
- dbg(lvl_debug,"enter");
+ struct map_rect_priv *mr = priv_data;
+ dbg(lvl_debug, "enter\n");
item_attr_rewind(mr->route_item);
}
static int map_route_occluded_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr) {
- struct map_rect_priv *mr=priv_data;
- dbg(lvl_debug,"enter");
+ struct map_rect_priv *mr = priv_data;
+ dbg(lvl_debug, "enter\n");
return item_attr_get(mr->route_item, attr_type, attr);
}
static int coord_next(struct map_rect_priv *mr, struct coord *c) {
- if (mr->idx >= mr->sd->count)
+ if (mr->idx >= mr->sd->count) {
return 1;
- *c=mr->sd->c[mr->idx++];
+ }
+ *c = mr->sd->c[mr->idx++];
return 0;
}
#define DEBUG_COORD_GET
+
static int map_route_occluded_coord_get(void *priv_data, struct coord *c, int count) {
- struct map_rect_priv *mr=priv_data;
- struct coord l0,l1;
- int vis,ret=0;
+ struct map_rect_priv *mr = priv_data;
+ struct coord l0, l1;
+ int vis, ret = 0;
char buffer[4096];
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"enter");
+ dbg(lvl_debug, "enter");
#endif
dbg_assert(count >= 2);
- if (! mr->checked) {
- mr->c0=mr->sd->c[0];
+ if (!mr->checked) {
+ mr->c0 = mr->sd->c[0];
map_route_occluded_check_buildings(&mr->c0);
- mr->checked=1;
+ mr->checked = 1;
}
while (ret < count && !mr->last) {
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"coord first %d lseg_done %d",mr->first,mr->lseg_done);
+ dbg(lvl_debug, "coord first %d lseg_done %d", mr->first, mr->lseg_done);
#endif
if (mr->lseg_done) {
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"loading %d of %d from id_lo %d", mr->idx, mr->sd->count, mr->sd->item.id_lo);
+ dbg(lvl_debug, "loading %d of %d from id_lo %d", mr->idx, mr->sd->count,
+ mr->sd->item.id_lo);
#endif
if (!mr->idx) {
if (coord_next(mr, &mr->lseg[0])) {
- mr->route_item_done=1;
- mr->last=1;
- mr->idx_base=mr->idx=0;
+ mr->route_item_done = 1;
+ mr->last = 1;
+ mr->idx_base = mr->idx = 0;
break;
}
- mr->first=1;
+ mr->first = 1;
} else
- mr->lseg[0]=mr->lseg[1];
+ mr->lseg[0] = mr->lseg[1];
if (coord_next(mr, &mr->lseg[1])) {
- mr->route_item_done=1;
- mr->last=1;
- mr->idx_base=mr->idx=0;
+ mr->route_item_done = 1;
+ mr->last = 1;
+ mr->idx_base = mr->idx = 0;
break;
}
- mr->c_next=mr->lseg[0];
- mr->lseg_done=0;
+ mr->c_next = mr->lseg[0];
+ mr->lseg_done = 0;
}
- l0=mr->c_next;
- l1=mr->lseg[1];
+ l0 = mr->c_next;
+ l1 = mr->lseg[1];
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"line (0x%x,0x%x)-(0x%x,0x%x)", l0.x,l0.y,l1.x,l1.y);
+ dbg(lvl_debug, "line (0x%x,0x%x)-(0x%x,0x%x)", l0.x, l0.y, l1.x, l1.y);
#endif
- vis=is_visible_line(&mr->c0, &l0, &l1);
+ vis = is_visible_line(&mr->c0, &l0, &l1);
if (debug) {
- fprintf(debug,"type=tracking_%d debug=\"%s\"\n",vis*20,buffer);
- fprintf(debug,"0x%x 0x%x\n", l0.x, l0.y);
- fprintf(debug,"0x%x 0x%x\n", l1.x, l1.y);
+ fprintf(debug, "type=tracking_%d debug=\"%s\"\n", vis * 20, buffer);
+ fprintf(debug, "0x%x 0x%x", l0.x, l0.y);
+ fprintf(debug, "0x%x 0x%x", l1.x, l1.y);
}
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"vis=%d line (0x%x,0x%x)-(0x%x,0x%x)", vis, l0.x,l0.y,l1.x,l1.y);
+ dbg(lvl_debug, "vis=%d line (0x%x,0x%x)-(0x%x,0x%x)", vis, l0.x, l0.y, l1.x, l1.y);
#endif
- mr->idx_base=mr->idx;
- mr->c_next_base=mr->c_next;
- mr->lseg_base[0]=mr->lseg[0];
- mr->lseg_base[1]=mr->lseg[1];
- mr->lseg_done_base=mr->lseg_done;
+ mr->idx_base = mr->idx;
+ mr->c_next_base = mr->c_next;
+ mr->lseg_base[0] = mr->lseg[0];
+ mr->lseg_base[1] = mr->lseg[1];
+ mr->lseg_done_base = mr->lseg_done;
switch (vis) {
case 0:
- mr->c_next_base=mr->c_next;
+ mr->c_next_base = mr->c_next;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x", l0.x, l1.y);
+ dbg(lvl_debug, "out 0x%x,0x%x", l0.x, l1.y);
#endif
- c[ret++]=l0;
+ c[ret++] = l0;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x", l1.x, l1.y);
+ dbg(lvl_debug, "out 0x%x,0x%x", l1.x, l1.y);
#endif
- c[ret++]=l1;
- mr->lseg_done_base=mr->lseg_done=1;
- mr->last=1;
+ c[ret++] = l1;
+ mr->lseg_done_base = mr->lseg_done = 1;
+ mr->last = 1;
break;
case 1:
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"begin clipped");
- dbg(lvl_debug,"out 0x%x,0x%x", l0.x, l1.y);
+ dbg(lvl_debug, "begin clipped");
+ dbg(lvl_debug, "out 0x%x,0x%x", l0.x, l1.y);
#endif
- c[ret++]=l0;
+ c[ret++] = l0;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x", l1.x, l1.y);
+ dbg(lvl_debug, "out 0x%x,0x%x", l1.x, l1.y);
#endif
- c[ret++]=l1;
- mr->c_next_base=mr->c_next=l1;
- mr->last=1;
+ c[ret++] = l1;
+ mr->c_next_base = mr->c_next = l1;
+ mr->last = 1;
break;
case 2:
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"end clipped");
-#endif
- mr->c_next_base=mr->c_next;
-#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x", l0.x, l1.y);
-#endif
- c[ret++]=l0;
-#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x", l1.x, l1.y);
+ dbg(lvl_debug, "end clipped");
#endif
- c[ret++]=l1;
- mr->c_next_base=mr->c_next=l1;
- mr->last=1;
- break;
case 3:
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"both clipped");
+ if (vis == 3) {
+ dbg(lvl_debug, "both clipped");
+ }
#endif
- mr->c_next_base=mr->c_next;
+ mr->c_next_base = mr->c_next;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x", l0.x, l1.y);
+ dbg(lvl_debug, "out 0x%x,0x%x", l0.x, l1.y);
#endif
- c[ret++]=l0;
+ c[ret++] = l0;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x", l1.x, l1.y);
+ dbg(lvl_debug, "out 0x%x,0x%x", l1.x, l1.y);
#endif
- c[ret++]=l1;
- mr->c_next_base=mr->c_next=l1;
- mr->last=1;
+ c[ret++] = l1;
+ mr->c_next_base = mr->c_next = l1;
+ mr->last = 1;
break;
case 4:
- mr->last=1;
- mr->lseg_done_base=mr->lseg_done=1;
+ mr->last = 1;
+ mr->lseg_done_base = mr->lseg_done = 1;
break;
#if 0
@@ -777,10 +794,12 @@ static int map_route_occluded_coord_get(void *priv_data, struct coord *c, int co
if (!vis)
break;
#endif
+ default:
+ break;
}
}
#ifdef DEBUG_COORD_GET
-dbg(lvl_debug,"ret=%d last=%d", ret, mr->last);
+dbg(lvl_debug, "ret=%d last=%d", ret, mr->last);
#endif
return ret;
}
@@ -798,42 +817,43 @@ static void map_route_occluded_destroy(struct map_priv *priv) {
static int no_recurse;
-static struct map_rect_priv *map_route_occluded_rect_new(struct map_priv *priv, struct map_selection *sel) {
- struct map_rect_priv * mr;
+static struct map_rect_priv * map_route_occluded_rect_new(struct map_priv *priv, struct map_selection *sel) {
+ struct map_rect_priv *mr;
struct attr route;
struct attr route_map;
struct map_rect *route_map_rect;
struct coord_rect r;
if (!navit_get_attr(priv->navit, attr_route, &route, NULL)) {
- dbg(lvl_debug,"no route in navit");
+ dbg(lvl_debug, "no route in navit");
return NULL;
}
if (!route_get_attr(route.u.route, attr_map, &route_map, NULL)) {
- dbg(lvl_debug,"no map in route");
+ dbg(lvl_debug, "no map in route");
return NULL;
}
- route_map_rect=map_rect_new(route_map.u.map, sel);
+ route_map_rect = map_rect_new(route_map.u.map, sel);
if (!route_map_rect) {
- dbg(lvl_debug,"no route map rect");
+ dbg(lvl_debug, "no route map rect");
return NULL;
}
map_dump_file(route_map.u.map, "route.txt");
- mr=g_new0(struct map_rect_priv, 1);
- mr->route_map_rect=route_map_rect;
+ mr = g_new0(struct map_rect_priv, 1);
+ mr->route_map_rect = route_map_rect;
mr->mpriv = priv;
mr->item.priv_data = mr;
mr->item.meth = &methods_route_occluded_item;
mr->item.id_lo = -1;
- mr->route_item_done=1;
- mr->lseg_done_base=1;
- mr->last=1;
+ mr->route_item_done = 1;
+ mr->lseg_done_base = 1;
+ mr->last = 1;
if (!no_recurse && map_route_occluded_bbox(route_map.u.map, &r)) {
struct attr mapset;
no_recurse++;
- if (navit_get_attr(mr->mpriv->navit, attr_mapset, &mapset, NULL))
+ if (navit_get_attr(mr->mpriv->navit, attr_mapset, &mapset, NULL)) {
map_route_occluded_get_buildings(mapset.u.mapset, &r);
- debug=fopen("tst.txt","w");
- debug2=fopen("tstp.txt","w");
+ }
+ debug = fopen("tst.txt", "w");
+ debug2 = fopen("tstp.txt", "w");
no_recurse--;
}
return mr;
@@ -847,11 +867,11 @@ static void map_route_occluded_rect_destroy(struct map_rect_priv *mr) {
if (!no_recurse) {
if (debug) {
fclose(debug);
- debug=NULL;
+ debug = NULL;
}
if (debug2) {
fclose(debug2);
- debug2=NULL;
+ debug2 = NULL;
}
}
#if 0
@@ -865,23 +885,24 @@ static void map_route_occluded_rect_destroy(struct map_rect_priv *mr) {
}
static struct item *map_route_occluded_get_item(struct map_rect_priv *mr) {
- dbg(lvl_debug,"enter last=%d",mr->last);
+ dbg(lvl_debug, "enter last=%d", mr->last);
while (!mr->last) {
struct coord c[128];
map_route_occluded_coord_get(mr, c, 128);
}
if (mr->route_item_done) {
- dbg(lvl_debug,"next route item");
+ dbg(lvl_debug, "next route item");
do {
- mr->route_item=map_rect_get_item(mr->route_map_rect);
+ mr->route_item = map_rect_get_item(mr->route_map_rect);
} while (mr->route_item && mr->route_item->type != type_street_route);
- dbg(lvl_debug,"item %p", mr->route_item);
- if (!mr->route_item)
+ dbg(lvl_debug, "item %p", mr->route_item);
+ if (!mr->route_item) {
return NULL;
- mr->item.type=type_street_route_occluded;
+ }
+ mr->item.type = type_street_route_occluded;
street_data_free(mr->sd);
- mr->sd=street_get_data(mr->route_item);
- mr->route_item_done=0;
+ mr->sd = street_get_data(mr->route_item);
+ mr->route_item_done = 0;
}
mr->item.id_lo++;
#if 0
@@ -889,14 +910,15 @@ static struct item *map_route_occluded_get_item(struct map_rect_priv *mr) {
return NULL;
#endif
map_route_occluded_coord_rewind(mr);
- dbg(lvl_debug,"type %s", item_to_name(mr->route_item->type));
+ dbg(lvl_debug, "type %s", item_to_name(mr->route_item->type));
return &mr->item;
}
-static struct item *map_route_occluded_get_item_byid(struct map_rect_priv *mr, int id_hi, int id_lo) {
- struct item *ret=NULL;
- while (id_lo-- > 0)
- ret=map_route_occluded_get_item(mr);
+static struct item * map_route_occluded_get_item_byid(struct map_rect_priv *mr, int id_hi, int id_lo) {
+ struct item *ret = NULL;
+ while (id_lo-- > 0) {
+ ret = map_route_occluded_get_item(mr);
+ }
return ret;
}
@@ -917,14 +939,15 @@ static struct map_methods map_route_occluded_methods = {
static struct map_priv *map_route_occluded_new(struct map_methods *meth, struct attr **attrs) {
struct map_priv *ret;
struct attr *navit;
- dbg(lvl_debug,"enter");
- navit=attr_search(attrs, NULL, attr_navit);
- if (! navit)
+ dbg(lvl_debug, "enter\n");
+ navit = attr_search(attrs, NULL, attr_navit);
+ if (!navit) {
return NULL;
- ret=g_new0(struct map_priv, 1);
- *meth=map_route_occluded_methods;
- ret->navit=navit->u.navit;
- dbg(lvl_debug,"m=%p navit=%p", ret, ret->navit);
+ }
+ ret = g_new0(struct map_priv, 1);
+ *meth = map_route_occluded_methods;
+ ret->navit = navit->u.navit;
+ dbg(lvl_debug, "m = %p navit = %p", ret, ret->navit);
return ret;
}
@@ -939,20 +962,20 @@ static void pedestrian_graphics_resize(struct graphics *gra, int w, int h) {
done=1;
}
#endif
- pedestrian_data.w=w;
- pedestrian_data.h=h;
+ pedestrian_data.w = w;
+ pedestrian_data.h = h;
}
static void pedestrian_draw_arrow(struct graphics *gra, char *name, int x, int y) {
- char *src=graphics_icon_path(name);
- struct graphics_image *img=graphics_image_new(gra, src);
- struct graphics_gc *gc=graphics_gc_new(gra);
- struct color col= {0xffff,0xffff,0xffff,0xffff};
+ char *src = graphics_icon_path(name);
+ struct graphics_image *img = graphics_image_new(gra, src);
+ struct graphics_gc *gc = graphics_gc_new(gra);
+ struct color col = {0xffff, 0xffff, 0xffff, 0xffff};
struct point p;
graphics_gc_set_foreground(gc, &col);
- p.x=x;
- p.y=y;
+ p.x = x;
+ p.y = y;
graphics_draw_image(gra, gc, &p, img);
graphics_image_free(gra, img);
graphics_gc_destroy(gc);
@@ -964,36 +987,43 @@ static void pedestrian_draw_arrows(struct graphics *gra) {
struct map_rect *route_map_rect;
struct item *item;
- if (orientation == 2)
+ if (orientation == ORIENTATION_FLAT) {
return;
+ }
if (!navit_get_attr(pedestrian_data.nav, attr_route, &route, NULL)) {
- dbg(lvl_debug,"no route in navit");
+ dbg(lvl_debug, "no route in navit");
return;
}
if (!route_get_attr(route.u.route, attr_map, &route_map, NULL)) {
- dbg(lvl_debug,"no map in route");
+ dbg(lvl_debug, "no map in route");
return;
}
- route_map_rect=map_rect_new(route_map.u.map, NULL);
+ route_map_rect = map_rect_new(route_map.u.map, NULL);
if (!route_map_rect) {
- dbg(lvl_debug,"no route map rect");
+ dbg(lvl_debug, "no route map rect");
return;
}
- while ((item=map_rect_get_item(route_map_rect))) {
+ while ((item = map_rect_get_item(route_map_rect))) {
if (item->type == type_street_route) {
struct coord c[2];
if (item_coord_get(item, c, 2) == 2) {
- struct coord *center=transform_get_center(navit_get_trans(pedestrian_data.nav));
- int angle=transform_get_angle_delta(center, &c[1], 0);
- angle-=pedestrian_data.yaw;
- if (angle < 0)
- angle+=360;
- if (angle >= 360)
- angle-=360;
- if (angle > 180 && angle < 350)
- pedestrian_draw_arrow(gra,"gui_arrow_left_32_32.png",0,pedestrian_data.h/2-16);
- if (angle > 10 && angle <= 180)
- pedestrian_draw_arrow(gra,"gui_arrow_right_32_32.png",pedestrian_data.w-32,pedestrian_data.h/2-16);
+ struct coord *center = transform_get_center(navit_get_trans(pedestrian_data.nav));
+ int angle = transform_get_angle_delta(center, &c[1], 0);
+ angle -= pedestrian_data.yaw;
+ if (angle < 0) {
+ angle += 360;
+ }
+ if (angle >= 360) {
+ angle -= 360;
+ }
+ if (angle > 180 && angle < 350) {
+ pedestrian_draw_arrow(gra, "gui_arrow_left_32_32.png", 0,
+ pedestrian_data.h / 2 - 16);
+ }
+ if (angle > 10 && angle <= 180) {
+ pedestrian_draw_arrow(gra, "gui_arrow_right_32_32.png", pedestrian_data.w - 32,
+ pedestrian_data.h / 2 - 16);
+ }
}
break;
}
@@ -1027,7 +1057,7 @@ void pedestrian_write_tilt(int fd, int axis) {
ret=write(fd, buffer+axis, 1);
if (ret != 2) {
- dbg(lvl_debug,"ret=%d",ret);
+ dbg(lvl_debug,"ret=%dn",ret);
}
}
@@ -1096,94 +1126,104 @@ void pedestrian_setup_tilt(struct navit *nav) {
float sensors[2][3];
static void android_sensors(struct navit *nav, int sensor, float *x, float *y, float *z) {
- float yaw=0,pitch=0;
+ int yaw = 0, pitch = 0;
struct attr attr;
- sensors[sensor-1][0]=*x;
- sensors[sensor-1][1]=*y;
- sensors[sensor-1][2]=*z;
- if (sensors_locked)
+ sensors[sensor - 1][0] = *x;
+ sensors[sensor - 1][1] = *y;
+ sensors[sensor - 1][2] = *z;
+ if (sensors_locked) {
return;
- dbg(lvl_debug,"enter %d %f %f %f",sensor,*x,*y,*z);
- if (sensor == 1) {
- if (*x > 7.5)
- orientation=1; /* landscape */
- if (*y > 7.5)
- orientation=0; /* portrait */
- if (*z > 7.5)
- orientation=2; /* flat */
- dbg(lvl_debug,"orientation=%d",orientation);
}
- if ((orientation_old == 2) != (orientation == 2)) {
+ dbg(lvl_debug, "enter %d %f %f %f\n", sensor, *x, *y, *z);
+ if (sensor == TYPE_ACCELEROMETER) {
+ if (*x > 7.5) {
+ orientation = ORIENTATION_LANDSCAPE;
+ }
+ if (*y > 7.5) {
+ orientation = ORIENTATION_PORTRAIT;
+ }
+ if (*z > 7.5) {
+ orientation = ORIENTATION_FLAT;
+ }
+ dbg(lvl_debug, "orientation = %d\n", orientation);
+ }
+ if ((orientation_old != orientation)) {
struct attr attr, flags_graphics, osd_configuration;
- navit_set_attr(nav, orientation == 2 ? &initial_layout:&main_layout);
+ navit_set_attr(nav, orientation == ORIENTATION_FLAT ? &initial_layout : &main_layout);
navit_get_attr(nav, attr_transformation, &attr, NULL);
- transform_set_scale(attr.u.transformation, orientation == 2 ? 64:16);
- flags_graphics.type=attr_flags_graphics;
- flags_graphics.u.num=orientation == 2 ? 0:10;
+ transform_set_scale(attr.u.transformation, orientation == ORIENTATION_FLAT ? 64 : 16);
+ flags_graphics.type = attr_flags_graphics;
+ flags_graphics.u.num = orientation == ORIENTATION_FLAT ? 0 : 10;
navit_set_attr(nav, &flags_graphics);
- osd_configuration.type=attr_osd_configuration;
- osd_configuration.u.num=orientation == 2 ? 1:2;
+ osd_configuration.type = attr_osd_configuration;
+ osd_configuration.u.num = orientation == ORIENTATION_FLAT ? 1 : 2;
navit_set_attr(nav, &osd_configuration);
+ orientation_old = orientation;
}
- orientation_old=orientation;
+
switch (orientation) {
- case 2:
- if (sensor == 2) {
- yaw=atan2f(-*y,-*x)*180/M_PI+180;
+ case ORIENTATION_FLAT:
+ if (sensor == TYPE_MAGNETIC_FIELD) {
+ yaw = (int) (atan2f(-*y, -*x) * 180 / M_PI + 180);
}
- pitch=0;
+ pitch = 0;
break;
- case 1:
- if (sensor == 1) {
- pitch=atan2f(*x,*z)*180/M_PI;
+ case ORIENTATION_LANDSCAPE:
+ if (sensor == TYPE_ACCELEROMETER) {
+ pitch = (int) (atan2f(*x, *z) * 180 / M_PI);
}
- if (sensor == 2) {
- yaw=atan2f(-*y,*z)*180/M_PI+180;
+ if (sensor == TYPE_MAGNETIC_FIELD) {
+ yaw = (int) (atan2f(-*y, *z) * 180 / M_PI + 180);
}
break;
- case 0:
- if (sensor == 1) {
- pitch=atan2f(*y,*z)*180/M_PI;
+ case ORIENTATION_PORTRAIT:
+ if (sensor == TYPE_ACCELEROMETER) {
+ pitch = (int) (atan2f(*y, *z) * 180 / M_PI);
}
- if (sensor == 2) {
- yaw=atan2f(*x,*z)*180/M_PI+180;
+ if (sensor == TYPE_MAGNETIC_FIELD) {
+ yaw = (int) (atan2f(*x, *z) * 180 / M_PI + 180);
}
break;
+ default:
+ break;
}
if (navit_get_attr(nav, attr_transformation, &attr, NULL)) {
- struct transformation *trans=attr.u.transformation;
- if (sensor == 1) {
- if (orientation != 2)
- pitch+=2.0;
- transform_set_pitch(trans, (int)pitch);
- dbg(lvl_debug,"pich %d %f",orientation,pitch);
+ struct transformation *trans = attr.u.transformation;
+ if (sensor == TYPE_ACCELEROMETER) {
+ if (orientation != ORIENTATION_FLAT) {
+ pitch += 2.0;
+ }
+ transform_set_pitch(trans, pitch);
+ dbg(lvl_debug, "pich %d %i", orientation, pitch);
} else {
struct attr attr;
- attr.type=attr_orientation;
- attr.u.num=yaw-1.0;
+ attr.type = attr_orientation;
+ attr.u.num = yaw - 1;
if (attr.u.num < 0)
- attr.u.num+=360;
- pedestrian_data.yaw=attr.u.num;
+ attr.u.num += 360;
+ pedestrian_data.yaw = (int) attr.u.num;
navit_set_attr(nav, &attr);
- dbg(lvl_debug,"yaw %d %f",orientation,yaw);
- if (orientation == 2)
+ dbg(lvl_debug, "yaw %d %i", orientation, yaw);
+ if (orientation == ORIENTATION_FLAT) {
navit_set_center_cursor(nav, 1, 0);
+ }
}
}
}
+
#endif
static void pedestrian_log(char **logstr) {
#ifdef HAVE_API_ANDROID
- char *tag=g_strdup_printf(
- "\t\t<navit:compass:x>%f</navit:compass:x>\n"
- "\t\t<navit:compass:y>%f</navit:compass:y>\n"
- "\t\t<navit:compass:z>%f</navit:compass:z>\n"
- "\t\t<navit:accel:x>%f</navit:accel:x>\n"
- "\t\t<navit:accel:y>%f</navit:accel:y>\n"
- "\t\t<navit:accel:z>%f</navit:accel:z>\n",
- sensors[0][0],sensors[0][1],sensors[0][2],
- sensors[1][0],sensors[1][1],sensors[1][2]);
+ char *tag = g_strdup_printf(
+ "\t\t<navit:compass:x>%f</navit:compass:x>\n"
+ "\t\t<navit:compass:y>%f</navit:compass:y>\n"
+ "\t\t<navit:compass:z>%f</navit:compass:z>\n"
+ "\t\t<navit:accel:x>%f</navit:accel:x>\n"
+ "\t\t<navit:accel:y>%f</navit:accel:y>\n"
+ "\t\t<navit:accel:z>%f</navit:accel:z>\n",
+ sensors[0][0], sensors[0][1], sensors[0][2],
+ sensors[1][0], sensors[1][1], sensors[1][2]);
vehicle_log_gpx_add_tag(tag, logstr);
#endif
}
@@ -1193,7 +1233,7 @@ static void vehicle_changed(struct vehicle *v, struct transformation *trans) {
struct attr attr;
if (vehicle_get_attr(v, attr_position_direction, &attr, NULL)) {
int dir=(int)(*attr.u.numd);
- dbg(lvl_debug,"enter %d",dir);
+ dbg(lvl_debug,"enter %d\n",dir);
transform_set_pitch(trans, 90);
transform_set_yaw(trans, dir);
}
@@ -1206,7 +1246,7 @@ static void pedestrian_navit_init(struct navit *nav) {
struct attr route_map;
struct attr map;
struct attr mapset;
- struct attr graphics,attr,flags_graphics;
+ struct attr graphics, attr, flags_graphics;
struct transformation *trans;
struct attr_iter *iter;
@@ -1216,32 +1256,37 @@ static void pedestrian_navit_init(struct navit *nav) {
jmethodID cid;
jobject navitsensors;
- dbg(lvl_debug,"enter");
+ dbg(lvl_debug, "enter\n");
+ orientation = ORIENTATION_UNKNOWN;
+ orientation_old = ORIENTATION_UNKNOWN;
if (android_find_class_global("org/navitproject/navit/NavitSensors", &navitsensorsclass)) {
- dbg(lvl_debug,"class found");
- cid = (*jnienv)->GetMethodID(jnienv, navitsensorsclass, "<init>", "(Landroid/content/Context;I)V");
- dbg(lvl_debug,"cid=%p",cid);
+ dbg(lvl_debug, "class found\n");
+ cid = (*jnienv)->GetMethodID(jnienv, navitsensorsclass, "<init>",
+ "(Landroid/content/Context;J)V");
+ dbg(lvl_debug, "cid=%p\n", cid);
if (cid) {
- cb=callback_new_1(callback_cast(android_sensors), nav);
- navitsensors=(*jnienv)->NewObject(jnienv, navitsensorsclass, cid, android_application, cb);
- dbg(lvl_debug,"object=%p",navitsensors);
- if (navitsensors)
+ cb = callback_new_1(callback_cast(android_sensors), nav);
+ navitsensors = (*jnienv)->NewObject(jnienv, navitsensorsclass, cid, android_activity, cb);
+ dbg(lvl_debug, "object=%p\n", navitsensors);
+ if (navitsensors) {
navitsensors = (*jnienv)->NewGlobalRef(jnienv, navitsensors);
+ }
}
}
#endif
- pedestrian_data.nav=nav;
- flags_graphics.type=attr_flags_graphics;
- flags_graphics.u.num=10;
+ pedestrian_data.nav = nav;
+ flags_graphics.type = attr_flags_graphics;
+ flags_graphics.u.num = 10;
navit_set_attr(nav, &flags_graphics);
if (navit_get_attr(nav, attr_graphics, &graphics, NULL)) {
struct attr attr;
- struct callback *cb=callback_new_attr_1(callback_cast(pedestrian_graphics_resize),attr_resize,graphics.u.graphics);
+ struct callback *cb = callback_new_attr_1(callback_cast(pedestrian_graphics_resize),
+ attr_resize, graphics.u.graphics);
graphics_add_callback(graphics.u.graphics, cb);
- cb=callback_new_attr_1(callback_cast(pedestrian_graphics_postdraw),attr_postdraw,graphics.u.graphics);
+ cb = callback_new_attr_1(callback_cast(pedestrian_graphics_postdraw), attr_postdraw, graphics.u.graphics);
graphics_add_callback(graphics.u.graphics, cb);
- attr.type=attr_use_camera;
- attr.u.num=1;
+ attr.type = attr_use_camera;
+ attr.u.num = 1;
graphics_set_attr(graphics.u.graphics, &attr);
}
osd_rocket_init(nav);
@@ -1249,7 +1294,7 @@ static void pedestrian_navit_init(struct navit *nav) {
#ifndef HAVE_API_ANDROID
pedestrian_setup_tilt(nav);
#endif
- trans=navit_get_trans(nav);
+ trans = navit_get_trans(nav);
transform_set_pitch(trans, 90);
transform_set_roll(trans, 0);
transform_set_hog(trans, 2);
@@ -1259,34 +1304,32 @@ static void pedestrian_navit_init(struct navit *nav) {
return;
if (!route_get_attr(route.u.route, attr_map, &route_map, NULL))
return;
- dbg(lvl_debug,"enter 1");
+ dbg(lvl_debug, "enter 1\n");
#if 0
struct attr active;
active.type=attr_active;
active.u.num=0;
if (!map_set_attr(route_map.u.map, &active))
return;
- dbg(lvl_debug,"enter 2");
+ dbg(lvl_debug,"enter 2\n");
#endif
if (!navit_get_attr(nav, attr_mapset, &mapset, NULL))
return;
- map.type=attr_map;
- map.u.map=map_new(NULL, (struct attr*[]) {
+ map.type = attr_map;
+ map.u.map = map_new(NULL, (struct attr *[]) {
&(struct attr) {
attr_type, {"route_occluded"}
- },
- &(struct attr) {
+ }, &(struct attr) {
attr_data, {""}
},
&(struct attr) {
attr_description, {"Occluded Route"}
},
&(struct attr) {
- attr_navit, {(void *)nav}
- },
- NULL
+ attr_navit, {(void *) nav}
+ }, NULL
});
- global_map=map.u.map;
+ global_map = map.u.map;
mapset_add_attr(mapset.u.mapset, &map);
#if 0
@@ -1295,11 +1338,11 @@ static void pedestrian_navit_init(struct navit *nav) {
#endif
transform_set_scale(trans, 16);
navit_get_attr(nav, attr_layout, &initial_layout, NULL);
- iter=navit_attr_iter_new();
- while(navit_get_attr(nav, attr_layout, &attr, iter)) {
+ iter = navit_attr_iter_new();
+ while (navit_get_attr(nav, attr_layout, &attr, iter)) {
if (!strcmp(attr.u.layout->name, "Route")) {
- dbg(lvl_debug,"found %s",attr_to_name(attr.type));
- main_layout=attr;
+ dbg(lvl_debug, "found %s", attr_to_name(attr.type));
+ main_layout = attr;
#if 1
navit_set_attr(nav, &attr);
#endif
@@ -1309,8 +1352,8 @@ static void pedestrian_navit_init(struct navit *nav) {
navit_attr_iter_destroy(iter);
if (navit_get_attr(nav, attr_vehicle, &attr, NULL)) {
struct attr cbattr;
- cbattr.u.callback=callback_new_attr_0(callback_cast(pedestrian_log), attr_log_gpx);
- cbattr.type=attr_callback;
+ cbattr.u.callback = callback_new_attr_0(callback_cast(pedestrian_log), attr_log_gpx);
+ cbattr.type = attr_callback;
vehicle_add_attr(attr.u.vehicle, &cbattr);
#ifdef DEMO
cbattr.u.callback=callback_new_attr_2(callback_cast(vehicle_changed), attr_position_coord_geo, attr.u.vehicle, trans);
@@ -1322,37 +1365,41 @@ static void pedestrian_navit_init(struct navit *nav) {
}
static void pedestrian_navit(struct navit *nav, int add) {
- dbg(lvl_debug,"enter");
+ dbg(lvl_debug, "enter\n");
struct attr callback;
if (add) {
- callback.type=attr_callback;
- callback.u.callback=callback_new_attr_0(callback_cast(pedestrian_navit_init), attr_navit);
+ callback.type = attr_callback;
+ callback.u.callback = callback_new_attr_0(callback_cast(pedestrian_navit_init), attr_navit);
navit_add_attr(nav, &callback);
}
}
void plugin_init(void) {
- struct attr callback,navit;
+ struct attr callback, navit;
struct attr_iter *iter;
#ifdef HAVE_API_ANDROID
jclass ActivityClass;
jmethodID Activity_setRequestedOrientation;
- if (!android_find_class_global("android/app/Activity", &ActivityClass))
- dbg(lvl_error,"failed to get class android/app/Activity");
- Activity_setRequestedOrientation = (*jnienv)->GetMethodID(jnienv, ActivityClass, "setRequestedOrientation", "(I)V");
- if (Activity_setRequestedOrientation == NULL)
- dbg(lvl_error,"failed to get method setRequestedOrientation from android/app/Activity");
+ if (!android_find_class_global("android/app/Activity", &ActivityClass)) {
+ dbg(lvl_error, "failed to get class android/app/Activity\n");
+ }
+ Activity_setRequestedOrientation = (*jnienv)->GetMethodID(jnienv, ActivityClass,
+ "setRequestedOrientation", "(I)V");
+ if (Activity_setRequestedOrientation == NULL) {
+ dbg(lvl_error, "failed to get method setRequestedOrientation from android/app/Activity\n");
+ }
(*jnienv)->CallVoidMethod(jnienv, android_activity, Activity_setRequestedOrientation, 0);
#endif
plugin_register_category_osd("marker", osd_marker_new);
plugin_register_category_map("route_occluded", map_route_occluded_new);
- callback.type=attr_callback;
- callback.u.callback=callback_new_attr_0(callback_cast(pedestrian_navit), attr_navit);
+ callback.type = attr_callback;
+ callback.u.callback = callback_new_attr_0(callback_cast(pedestrian_navit), attr_navit);
config_add_attr(config, &callback);
- iter=config_attr_iter_new();
- while (config_get_attr(config, attr_navit, &navit, iter))
+ iter = config_attr_iter_new();
+ while (config_get_attr(config, attr_navit, &navit, iter)) {
pedestrian_navit_init(navit.u.navit);
+ }
config_attr_iter_destroy(iter);
}
diff --git a/navit/search.c b/navit/search.c
index 06afcbfe6..e700f4355 100644
--- a/navit/search.c
+++ b/navit/search.c
@@ -135,13 +135,20 @@ int search_list_level(enum attr_type attr_type) {
}
}
-static char *search_fix_spaces(char *str) {
+/**
+ * @brief Replaces ',' and '/' by ' ', deduplicates spaces within the string
+ * and strips spaces from both ends of the string
+ *
+ * @param pointer to the string to cleanup
+ * @return pointer to the cleaned up string
+ */
+char *search_fix_spaces(const char *str) {
int i;
int len=strlen(str);
char c,*s,*d,*ret=g_strdup(str);
for (i = 0 ; i < len ; i++) {
- if (ret[i] == ',' || ret[i] == ',' || ret[i] == '/')
+ if (ret[i] == ',' || ret[i] == '/')
ret[i]=' ';
}
s=ret;
@@ -160,6 +167,9 @@ static char *search_fix_spaces(char *str) {
len--;
}
} while (c);
+ // Make sure the string is terminated at current position even if nothing has been added to it.
+ // This case happen when you use a string containing only chars that will be discarded.
+ *d='\0';
return ret;
}
diff --git a/navit/search.h b/navit/search.h
index 50756606f..cdf93410e 100644
--- a/navit/search.h
+++ b/navit/search.h
@@ -87,6 +87,7 @@ char *search_list_get_unique(struct search_list *this_, char *unique);
struct search_list_result *search_list_get_result(struct search_list *this_);
void search_list_destroy(struct search_list *this_);
void search_init(void);
+char *search_fix_spaces(const char *str);
/* end of prototypes */
#ifdef __cplusplus
}
diff --git a/navit/speech/qt5_espeak/Qt5EspeakAudioOut.h b/navit/speech/qt5_espeak/Qt5EspeakAudioOut.h
index d7eb632fd..520163ad1 100644
--- a/navit/speech/qt5_espeak/Qt5EspeakAudioOut.h
+++ b/navit/speech/qt5_espeak/Qt5EspeakAudioOut.h
@@ -26,6 +26,7 @@
#include <QObject>
class Qt5EspeakAudioOut : public QObject {
Q_OBJECT
+
public:
/* Instantiate this. Parameters are the sample rate to use,
* and the category to sort this audio output to. Not all platforms
@@ -45,6 +46,8 @@ signals:
void call_resume(int state);
protected:
+ /* None */
+
private:
/* internal buffer */
QByteArray* data;
diff --git a/navit/traffic.c b/navit/traffic.c
index 475659834..035707934 100644
--- a/navit/traffic.c
+++ b/navit/traffic.c
@@ -616,7 +616,7 @@ static void tm_item_update_attrs(struct item * item, struct route * route) {
msgdata = (struct item_msg_priv *) msglist->data;
if (msgdata->speed < speed)
speed = msgdata->speed;
- if (msgdata->delay < delay)
+ if (msgdata->delay > delay)
delay = msgdata->delay;
/* TODO attrs */
}
@@ -3651,7 +3651,7 @@ static int traffic_message_restore_segments(struct traffic_message * this_, stru
}
if (map_item) {
pitem->is_matched = 1;
- for (i = 1; i < ccnt; i++)
+ for (i = 1; i < pitem->coord_count; i++)
pitem->length += transform_distance(map_projection(m), &(ca[i-1]), &(ca[i]));
loc_len += pitem->length;
}
diff --git a/navit/vehicle/qt5/vehicle_qt5.cpp b/navit/vehicle/qt5/vehicle_qt5.cpp
index 9c613ca54..9daa2ecb9 100644
--- a/navit/vehicle/qt5/vehicle_qt5.cpp
+++ b/navit/vehicle/qt5/vehicle_qt5.cpp
@@ -38,7 +38,7 @@ extern "C" {
#include <time.h>
#include "vehicle_qt5.h"
-//#include "vehicle_qt5.moc"
+// #include "vehicle_qt5.moc"
#include <QDateTime>
/**
@@ -75,7 +75,6 @@ void QNavitGeoReceiver::satellitesInViewUpdated(const QList<QGeoSatelliteInfo>&
}
void QNavitGeoReceiver::positionUpdated(const QGeoPositionInfo& info) {
-
/* ignore stale view */
if (info.coordinate().isValid()) {
if (info.timestamp().toUTC().secsTo(QDateTime::currentDateTimeUtc()) > 20) {
@@ -120,17 +119,17 @@ void QNavitGeoReceiver::positionUpdated(const QGeoPositionInfo& info) {
dbg(lvl_debug, "Got valid altitude (alt %f)", info.coordinate().altitude());
priv->height = info.coordinate().altitude();
}
- //dbg(lvl_debug, "Time %s", info.timestamp().toUTC().toString().toLatin1().data());
+ // dbg(lvl_debug, "Time %s", info.timestamp().toUTC().toString().toLatin1().data());
priv->fix_time = info.timestamp().toUTC().toTime_t();
callback_list_call_attr_0(priv->cbl, attr_position_coord_geo);
- if(priv->have_coords != attr_position_valid_valid) {
+ if (priv->have_coords != attr_position_valid_valid) {
priv->have_coords = attr_position_valid_valid;
callback_list_call_attr_0(priv->cbl, attr_position_valid);
}
} else {
dbg(lvl_debug, "Got invalid coordinate");
callback_list_call_attr_0(priv->cbl, attr_position_coord_geo);
- if(priv->have_coords != attr_position_valid_invalid) {
+ if (priv->have_coords != attr_position_valid_invalid) {
priv->have_coords = attr_position_valid_invalid;
callback_list_call_attr_0(priv->cbl, attr_position_valid);
}
@@ -205,9 +204,9 @@ static int vehicle_qt5_position_attr_get(struct vehicle_priv* priv,
priv->fix_time = 0;
return 0;
}
- //dbg(lvl_debug,"Fix Time: %s", priv->fixiso8601);
+ // dbg(lvl_debug,"Fix Time: %s", priv->fixiso8601);
} else {
- //dbg(lvl_debug,"Fix Time: 0");
+ // dbg(lvl_debug,"Fix Time: 0");
return 0;
}
break;
@@ -239,7 +238,7 @@ static int vehicle_qt5_set_attr(struct vehicle_priv* priv, struct attr* attr) {
break;
case attr_position_coord_geo:
priv->geo = *attr->u.coord_geo;
- if(priv->have_coords != attr_position_valid_valid) {
+ if (priv->have_coords != attr_position_valid_valid) {
priv->have_coords = attr_position_valid_valid;
callback_list_call_attr_0(priv->cbl, attr_position_valid);
}
@@ -282,7 +281,7 @@ static struct vehicle_priv* vehicle_qt5_new_qt5(struct vehicle_methods* meth,
} else {
dbg(lvl_debug, "Using %s", ret->source->sourceName().toLatin1().data());
ret->receiver = new QNavitGeoReceiver(NULL, ret);
- if(ret->satellites != NULL) {
+ if (ret->satellites != NULL) {
ret->satellites->setUpdateInterval(1000);
ret->satellites->startUpdates();
}
diff --git a/po/de.po.in b/po/de.po.in
index 16fa0717b..7a704d115 100644
--- a/po/de.po.in
+++ b/po/de.po.in
@@ -1,15 +1,18 @@
# German translations for navit
-# Copyright (C) 2006-2018 The Navit Team
+# Copyright (C) 2006-2019 The Navit Team
# This file is distributed under the same license as the navit package.
# Many thanks to the contributors of this translation:
# Achim Behrens https://launchpad.net/~k1l
# Artem Anufrij https://launchpad.net/~artem-anufrij
# Bernhard Reiter https://launchpad.net/~ockham-razor
# Christian Moll https://launchpad.net/~christian-chrmoll
+# Clemens Kiener https://launchpad.net/~clemens-kiener
# Dennis Gohert https://launchpad.net/~info-degoist
+# Ettore Atalan https://launchpad.net/~atalanttore
# Fred https://launchpad.net/~jelk
# Fume https://launchpad.net/~fume
# KaZeR https://launchpad.net/~kazer
+# Kamikaaze https://launchpad.net/~kamikaazewiesel
# Keruskerfuerst https://launchpad.net/~arminmohring
# Konsti K. https://launchpad.net/~konstantin-koehring
# Lars Hennig https://launchpad.net/~elhennig
@@ -28,6 +31,8 @@
# Tobias Bannert https://launchpad.net/~toba
# Usul https://launchpad.net/~usul1
# everyone https://launchpad.net/~anonymus1338
+# ilovekiruna https://launchpad.net/~ilovekiruna
+# jkoan kerich https://launchpad.net/~jkoan
# lopho https://launchpad.net/~lopho
# metehyi https://launchpad.net/~metehyi
# singesang https://launchpad.net/~singesang
@@ -38,8 +43,8 @@ msgid ""
msgstr ""
"Project-Id-Version: navit 0.5.1\n"
"Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2018-05-01 17:39+0000\n"
-"Last-Translator: Steffen <zintor@lycos.com>\n"
+"PO-Revision-Date: 2019-10-02 18:37+0000\n"
+"Last-Translator: jkoan kerich <jkoan@gmx.de>\n"
"Language-Team: Martin Schaller <martin-s@sourceforge.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -180,7 +185,6 @@ msgstr "%1$sauf die %2$s"
msgid "%1$sonto %2$s|neuter form"
msgstr "%1$sauf das %2$s"
-#. TRANSLATORS: motorway ramp refers to the slip road for entering a motorway.
msgid "onto the motorway ramp"
msgstr "auf die Auffahrt"
@@ -394,7 +398,6 @@ msgstr "dann haben Sie Ihr Ziel erreicht."
msgid "You have reached your destination %s"
msgstr "%s haben Sie Ihr Ziel erreicht"
-#. TRANSLATORS: Exit as a noun, as in "Exit 43 Greenmound-East"
msgid "Interchange"
msgstr "Autobahnknoten"
@@ -412,7 +415,7 @@ msgid "Length"
msgstr "Länge"
msgid "mi"
-msgstr ""
+msgstr "Meile"
msgid "km"
msgstr "km"
@@ -480,6 +483,7 @@ msgid "Anguilla"
msgstr "Anguilla"
#. 008
+#. Android resource: @strings/albania
msgid "Albania"
msgstr "Albanien"
@@ -493,6 +497,7 @@ msgid "Netherlands Antilles"
msgstr "Niederländische Antillen"
#. 024
+#. Android resource: @strings/angola
msgid "Angola"
msgstr "Angola"
@@ -501,6 +506,7 @@ msgid "Antarctica"
msgstr "Antarktis"
#. 032
+#. Android resource: @strings/argentina
msgid "Argentina"
msgstr "Argentinien"
@@ -509,10 +515,12 @@ msgid "American Samoa"
msgstr "Amerikanisch-Samoa"
#. 040
+#. Android resource: @strings/austria
msgid "Austria"
msgstr "Österreich"
#. 036
+#. Android resource: @strings/australia
msgid "Australia"
msgstr "Australien"
@@ -525,10 +533,12 @@ msgid "Aland Islands"
msgstr "Åland"
#. 031
+#. Android resource: @strings/azerbaijan
msgid "Azerbaijan"
msgstr "Aserbaidschan"
#. 070
+#. Android resource: @strings/bosnia_and_herzegovina
msgid "Bosnia and Herzegovina"
msgstr "Bosnien und Herzegowina"
@@ -541,6 +551,7 @@ msgid "Bangladesh"
msgstr "Bangladesch"
#. 056
+#. Android resource: @strings/belgium
msgid "Belgium"
msgstr "Belgien"
@@ -549,6 +560,7 @@ msgid "Burkina Faso"
msgstr "Burkina Faso"
#. 100
+#. Android resource: @strings/bulgaria
msgid "Bulgaria"
msgstr "Bulgarien"
@@ -557,6 +569,7 @@ msgid "Bahrain"
msgstr "Bahrain"
#. 108
+#. Android resource: @strings/burundi
msgid "Burundi"
msgstr "Burundi"
@@ -577,6 +590,7 @@ msgid "Brunei Darussalam"
msgstr "Brunei Darussalam"
#. 068
+#. Android resource: @strings/bolivia
msgid "Bolivia"
msgstr "Bolivien"
@@ -585,6 +599,7 @@ msgid "Bonaire, Sint Eustatius and Saba"
msgstr "Bonaire, Sint Eustatius und Saba"
#. 076
+#. Android resource: @strings/brazil
msgid "Brazil"
msgstr "Brasilien"
@@ -601,10 +616,12 @@ msgid "Bouvet Island"
msgstr "Bouvetinsel"
#. 072
+#. Android resource: @strings/botswana
msgid "Botswana"
msgstr "Botsuana"
#. 112
+#. Android resource: @strings/belarus
msgid "Belarus"
msgstr "Weißrussland"
@@ -613,6 +630,7 @@ msgid "Belize"
msgstr "Belize"
#. 124
+#. Android resource: @strings/canada
msgid "Canada"
msgstr "Kanada"
@@ -621,6 +639,7 @@ msgid "Cocos (Keeling) Islands"
msgstr "Kokosinseln"
#. 180
+#. Android resource: @strings/congo
msgid "Congo, Democratic Republic of the"
msgstr "Kongo, Demokratische Republik"
@@ -633,10 +652,12 @@ msgid "Congo"
msgstr "Republik Kongo"
#. 756
+#. Android resource: @strings/switzerland
msgid "Switzerland"
msgstr "Schweiz"
#. 384
+#. Android resource: @strings/cotedivoire
msgid "Cote d'Ivoire"
msgstr "Elfenbeinküste"
@@ -645,6 +666,7 @@ msgid "Cook Islands"
msgstr "Cookinseln"
#. 152
+#. Android resource: @strings/chile
msgid "Chile"
msgstr "Chile"
@@ -653,10 +675,12 @@ msgid "Cameroon"
msgstr "Kamerun"
#. 156
+#. Android resource: @strings/china
msgid "China"
msgstr "China, Volksrepublik"
#. 170
+#. Android resource: @strings/colombia
msgid "Colombia"
msgstr "Kolumbien"
@@ -665,6 +689,7 @@ msgid "Costa Rica"
msgstr "Costa Rica"
#. 192
+#. Android resource: @strings/cuba
msgid "Cuba"
msgstr "Kuba"
@@ -681,14 +706,17 @@ msgid "Christmas Island"
msgstr "Weihnachtsinsel"
#. 196
+#. Android resource: @strings/cyprus
msgid "Cyprus"
msgstr "Zypern"
#. 203
+#. Android resource: @strings/czech_republic
msgid "Czech Republic"
msgstr "Tschechische Republik"
#. 276
+#. Android resource: @strings/germany
msgid "Germany"
msgstr "Deutschland"
@@ -697,6 +725,7 @@ msgid "Djibouti"
msgstr "Dschibuti"
#. 208
+#. Android resource: @strings/denmark
msgid "Denmark"
msgstr "Dänemark"
@@ -705,6 +734,7 @@ msgid "Dominica"
msgstr "Dominica"
#. 214
+#. Android resource: @strings/dominican_republic
msgid "Dominican Republic"
msgstr "Dominikanische Republik"
@@ -713,10 +743,12 @@ msgid "Algeria"
msgstr "Algerien"
#. 218
+#. Android resource: @strings/ecuador
msgid "Ecuador"
msgstr "Ecuador"
#. 233
+#. Android resource: @strings/estonia
msgid "Estonia"
msgstr "Estland"
@@ -733,14 +765,17 @@ msgid "Eritrea"
msgstr "Eritrea"
#. 724
+#. Android resource: @strings/spain
msgid "Spain"
msgstr "Spanien"
#. 231
+#. Android resource: @strings/ethiopia
msgid "Ethiopia"
msgstr "Äthiopien"
#. 246
+#. Android resource: @strings/finland
msgid "Finland"
msgstr "Finnland"
@@ -757,10 +792,12 @@ msgid "Micronesia, Federated States of"
msgstr "Mikronesien"
#. 234
+#. Android resource: @strings/faroe_islands
msgid "Faroe Islands"
msgstr "Färöer"
#. 250
+#. Android resource: @strings/france
msgid "France"
msgstr "Frankreich"
@@ -769,6 +806,7 @@ msgid "Gabon"
msgstr "Gabun"
#. 826
+#. Android resource: @strings/united_kingdom
msgid "United Kingdom"
msgstr "Vereinigtes Königreich"
@@ -805,6 +843,7 @@ msgid "Gambia"
msgstr "Gambia"
#. 324
+#. Android resource: @strings/guinea
msgid "Guinea"
msgstr "Guinea"
@@ -817,6 +856,7 @@ msgid "Equatorial Guinea"
msgstr "Äquatorialguinea"
#. 300
+#. Android resource: @strings/greece
msgid "Greece"
msgstr "Griechenland"
@@ -837,6 +877,7 @@ msgid "Guinea-Bissau"
msgstr "Guinea-Bissau"
#. 328
+#. Android resource: @strings/guyana
msgid "Guyana"
msgstr "Guyana"
@@ -853,26 +894,32 @@ msgid "Honduras"
msgstr "Honduras"
#. 191
+#. Android resource: @strings/croatia
msgid "Croatia"
msgstr "Kroatien"
#. 332
+#. Android resource: @strings/haiti
msgid "Haiti"
msgstr "Haiti"
#. 348
+#. Android resource: @strings/hungary
msgid "Hungary"
msgstr "Ungarn"
#. 360
+#. Android resource: @strings/indonesia
msgid "Indonesia"
msgstr "Indonesien"
#. 372
+#. Android resource: @strings/ireland
msgid "Ireland"
msgstr "Irland"
#. 376
+#. Android resource: @strings/israel
msgid "Israel"
msgstr "Israel"
@@ -881,6 +928,7 @@ msgid "Isle of Man"
msgstr "Insel Man"
#. 356
+#. Android resource: @strings/india
msgid "India"
msgstr "Indien"
@@ -889,18 +937,22 @@ msgid "British Indian Ocean Territory"
msgstr "Britisches Territorium im Indischen Ozean"
#. 368
+#. Android resource: @strings/iraq
msgid "Iraq"
msgstr "Irak"
#. 364
+#. Android resource: @strings/iran
msgid "Iran, Islamic Republic of"
msgstr "Iran, Islamische Republik"
#. 352
+#. Android resource: @strings/iceland
msgid "Iceland"
msgstr "Island"
#. 380
+#. Android resource: @strings/italy
msgid "Italy"
msgstr "Italien"
@@ -909,6 +961,7 @@ msgid "Jersey"
msgstr "Jersey"
#. 388
+#. Android resource: @strings/jamaica
msgid "Jamaica"
msgstr "Jamaika"
@@ -917,14 +970,17 @@ msgid "Jordan"
msgstr "Jordanien"
#. 392
+#. Android resource: @strings/japan
msgid "Japan"
msgstr "Japan"
#. 404
+#. Android resource: @strings/kenya
msgid "Kenya"
msgstr "Kenia"
#. 417
+#. Android resource: @strings/kyrgyzsyan
msgid "Kyrgyzstan"
msgstr "Kirgisistan"
@@ -961,6 +1017,7 @@ msgid "Cayman Islands"
msgstr "Kaimaninseln"
#. 398
+#. Android resource: @strings/kazakhstan
msgid "Kazakhstan"
msgstr "Kasachstan"
@@ -985,26 +1042,32 @@ msgid "Sri Lanka"
msgstr "Sri Lanka"
#. 430
+#. Android resource: @strings/liberia
msgid "Liberia"
msgstr "Liberia"
#. 426
+#. Android resource: @strings/lesotho
msgid "Lesotho"
msgstr "Lesotho"
#. 440
+#. Android resource: @strings/lithuania
msgid "Lithuania"
msgstr "Litauen"
#. 442
+#. Android resource: @strings/luxembourg
msgid "Luxembourg"
msgstr "Luxemburg"
#. 428
+#. Android resource: @strings/latvia
msgid "Latvia"
msgstr "Lettland"
#. 434
+#. Android resource: @strings/libya
msgid "Libya"
msgstr "Lybien"
@@ -1029,6 +1092,7 @@ msgid "Saint Martin (French part)"
msgstr "Saint-Martin (franz. Teil)"
#. 450
+#. Android resource: @strings/madagascar
msgid "Madagascar"
msgstr "Madagaskar"
@@ -1049,6 +1113,7 @@ msgid "Myanmar"
msgstr "Burma"
#. 496
+#. Android resource: @strings/mongolia
msgid "Mongolia"
msgstr "Mongolei"
@@ -1089,10 +1154,12 @@ msgid "Malawi"
msgstr "Malawi"
#. 484
+#. Android resource: @strings/mexico
msgid "Mexico"
msgstr "Mexiko"
#. 458
+#. Android resource: @strings/malaysia
msgid "Malaysia"
msgstr "Malaysia"
@@ -1101,10 +1168,12 @@ msgid "Mozambique"
msgstr "Mosambik"
#. 516
+#. Android resource: @strings/namibia
msgid "Namibia"
msgstr "Namibia"
#. 540
+#. Android resource: @strings/new_caledonia
msgid "New Caledonia"
msgstr "Neukaledonien"
@@ -1125,6 +1194,7 @@ msgid "Nicaragua"
msgstr "Nicaragua"
#. 528
+#. Android resource: @strings/netherlands
msgid "Netherlands"
msgstr "Niederlande"
@@ -1133,6 +1203,7 @@ msgid "Norway"
msgstr "Norwegen"
#. 524
+#. Android resource: @strings/nepal
msgid "Nepal"
msgstr "Nepal"
@@ -1145,6 +1216,7 @@ msgid "Niue"
msgstr "Niue"
#. 554
+#. Android resource: @strings/newzealand
msgid "New Zealand"
msgstr "Neuseeland"
@@ -1157,6 +1229,7 @@ msgid "Panama"
msgstr "Panama"
#. 604
+#. Android resource: @strings/peru
msgid "Peru"
msgstr "Peru"
@@ -1169,14 +1242,17 @@ msgid "Papua New Guinea"
msgstr "Papua-Neuguinea"
#. 608
+#. Android resource: @strings/philippines
msgid "Philippines"
msgstr "Philippinen"
#. 586
+#. Android resource: @strings/pakistan
msgid "Pakistan"
msgstr "Pakistan"
#. 616
+#. Android resource: @strings/poland
msgid "Poland"
msgstr "Polen"
@@ -1197,6 +1273,7 @@ msgid "Palestinian Territory, Occupied"
msgstr "Palästinensische Autonomiegebiete"
#. 620
+#. Android resource: @strings/portugal
msgid "Portugal"
msgstr "Portugal"
@@ -1205,6 +1282,7 @@ msgid "Palau"
msgstr "Palau"
#. 600
+#. Android resource: @strings/paraguay
msgid "Paraguay"
msgstr "Paraguay"
@@ -1213,10 +1291,12 @@ msgid "Qatar"
msgstr "Katar"
#. 638
+#. Android resource: @strings/reunion
msgid "Reunion"
msgstr "Réunion"
#. 642
+#. Android resource: @strings/romania
msgid "Romania"
msgstr "Rumänien"
@@ -1225,15 +1305,18 @@ msgid "Serbia"
msgstr "Serbien"
#. 643
+#. Android resource: @strings/russian_federation
msgid "Russian Federation"
msgstr "Russische Föderation"
#. 646
+#. Android resource: @strings/rwanda
msgid "Rwanda"
msgstr "Ruanda"
#
#. 682
+#. Android resource: @strings/saudi_arabia
msgid "Saudi Arabia"
msgstr "Saudi-Arabien"
@@ -1254,6 +1337,7 @@ msgid "Sweden"
msgstr "Schweden"
#. 702
+#. Android resource: @strings/singapore
msgid "Singapore"
msgstr "Singapur"
@@ -1270,6 +1354,7 @@ msgid "Svalbard and Jan Mayen"
msgstr "Svalbard und Jan Mayen"
#. 703
+#. Android resource: @strings/slovakia
msgid "Slovakia"
msgstr "Slowakei"
@@ -1290,6 +1375,7 @@ msgid "Somalia"
msgstr "Somalia"
#. 740
+#. Android resource: @strings/suriname
msgid "Suriname"
msgstr "Suriname"
@@ -1334,6 +1420,7 @@ msgid "Togo"
msgstr "Togo"
#. 764
+#. Android resource: @strings/thailand
msgid "Thailand"
msgstr "Thailand"
@@ -1350,6 +1437,7 @@ msgid "Timor-Leste"
msgstr "Osttimor"
#. 795
+#. Android resource: @strings/turkmenistan
msgid "Turkmenistan"
msgstr "Turkmenistan"
@@ -1362,6 +1450,7 @@ msgid "Tonga"
msgstr "Tonga"
#. 792
+#. Android resource: @strings/turkey
msgid "Turkey"
msgstr "Türkei"
@@ -1378,14 +1467,17 @@ msgid "Taiwan, Province of China"
msgstr "Republik China"
#. 834
+#. Android resource: @strings/tanzania
msgid "Tanzania, United Republic of"
msgstr "Tansania, Vereinigte Republik"
#. 804
+#. Android resource: @strings/ukraine
msgid "Ukraine"
msgstr "Ukraine"
#. 800
+#. Android resource: @strings/uganda
msgid "Uganda"
msgstr "Uganda"
@@ -1398,6 +1490,7 @@ msgid "United States"
msgstr "Vereinigte Staaten von Amerika"
#. 858
+#. Android resource: @strings/uruguay
msgid "Uruguay"
msgstr "Uruguay"
@@ -1414,6 +1507,7 @@ msgid "Saint Vincent and the Grenadines"
msgstr "St. Vincent und die Grenadinen"
#. 862
+#. Android resource: @strings/venezuela
msgid "Venezuela"
msgstr "Venezuela"
@@ -1441,6 +1535,10 @@ msgstr "Wallis und Futuna"
msgid "Samoa"
msgstr "Samoa"
+#. 412
+msgid "Kosovo"
+msgstr "Kosovo"
+
#. 887
msgid "Yemen"
msgstr "Jemen"
@@ -1450,6 +1548,7 @@ msgid "Mayotte"
msgstr "Mayotte"
#. 710
+#. Android resource: @strings/south_africa
msgid "South Africa"
msgstr "Südafrika"
@@ -1489,22 +1588,26 @@ msgstr ""
#. We have not found an existing config file from all possibilities
msgid "No config file navit.xml, navit.xml.local found"
msgstr ""
+"Konnte keine Configurations-Datei unter den Möglichkeiten navit.xml, "
+"navit.xml.local finden"
#, c-format
msgid "Error parsing config file '%s': %s"
-msgstr ""
+msgstr "Fehler beim verarbeiten der Konfigurations-Datei '%s': %s"
#, c-format
msgid "Using config file '%s'"
-msgstr ""
+msgstr "Benutze die Konfigurations-Datei '%s'"
#, c-format
msgid "Error: No configuration found in config file '%s'"
-msgstr ""
+msgstr "Fehler: Konnte keine Konfiguration in Datei '%s' finden"
msgid ""
"Internal initialization failed, exiting. Check previous error messages."
msgstr ""
+"Interne Initiierung fehlgeschlagen. Bitte vorangegangene Fehlermeldungen "
+"prüfen"
msgid "unknown street"
msgstr "unbekannte Straße"
@@ -1718,8 +1821,17 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Einkaufen"
-msgid "Select a search radius from screen center"
-msgstr "Entfernung vom Bildschirmmittelpunkt"
+#. Input is in kilometers
+msgid "Select a search radius from screen center in km"
+msgstr ""
+"Bitte einen Suchradius von der Mitte des Bildschirms ausgehend auswählen (in "
+"km)"
+
+#. Input is in miles.
+msgid "Select a search radius from screen center in miles"
+msgstr ""
+"Bitte einen Suchradius von der Mitte des Bildschirms ausgehend auswählen (in "
+"Meilen)"
#, c-format
msgid "POI %s. %s"
@@ -1727,15 +1839,15 @@ msgstr "POI %s. %s"
#, c-format
msgid "Set destination to %ld, %ld "
-msgstr ""
+msgstr "Setze Ziel auf %ld, %ld "
#, c-format
msgid "Set map to %ld, %ld "
-msgstr ""
+msgstr "Setze Karte auf Position %ld, %ld "
#, c-format
msgid "Set next visit to %ld, %ld "
-msgstr ""
+msgstr "Stelle den nächsten Wegpunkt auf %ld, %ld "
msgid "POI search"
msgstr "POI Suche"
@@ -1743,9 +1855,6 @@ msgstr "POI Suche"
msgid "Select a category"
msgstr "Eine Kategorie auswählen"
-msgid "Select a distance to look for (km)"
-msgstr "Wählen Sie eine Suchdistanz (km)"
-
msgid "Select a POI"
msgstr "Wählen Sie ein POI"
@@ -1758,8 +1867,8 @@ msgstr "Kategorie"
msgid "Direction"
msgstr "Richtung"
-msgid "Distance(m)"
-msgstr "Entfernung (m)"
+msgid "Distance"
+msgstr "Distanz"
msgid "Name"
msgstr "Bezeichnung"
@@ -1806,7 +1915,7 @@ msgstr "OT"
#, c-format
msgid "Route %4.1f%s %02d:%02d ETA"
-msgstr ""
+msgstr "Route %4.1f%s %02d:%02d ETA"
msgid "Route 0000km 0+00:00 ETA"
msgstr "Route 0000km 0+00:00 ETA"
@@ -2070,9 +2179,6 @@ msgstr "Achtung Blitzer!"
msgid "Please decrease your speed"
msgstr "Bitte Geschwindigkeit verringern"
-msgid "filenamePath"
-msgstr "Dateipfad"
-
msgid "Vehicle Position"
msgstr "Fahrzeugposition"
@@ -2140,24 +2246,20 @@ msgid "Layers"
msgstr "Ebenen"
msgid "Zoom to route"
-msgstr ""
+msgstr "Zoom auf Strecke"
msgid "Description"
msgstr "Beschreibung"
msgid ""
-"Drop last \n"
+"Drop last\n"
"Waypoint"
-msgstr ""
-"Letzten Wegpunkt\n"
-"entfernen"
+msgstr "Letzten Wegpunkt entfernen"
msgid ""
-"Drop next \n"
+"Drop next\n"
"Waypoint"
-msgstr ""
-"Nächsten Wegpunkt\n"
-"entfernen"
+msgstr "Nächsten Wegpunkt entfernen"
msgid "Satellite Status"
msgstr "Satellitenstatus"
@@ -2185,6 +2287,14 @@ msgstr "LKW"
msgid "Yes"
msgstr "Ja"
+#. Android resource: @strings/cancel
+msgid "Cancel"
+msgstr "Abbrechen"
+
+#. Android resource: @strings/channel_name
+msgid "Navit"
+msgstr "Navit"
+
#. Android resource: @strings/notification_ticker
msgid "Navit started"
msgstr "Navit gestartet"
@@ -2258,6 +2368,10 @@ msgstr "Kartenort festlegen"
msgid "Route to here"
msgstr "Ziel setzen"
+#. Android resource: @strings/position_popup_view
+msgid "View"
+msgstr "Ansicht"
+
#. Android resource: @strings/map_delete
msgid "Delete this map?"
msgstr "Diese Karte löschen?"
@@ -2290,6 +2404,14 @@ msgstr "Download der Karte abgebrochen"
msgid "Not enough free space"
msgstr "Nicht genug freier Speicher"
+#. Android resource: @strings/map_download_oversize
+msgid ""
+"Sorry, we currently do not support maps above 3.8G on Android, please select "
+"a smaller one."
+msgstr ""
+"Entschuldigung. Derzeit untestützen wir auf Android keine Karten die größer "
+"als 3,8Gigabyte sind. Bitte wählen Sie eine kleinere Karte aus."
+
#. Android resource: @strings/map_no_fix
msgid "No location. Reopen after location fix."
msgstr "Position noch nicht bekannt."
@@ -2298,6 +2420,40 @@ msgstr "Position noch nicht bekannt."
msgid "Maps containing current location"
msgstr "Karten passend zur aktuellen Position"
+#. Android resource: @strings/maps_installed
+msgid "Installed maps"
+msgstr "Installierte Karten"
+
+#. Android resource: @strings/map_downloading
+msgid "downloading"
+msgstr "wird heruntergeladen"
+
+#. Android resource: @strings/map_download_medium_unavailable
+msgid "Media selected for map storage is not available"
+msgstr ""
+"Der eingestellte Speicherort für das Kartenmaterial ist nicht verfügbar."
+
+#. Android resource: @strings/map_download_error_writing_map
+msgid "Error writing map!"
+msgstr "Fehler beim speichern der Karte!"
+
+#. Android resource: @strings/map_location_changed
+#, c-format
+msgid "New location set to %s Restart Navit to apply the changes."
+msgstr ""
+"Der Speicherort wurde auf %s gesetzt. Bitte starten Sie Navit neu, um die "
+"Änderungen zu übernehmen."
+
+#. Android resource: @strings/map_location_unavailable
+#, c-format
+msgid ""
+"Current map location %s is not available Please restart Navit after you "
+"attach an SD card or select a different map location."
+msgstr ""
+"Der aktuelle Kartenpunkt %s ist nicht verfügbar. Bitte starten Sie Navit "
+"neu, nachdem Sie eine SD-Karte eingesetzt haben oder wählen Sie eine anderen "
+"Kartenpunkt aus."
+
#. Android resource: @strings/address_search_title
msgid "Address search"
msgstr "Adresse suchen"
@@ -2437,425 +2593,552 @@ msgstr ""
msgid "One or more ungranted permissions"
msgstr "Eine oder mehrere nicht gewährte Berechtigungen"
-#, c-format
-#~ msgid "Route %4.0fkm %02d:%02d ETA"
-#~ msgstr "Route %4.0fkm %02d:%02d ETA"
+#. Android resource: @strings/whole_planet
+msgid "Whole Planet"
+msgstr "Ganze Welt"
-#~ msgid "No config file navit.xml, navit.xml.local found\n"
-#~ msgstr "Keine Konfigurations-Datei navit.xml oder navit.xml.local gefunden\n"
+#. Android resource: @strings/africa
+msgid "Africa"
+msgstr "Afrika"
-#, c-format
-#~ msgid "Error parsing config file '%s': %s\n"
-#~ msgstr "Fehler beim Parsen der Konfigurations-Datei '%s': %s\n"
+#. Android resource: @strings/canary_islands
+msgid "Canary Islands"
+msgstr "Kanarische Inseln"
-#, c-format
-#~ msgid "Using config file '%s'\n"
-#~ msgstr "Benutze Konfigurations-Datei '%s'\n"
+#. Android resource: @strings/asia
+msgid "Asia"
+msgstr "Asien"
-#~ msgid ""
-#~ "Internal initialization failed, exiting. Check previous error messages.\n"
-#~ msgstr ""
-#~ "Interne Initialisierung fehlgeschlagen, Programm wird beendet. Frühere "
-#~ "Fehler beachten.\n"
+#. Android resource: @strings/taiwan
+msgid "Taiwan"
+msgstr "Taiwan"
-#~ msgid "partial match"
-#~ msgstr "ungefähr"
+#. Android resource: @strings/korea
+msgid "Korea"
+msgstr "Korea"
-#~ msgid "Downloaded maps"
-#~ msgstr "Heruntergeladene Karten"
+#. Android resource: @strings/uae_other
+msgid "UAE+Other"
+msgstr "Vereinigte Arabische Emirate+weitere"
-#~ msgid "Error downloading map!"
-#~ msgstr "Fehler beim Kartendownload"
+#. Android resource: @strings/oceania
+msgid "Oceania"
+msgstr "Ozeanien"
-#~ msgid "Taiwan"
-#~ msgstr "Taiwan"
+#. Android resource: @strings/tasmania
+msgid "Tasmania"
+msgstr "Tasmanien"
-#~ msgid "Asia"
-#~ msgstr "Asien"
+#. Android resource: @strings/victoria
+msgid "Victoria"
+msgstr "Victoria"
-#~ msgid "Canary Islands"
-#~ msgstr "Kanarische Inseln"
+#. Android resource: @strings/new_south_wales
+msgid "New South Wales"
+msgstr "New South Wales"
-#~ msgid "Whole Planet"
-#~ msgstr "Ganze Welt"
+#. Android resource: @strings/europe
+msgid "Europe"
+msgstr "Europa"
-#~ msgid "Map data (c) OpenStreetMap contributors, ODBL"
-#~ msgstr "Kartendaten (c) von OpenStreetMap unter ODbL"
+#. Android resource: @strings/western_europe
+msgid "Western Europe"
+msgstr "West-Europa"
-#~ msgid "Korea"
-#~ msgstr "Korea"
+#. Android resource: @strings/azores
+msgid "Azores"
+msgstr "Azoren"
-#~ msgid "Tasmania"
-#~ msgstr "Tasmanien"
+#. Android resource: @strings/benelux
+msgid "BeNeLux"
+msgstr "Beneluxländer"
-#~ msgid "Oceania"
-#~ msgstr "Ozeanien"
+#. Android resource: @strings/alsace
+msgid "Alsace"
+msgstr "Elsass"
-#~ msgid "Alsace"
-#~ msgstr "Elsass"
+#. Android resource: @strings/aquitaine
+msgid "Aquitaine"
+msgstr "Aquitanien"
-#~ msgid "BeNeLux"
-#~ msgstr "Beneluxländer"
+#. Android resource: @strings/auvergne
+msgid "Auvergne"
+msgstr "Auvergne"
-#~ msgid "Victoria"
-#~ msgstr "Victoria"
+#. Android resource: @strings/centre
+msgid "Centre"
+msgstr "Centre"
-#~ msgid "Western Europe"
-#~ msgstr "West-Europa"
+#. Android resource: @strings/bretagne
+msgid "Bretagne"
+msgstr "Bretagne"
-#~ msgid "New South Wales"
-#~ msgstr "New South Wales"
+#. Android resource: @strings/bourgogne
+msgid "Bourgogne"
+msgstr "Burgund"
-#~ msgid "Europe"
-#~ msgstr "Europa"
+#. Android resource: @strings/basse_normandie
+msgid "Basse-Normandie"
+msgstr "Basse-Normandie"
-#~ msgid "Aquitaine"
-#~ msgstr "Aquitanien"
+#. Android resource: @strings/champagne_ardenne
+msgid "Champagne-Ardenne"
+msgstr "Champagne-Ardenne"
-#~ msgid "Auvergne"
-#~ msgstr "Auvergne"
+#. Android resource: @strings/corse
+msgid "Corse"
+msgstr "Korsika"
-#~ msgid "Basse-Normandie"
-#~ msgstr "Basse-Normandie"
+#. Android resource: @strings/franche_comte
+msgid "Franche-Comte"
+msgstr "Freie Grafschaft"
-#~ msgid "Languedoc-Roussillon"
-#~ msgstr "Languedoc-Roussillon"
+#. Android resource: @strings/haute_normandie
+msgid "Haute-Normandie"
+msgstr "Haute Normandie"
-#~ msgid "Limousin"
-#~ msgstr "Limousin"
+#. Android resource: @strings/ile_de_france
+msgid "Ile-de-France"
+msgstr "Ile-de-France"
-#~ msgid "Haute-Normandie"
-#~ msgstr "Haute Normandie"
+#. Android resource: @strings/languedoc_roussillon
+msgid "Languedoc-Roussillon"
+msgstr "Languedoc-Roussillon"
-#~ msgid "Bretagne"
-#~ msgstr "Bretagne"
+#. Android resource: @strings/limousin
+msgid "Limousin"
+msgstr "Limousin"
-#~ msgid "Corse"
-#~ msgstr "Korsika"
+#. Android resource: @strings/lorraine
+msgid "Lorraine"
+msgstr "Lothringen"
-#~ msgid "Champagne-Ardenne"
-#~ msgstr "Champagne-Ardenne"
+#. Android resource: @strings/midi_pyrenees
+msgid "Midi-Pyrenees"
+msgstr "Midi-Pyrenäen"
-#~ msgid "Baden-Wuerttemberg"
-#~ msgstr "Baden-Württemberg"
+#. Android resource: @strings/nord_pas_de_calais
+msgid "Nord-pas-de-Calais"
+msgstr "Nord-pas-de-Calais"
-#~ msgid "Bayern"
-#~ msgstr "Bayern"
+#. Android resource: @strings/pays_de_la_loire
+msgid "Pays-de-la-Loire"
+msgstr "Pays-de-la-Loire"
-#~ msgid "Lorraine"
-#~ msgstr "Lothringen"
+#. Android resource: @strings/picardie
+msgid "Picardie"
+msgstr "Picardie"
-#~ msgid "Poitou-Charentes"
-#~ msgstr "Poitou-Charentes"
+#. Android resource: @strings/poitou_charentes
+msgid "Poitou-Charentes"
+msgstr "Poitou-Charentes"
-#~ msgid "Picardie"
-#~ msgstr "Picardie"
+#. Android resource: @strings/provence_alpes_cote_d_azur
+msgid "Provence-Alpes-Cote-d-Azur"
+msgstr "Provence-Alpes-Cote-d-Azur"
-#~ msgid "Mittelfranken"
-#~ msgstr "Mittelfranken"
+#. Android resource: @strings/rhone_alpes
+msgid "Rhone-Alpes"
+msgstr "Rhone-Alpen"
-#~ msgid "Oberpfalz"
-#~ msgstr "Oberpfalz"
+#. Android resource: @strings/baden_wuerttemberg
+msgid "Baden-Wuerttemberg"
+msgstr "Baden-Württemberg"
-#~ msgid "Oberfranken"
-#~ msgstr "Oberfranken"
+#. Android resource: @strings/bayern
+msgid "Bayern"
+msgstr "Bayern"
-#~ msgid "Oberbayern"
-#~ msgstr "Oberbayern"
+#. Android resource: @strings/mittelfranken
+msgid "Mittelfranken"
+msgstr "Mittelfranken"
-#~ msgid "Unterfranken"
-#~ msgstr "Unterfranken"
+#. Android resource: @strings/niederbayern
+msgid "Niederbayern"
+msgstr "Niederbayern"
-#~ msgid "Schwaben"
-#~ msgstr "Schwaben"
+#. Android resource: @strings/oberbayern
+msgid "Oberbayern"
+msgstr "Oberbayern"
-#~ msgid "Niederbayern"
-#~ msgstr "Niederbayern"
+#. Android resource: @strings/oberfranken
+msgid "Oberfranken"
+msgstr "Oberfranken"
-#~ msgid "Bremen"
-#~ msgstr "Bremen"
+#. Android resource: @strings/oberpfalz
+msgid "Oberpfalz"
+msgstr "Oberpfalz"
-#~ msgid "Berlin"
-#~ msgstr "Berlin"
+#. Android resource: @strings/schwaben
+msgid "Schwaben"
+msgstr "Schwaben"
-#~ msgid "Brandenburg"
-#~ msgstr "Brandenburg"
+#. Android resource: @strings/unterfranken
+msgid "Unterfranken"
+msgstr "Unterfranken"
-#~ msgid "Rheinland-Pfalz"
-#~ msgstr "Rheinland-Pfalz"
+#. Android resource: @strings/berlin
+msgid "Berlin"
+msgstr "Berlin"
-#~ msgid "Saarland"
-#~ msgstr "Saarland"
+#. Android resource: @strings/brandenburg
+msgid "Brandenburg"
+msgstr "Brandenburg"
-#~ msgid "Niedersachsen"
-#~ msgstr "Niedersachsen"
+#. Android resource: @strings/bremen
+msgid "Bremen"
+msgstr "Bremen"
-#~ msgid "Hessen"
-#~ msgstr "Hessen"
+#. Android resource: @strings/hamburg
+msgid "Hamburg"
+msgstr "Hamburg"
-#~ msgid "Mecklenburg-Vorpommern"
-#~ msgstr "Mecklenburg-Vorpommern"
+#. Android resource: @strings/hessen
+msgid "Hessen"
+msgstr "Hessen"
-#~ msgid "Hamburg"
-#~ msgstr "Hamburg"
+#. Android resource: @strings/mecklenburg_vorpommern
+msgid "Mecklenburg-Vorpommern"
+msgstr "Mecklenburg-Vorpommern"
-#~ msgid "Sachsen"
-#~ msgstr "Sachsen"
+#. Android resource: @strings/niedersachsen
+msgid "Niedersachsen"
+msgstr "Niedersachsen"
-#~ msgid "Sachsen-Anhalt"
-#~ msgstr "Sachsen-Anhalt"
+#. Android resource: @strings/nordrhein_westfalen
+msgid "Nordrhein-westfalen"
+msgstr "Nordrhein-Westfalen"
-#~ msgid "Schleswig-Holstein"
-#~ msgstr "Schleswig-Holstein"
+#. Android resource: @strings/rheinland_pfalz
+msgid "Rheinland-Pfalz"
+msgstr "Rheinland-Pfalz"
-#~ msgid "Galicia"
-#~ msgstr "Galicien"
+#. Android resource: @strings/saarland
+msgid "Saarland"
+msgstr "Saarland"
-#~ msgid "Essex"
-#~ msgstr "Essex"
+#. Android resource: @strings/sachsen_anhalt
+msgid "Sachsen-Anhalt"
+msgstr "Sachsen-Anhalt"
-#~ msgid "Cumbria"
-#~ msgstr "Cumbria"
+#. Android resource: @strings/sachsen
+msgid "Sachsen"
+msgstr "Sachsen"
-#~ msgid "Thueringen"
-#~ msgstr "Thüringen"
+#. Android resource: @strings/schleswig_holstein
+msgid "Schleswig-Holstein"
+msgstr "Schleswig-Holstein"
-#~ msgid "Mallorca"
-#~ msgstr "Mallorca"
+#. Android resource: @strings/thueringen
+msgid "Thueringen"
+msgstr "Thüringen"
-#~ msgid "England"
-#~ msgstr "England"
+#. Android resource: @strings/mallorca
+msgid "Mallorca"
+msgstr "Mallorca"
-#~ msgid "Scandinavia"
-#~ msgstr "Skandinavien"
+#. Android resource: @strings/galicia
+msgid "Galicia"
+msgstr "Galicien"
-#~ msgid "Cambridgeshire"
-#~ msgstr "Cambridgeshire"
+#. Android resource: @strings/scandinavia
+msgid "Scandinavia"
+msgstr "Skandinavien"
-#~ msgid "Buckinghamshire"
-#~ msgstr "Buckinghamshire"
+#. Android resource: @strings/england
+msgid "England"
+msgstr "England"
-#~ msgid "Oxfordshire"
-#~ msgstr "Oxfordshire"
+#. Android resource: @strings/buckinghamshire
+msgid "Buckinghamshire"
+msgstr "Buckinghamshire"
-#~ msgid "Nottinghamshire"
-#~ msgstr "Nottinghamshire"
+#. Android resource: @strings/cambridgeshire
+msgid "Cambridgeshire"
+msgstr "Cambridgeshire"
-#~ msgid "Lancashire"
-#~ msgstr "Lancashire"
+#. Android resource: @strings/cumbria
+msgid "Cumbria"
+msgstr "Cumbria"
-#~ msgid "Kent"
-#~ msgstr "Kent"
+#. Android resource: @strings/east_yorkshire_with_hull
+msgid "East yorkshire with hull"
+msgstr "East Yorkshire und Hull"
-#~ msgid "Norfolk"
-#~ msgstr "Norfolk"
+#. Android resource: @strings/essex
+msgid "Essex"
+msgstr "Essex"
-#~ msgid "Leicestershire"
-#~ msgstr "Leicestershire"
+#. Android resource: @strings/herefordshire
+msgid "Herefordshire"
+msgstr "Herefordshire"
-#~ msgid "Herefordshire"
-#~ msgstr "Herefordshire"
+#. Android resource: @strings/kent
+msgid "Kent"
+msgstr "Kent"
-#~ msgid "South yorkshire"
-#~ msgstr "South yorkshire"
+#. Android resource: @strings/lancashire
+msgid "Lancashire"
+msgstr "Lancashire"
-#~ msgid "Shropshire"
-#~ msgstr "Shropshire"
+#. Android resource: @strings/leicestershire
+msgid "Leicestershire"
+msgstr "Leicestershire"
-#~ msgid "Somerset"
-#~ msgstr "Somerset"
+#. Android resource: @strings/norfolk
+msgid "Norfolk"
+msgstr "Norfolk"
-#~ msgid "Alaska"
-#~ msgstr "Alaska"
+#. Android resource: @strings/nottinghamshire
+msgid "Nottinghamshire"
+msgstr "Nottinghamshire"
-#~ msgid "North America"
-#~ msgstr "Nordamerika"
+#. Android resource: @strings/oxfordshire
+msgid "Oxfordshire"
+msgstr "Oxfordshire"
-#~ msgid "USA"
-#~ msgstr "USA"
+#. Android resource: @strings/shropshire
+msgid "Shropshire"
+msgstr "Shropshire"
-#~ msgid "Hawaii"
-#~ msgstr "Hawaii"
+#. Android resource: @strings/somerset
+msgid "Somerset"
+msgstr "Somerset"
-#~ msgid "Crete"
-#~ msgstr "Kreta"
+#. Android resource: @strings/south_yorkshire
+msgid "South yorkshire"
+msgstr "South yorkshire"
-#~ msgid "Suffolk"
-#~ msgstr "Suffolk"
+#. Android resource: @strings/suffolk
+msgid "Suffolk"
+msgstr "Suffolk"
-#~ msgid "Scotland"
-#~ msgstr "Schottland"
+#. Android resource: @strings/surrey
+msgid "Surrey"
+msgstr "Surrey"
-#~ msgid "Wales"
-#~ msgstr "Wales"
+#. Android resource: @strings/wiltshire
+msgid "Wiltshire"
+msgstr "Wiltshire"
-#~ msgid "Surrey"
-#~ msgstr "Surrey"
+#. Android resource: @strings/scotland
+msgid "Scotland"
+msgstr "Schottland"
-#~ msgid "Wiltshire"
-#~ msgstr "Wiltshire"
+#. Android resource: @strings/wales
+msgid "Wales"
+msgstr "Wales"
-#~ msgid "Pacific"
-#~ msgstr "Pazifik"
+#. Android resource: @strings/crete
+msgid "Crete"
+msgstr "Kreta"
-#~ msgid "South"
-#~ msgstr "Süd"
+#. Android resource: @strings/north_america
+msgid "North America"
+msgstr "Nordamerika"
-#~ msgid "Arkansas"
-#~ msgstr "Arkansas"
+#. Android resource: @strings/alaska
+msgid "Alaska"
+msgstr "Alaska"
-#~ msgid " (except Alaska and Hawaii)"
-#~ msgstr " (außer Alaska und Hawaii)"
+#. Android resource: @strings/hawaii
+msgid "Hawaii"
+msgstr "Hawaii"
-#~ msgid "Northeast"
-#~ msgstr "Nordosten"
+#. Android resource: @strings/usa
+msgid "USA"
+msgstr "USA"
-#~ msgid "Ohio"
-#~ msgstr "Ohio"
+#. Android resource: @strings/except_alaska_and_hawaii
+msgid "(except Alaska and Hawaii)"
+msgstr "außer Alaska und Hawaii"
-#~ msgid "Michigan"
-#~ msgstr "Michigan"
+#. Android resource: @strings/midwest
+msgid "Midwest"
+msgstr "Mittlerer Westen"
-#~ msgid "Midwest"
-#~ msgstr "Mittlerer Westen"
+#. Android resource: @strings/michigan
+msgid "Michigan"
+msgstr "Michigan"
-#~ msgid "Vermont"
-#~ msgstr "Vermont"
+#. Android resource: @strings/ohio
+msgid "Ohio"
+msgstr "Ohio"
-#~ msgid "Massachusetts"
-#~ msgstr "Massachusetts"
+#. Android resource: @strings/northeast
+msgid "Northeast"
+msgstr "Nordosten"
-#~ msgid "District of Columbia"
-#~ msgstr "District of Columbia"
+#. Android resource: @strings/massachusetts
+msgid "Massachusetts"
+msgstr "Massachusetts"
-#~ msgid "Florida"
-#~ msgstr "Florida"
+#. Android resource: @strings/vermont
+msgid "Vermont"
+msgstr "Vermont"
-#~ msgid "Louisiana"
-#~ msgstr "Louisiana"
+#. Android resource: @strings/pacific
+msgid "Pacific"
+msgstr "Pazifik"
-#~ msgid "Maryland"
-#~ msgstr "Maryland"
+#. Android resource: @strings/south
+msgid "South"
+msgstr "Süd"
-#~ msgid "Oklahoma"
-#~ msgstr "Oklahoma"
+#. Android resource: @strings/arkansas
+msgid "Arkansas"
+msgstr "Arkansas"
-#~ msgid "Texas"
-#~ msgstr "Texas"
+#. Android resource: @strings/district_of_columbia
+msgid "District of Columbia"
+msgstr "District of Columbia"
-#~ msgid "Mississippi"
-#~ msgstr "Mississippi"
+#. Android resource: @strings/florida
+msgid "Florida"
+msgstr "Florida"
-#~ msgid "West Virginia"
-#~ msgstr "West Virginia"
+#. Android resource: @strings/louisiana
+msgid "Louisiana"
+msgstr "Louisiana"
-#~ msgid "Virginia"
-#~ msgstr "Virginia"
+#. Android resource: @strings/maryland
+msgid "Maryland"
+msgstr "Maryland"
-#~ msgid "West"
-#~ msgstr "West"
+#. Android resource: @strings/mississippi
+msgid "Mississippi"
+msgstr "Mississippi"
-#~ msgid "Washington State"
-#~ msgstr "Washington State"
+#. Android resource: @strings/oklahoma
+msgid "Oklahoma"
+msgstr "Oklahoma"
-#~ msgid "Oregon"
-#~ msgstr "Oregon"
+#. Android resource: @strings/texas
+msgid "Texas"
+msgstr "Texas"
-#~ msgid "New Mexico"
-#~ msgstr "New Mexico"
+#. Android resource: @strings/virginia
+msgid "Virginia"
+msgstr "Virginia"
-#~ msgid "Nevada"
-#~ msgstr "Nevada"
+#. Android resource: @strings/west_virginia
+msgid "West Virginia"
+msgstr "West Virginia"
-#~ msgid "Arizona"
-#~ msgstr "Arizona"
+#. Android resource: @strings/west
+msgid "West"
+msgstr "West"
-#~ msgid "Colorado"
-#~ msgstr "Colorado"
+#. Android resource: @strings/arizona
+msgid "Arizona"
+msgstr "Arizona"
-#~ msgid "California"
-#~ msgstr "Kalifornien"
+#. Android resource: @strings/california
+msgid "California"
+msgstr "Kalifornien"
-#~ msgid "Montana"
-#~ msgstr "Montana"
+#. Android resource: @strings/colorado
+msgid "Colorado"
+msgstr "Colorado"
-#~ msgid "Idaho"
-#~ msgstr "Idaho"
+#. Android resource: @strings/idaho
+msgid "Idaho"
+msgstr "Idaho"
-#~ msgid "Utah"
-#~ msgstr "Utah"
+#. Android resource: @strings/montana
+msgid "Montana"
+msgstr "Montana"
-#~ msgid "Africa"
-#~ msgstr "Afrika"
+#. Android resource: @strings/new_mexico
+msgid "New Mexico"
+msgstr "New Mexico"
-#~ msgid "UAE+Other"
-#~ msgstr "Vereinigte Arabische Emirate+weitere"
+#. Android resource: @strings/nevada
+msgid "Nevada"
+msgstr "Nevada"
-#~ msgid "Azores"
-#~ msgstr "Azoren"
+#. Android resource: @strings/oregon
+msgid "Oregon"
+msgstr "Oregon"
-#~ msgid "Bourgogne"
-#~ msgstr "Burgund"
+#. Android resource: @strings/utah
+msgid "Utah"
+msgstr "Utah"
-#~ msgid "South+Middle America"
-#~ msgstr "Süd+Mittel-Amerika"
+#. Android resource: @strings/washington_state
+msgid "Washington State"
+msgstr "Washington State"
-#~ msgid "Error writing map!"
-#~ msgstr "Fehler beim speichern der Karte!"
+#. Android resource: @strings/south_middle_america
+msgid "South+Middle America"
+msgstr "Süd+Mittel-Amerika"
-#~ msgid "downloading"
-#~ msgstr "wird heruntergeladen"
+#. Android resource: @strings/guyane_francaise
+msgid "Guyane Francaise"
+msgstr "Französisch-Guayana"
-#~ msgid "Nordrhein-westfalen"
-#~ msgstr "Nordrhein-Westfalen"
+#, c-format
+#~ msgid "Route %4.0fkm %02d:%02d ETA"
+#~ msgstr "Route %4.0fkm %02d:%02d ETA"
-#~ msgid "Map download aborted!"
-#~ msgstr "Kartendownload abgebrochen!"
+#~ msgid "No config file navit.xml, navit.xml.local found\n"
+#~ msgstr "Keine Konfigurations-Datei navit.xml oder navit.xml.local gefunden\n"
-#~ msgid "Centre"
-#~ msgstr "Centre"
+#, c-format
+#~ msgid "Error parsing config file '%s': %s\n"
+#~ msgstr "Fehler beim Parsen der Konfigurations-Datei '%s': %s\n"
-#~ msgid "Ile-de-France"
-#~ msgstr "Ile-de-France"
+#, c-format
+#~ msgid "Using config file '%s'\n"
+#~ msgstr "Benutze Konfigurations-Datei '%s'\n"
-#~ msgid "Nord-pas-de-Calais"
-#~ msgstr "Nord-pas-de-Calais"
+#~ msgid ""
+#~ "Internal initialization failed, exiting. Check previous error messages.\n"
+#~ msgstr ""
+#~ "Interne Initialisierung fehlgeschlagen, Programm wird beendet. Frühere "
+#~ "Fehler beachten.\n"
-#~ msgid "Pays-de-la-Loire"
-#~ msgstr "Pays-de-la-Loire"
+#~ msgid "partial match"
+#~ msgstr "ungefähr"
-#~ msgid "Midi-Pyrenees"
-#~ msgstr "Midi-Pyrenäen"
+#~ msgid "Downloaded maps"
+#~ msgstr "Heruntergeladene Karten"
-#~ msgid "Guyane Francaise"
-#~ msgstr "Französisch-Guayana"
+#~ msgid "Error downloading map!"
+#~ msgstr "Fehler beim Kartendownload"
-#~ msgid "Franche-Comte"
-#~ msgstr "Freie Grafschaft"
+#~ msgid ""
+#~ "Drop last \n"
+#~ "Waypoint"
+#~ msgstr ""
+#~ "Letzten Wegpunkt\n"
+#~ "entfernen"
-#~ msgid "Cancel"
-#~ msgstr "Abbrechen"
+#~ msgid ""
+#~ "Drop next \n"
+#~ "Waypoint"
+#~ msgstr ""
+#~ "Nächsten Wegpunkt\n"
+#~ "entfernen"
-#~ msgid "Rhone-Alpes"
-#~ msgstr "Rhone-Alpen"
+#~ msgid "Map data (c) OpenStreetMap contributors, ODBL"
+#~ msgstr "Kartendaten (c) von OpenStreetMap unter ODbL"
+
+#~ msgid " (except Alaska and Hawaii)"
+#~ msgstr " (außer Alaska und Hawaii)"
+
+#~ msgid "Map download aborted!"
+#~ msgstr "Kartendownload abgebrochen!"
#, c-format
#~ msgid "Error: No configuration found in config file '%s'\n"
#~ msgstr "Fehler: Keine Konfiguration in der Datei '%s' gefunden\n"
-#~ msgid "Provence-Alpes-Cote-d-Azur"
-#~ msgstr "Provence-Alpes-Cote-d-Azur"
-
-#~ msgid "Media selected for map storage is not available"
-#~ msgstr ""
-#~ "Der eingestellte Speicherort für das Kartenmaterial ist nicht verfügbar."
+#~ msgid "Select a distance to look for (km)"
+#~ msgstr "Wählen Sie eine Suchdistanz (km)"
-#~ msgid ""
-#~ "Sorry, we currently do not support maps above 3.8G on Android, please select "
-#~ "a smaller one."
-#~ msgstr ""
-#~ "Entschuldigung. Derzeit untestützen wir auf Android keine Karten die größer "
-#~ "als 3,8Gigabyte sind. Bitte wählen Sie eine kleinere Karte aus."
+#~ msgid "Distance(m)"
+#~ msgstr "Entfernung (m)"
#, c-format
#~ msgid "Set destination to %ld, %ld \n"
@@ -2888,8 +3171,8 @@ msgstr "Eine oder mehrere nicht gewährte Berechtigungen"
#~ msgid "then leave the roundabout at the %1$s %2$s"
#~ msgstr "anschließend verlassen Sie den Kreisverkehr an der %1$s %2$s"
-#~ msgid "East yorkshire with hull"
-#~ msgstr "East Yorkshire und Hull"
+#~ msgid "filenamePath"
+#~ msgstr "Dateipfad"
#, c-format
#~ msgid "in %d m"
diff --git a/po/en_GB.po.in b/po/en_GB.po.in
index e8cc6e9bf..5726075d6 100644
--- a/po/en_GB.po.in
+++ b/po/en_GB.po.in
@@ -1,14 +1,16 @@
# English (United Kingdom) translations for navit
-# Copyright (C) 2006-2018 The Navit Team
+# Copyright (C) 2006-2019 The Navit Team
# This file is distributed under the same license as the navit package.
# Many thanks to the contributors of this translation:
# Andi Chandler https://launchpad.net/~bing
+# Henk https://launchpad.net/~haboomsma
# Jeff Bailes https://launchpad.net/~thepizzaking
# Kaustav Das Modak https://launchpad.net/~kaustav-dasmodak
# Matthew Gall https://launchpad.net/~matthewgall
# Roadrunner IN https://launchpad.net/~online
# Stephen Irons https://launchpad.net/~stephen-irons
# half_monkey https://launchpad.net/~d-r-williams-01
+# ilovekiruna https://launchpad.net/~ilovekiruna
# jan https://launchpad.net/~jandegr1
# lopho https://launchpad.net/~lopho
@@ -16,8 +18,8 @@ msgid ""
msgstr ""
"Project-Id-Version: navit 0.5.1\n"
"Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2018-06-19 22:44+0000\n"
-"Last-Translator: Andi Chandler <Unknown>\n"
+"PO-Revision-Date: 2019-10-02 22:49+0000\n"
+"Last-Translator: Matthew Gall <me@matthewgall.info>\n"
"Language-Team: English (United Kingdom) <en_GB@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -1505,6 +1507,10 @@ msgstr "Wallis and Futuna"
msgid "Samoa"
msgstr "Samoa"
+#. 412
+msgid "Kosovo"
+msgstr "Kosovo"
+
#. 887
msgid "Yemen"
msgstr "Yemen"
@@ -1783,11 +1789,11 @@ msgstr "Shopping"
#. Input is in kilometers
msgid "Select a search radius from screen center in km"
-msgstr ""
+msgstr "Select a search radius from screen center in km"
#. Input is in miles.
msgid "Select a search radius from screen center in miles"
-msgstr ""
+msgstr "Select a search radius from screen center in miles"
#, c-format
msgid "POI %s. %s"
@@ -1824,7 +1830,7 @@ msgid "Direction"
msgstr "Direction"
msgid "Distance"
-msgstr ""
+msgstr "Distance"
msgid "Name"
msgstr "Name"
@@ -2246,6 +2252,10 @@ msgstr "Yes"
msgid "Cancel"
msgstr "Cancel"
+#. Android resource: @strings/channel_name
+msgid "Navit"
+msgstr "Navit"
+
#. Android resource: @strings/notification_ticker
msgid "Navit started"
msgstr "Navit started"
@@ -2318,6 +2328,10 @@ msgstr "Set map location"
msgid "Route to here"
msgstr "Route to here"
+#. Android resource: @strings/position_popup_view
+msgid "View"
+msgstr "View"
+
#. Android resource: @strings/map_delete
msgid "Delete this map?"
msgstr "Delete this map?"
diff --git a/scripts/ci_sanity_checks.sh b/scripts/ci_sanity_checks.sh
index e8cac4787..33d05263c 100755
--- a/scripts/ci_sanity_checks.sh
+++ b/scripts/ci_sanity_checks.sh
@@ -52,7 +52,7 @@ for f in $(git diff --name-only ${interval} | sort -u); do
check_diff
fi
- if [[ "${f}" == "navit/navit_shipped.xml" ]]; then
+ if [[ "${f: -11}" == "shipped.xml" ]]; then
echo "[INFO] Checking for compliance with the DTD using xmllint on ${f}..."
xmllint --noout --dtdvalid navit/navit.dtd "$f"
rc=$?
diff --git a/scripts/setup_sanitycheck_requirements.sh b/scripts/setup_sanitycheck_requirements.sh
new file mode 100644
index 000000000..263669a7c
--- /dev/null
+++ b/scripts/setup_sanitycheck_requirements.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+set -e
+
+apt-get update && apt-get install -y git astyle libxml2-utils file