summaryrefslogtreecommitdiff
path: root/navit
diff options
context:
space:
mode:
authormvglasow <michael -at- vonglasow.com>2017-12-07 19:43:31 +0100
committermvglasow <michael -at- vonglasow.com>2017-12-07 19:43:31 +0100
commit516d9145d3f350c52dc31ea331985277c9052334 (patch)
tree8cdfa7835012443cd0d2f80886625e77324def3e /navit
parentb7f4b29248fe58cfe5cb78593d04e990a3a8b489 (diff)
parent2965884a4227f0437d384a86facc6d2a9dcc4c74 (diff)
downloadnavit-516d9145d3f350c52dc31ea331985277c9052334.tar.gz
Merge branch 'trunk' into traffic
Diffstat (limited to 'navit')
-rw-r--r--navit/CMakeLists.txt97
-rw-r--r--navit/gui/gtk/gui_gtk_statusbar.c2
-rw-r--r--navit/icons/crossing.svg145
-rw-r--r--navit/icons/drinking_water.svg81
-rw-r--r--navit/icons/goverment_building.svg148
-rw-r--r--navit/navigation.c16
-rw-r--r--navit/navigation.h12
-rw-r--r--navit/navit.c12
-rw-r--r--navit/route.c34
-rw-r--r--navit/transform.c31
10 files changed, 372 insertions, 206 deletions
diff --git a/navit/CMakeLists.txt b/navit/CMakeLists.txt
index 321dc113b..416a84fc1 100644
--- a/navit/CMakeLists.txt
+++ b/navit/CMakeLists.txt
@@ -4,7 +4,7 @@ include_directories( "${CMAKE_CURRENT_SOURCE_DIR}")
include_directories( "${CMAKE_CURRENT_BINARY_DIR}")
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/support")
-# navit cre
+# navit core
set(NAVIT_SRC announcement.c atom.c attr.c cache.c callback.c command.c config_.c coord.c country.c data_window.c debug.c
event.c file.c geom.c graphics.c gui.c item.c layout.c log.c main.c map.c maps.c
linguistics.c mapset.c maptype.c menu.c messages.c bookmarks.c navit.c navit_nls.c navigation.c osd.c param.c phrase.c plugin.c popup.c
@@ -12,7 +12,7 @@ set(NAVIT_SRC announcement.c atom.c attr.c cache.c callback.c command.c config_.
search_houseno_interpol.c traffic.c util.c vehicle.c vehicleprofile.c xmlconfig.c )
if(NOT USE_PLUGINS)
- list(APPEND NAVIT_SRC ${CMAKE_CURRENT_BINARY_DIR}/builtin.c)
+ list(APPEND NAVIT_SRC ${CMAKE_CURRENT_BINARY_DIR}/builtin.c)
endif(NOT USE_PLUGINS)
if (${HAVE_GLIB})
@@ -82,7 +82,7 @@ if(NOT ANDROID)
add_executable(navit ${NAVIT_START_SRC})
target_link_libraries (navit ${NAVIT_LIBNAME})
if(DEFINED NAVIT_BINARY)
- set_target_properties(navit PROPERTIES OUTPUT_NAME ${NAVIT_BINARY})
+ set_target_properties(navit PROPERTIES OUTPUT_NAME ${NAVIT_BINARY})
endif(DEFINED NAVIT_BINARY)
if (BUILD_BUNDLE)
add_custom_command(OUTPUT resources/share COMMAND mkdir -p resources/share)
@@ -96,12 +96,12 @@ if(NOT ANDROID)
endif()
if (SHARED_LIBNAVIT)
- add_library (${NAVIT_LIBNAME} SHARED ${NAVIT_SRC} )
+ add_library (${NAVIT_LIBNAME} SHARED ${NAVIT_SRC} )
else(SHARED_LIBNAVIT)
- add_library (${NAVIT_LIBNAME} STATIC ${NAVIT_SRC} )
+ add_library (${NAVIT_LIBNAME} STATIC ${NAVIT_SRC} )
endif(SHARED_LIBNAVIT)
if(NOT MSVC)
- SET(NAVIT_LIBS ${NAVIT_LIBS} m)
+ SET(NAVIT_LIBS ${NAVIT_LIBS} m)
endif(NOT MSVC)
target_link_libraries(${NAVIT_LIBNAME} ${MODULES_NAME} ${NAVIT_SUPPORT_LIBS} fib ${NAVIT_LIBS} )
set_target_properties(${NAVIT_LIBNAME} PROPERTIES COMPILE_DEFINITIONS "MODULE=navit;LIBDIR=\"${CMAKE_INSTALL_PREFIX}/${LIB_DIR}\";PREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
@@ -113,50 +113,59 @@ ADD_CUSTOM_TARGET(
git_version
${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/version.h.in
-D DST=${CMAKE_CURRENT_BINARY_DIR}/version.h
- -D NAME="GIT_VERSION"
+ -D NAME="GIT_VERSION"
-P ${PROJECT_SOURCE_DIR}/cmake/version.cmake
)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/navit.dtd"
+ COMMENT "Copy navit.dtd to ${CMAKE_CURRENT_BINARY_DIR}/navit.dtd"
+ COMMAND ${CMAKE_COMMAND} -E copy "${PROJECT_SOURCE_DIR}/navit/navit.dtd" "${CMAKE_CURRENT_BINARY_DIR}/navit.dtd"
+)
+
# additional parameter are passed to the stylesheet processor as parameter
macro(process_xslt SRC_XML DEST_XML)
- set(XSLT_COMMANDS COMMAND ${CMAKE_COMMAND} -E copy ${SRC_XML} ${DEST_XML}
- COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/navit/navit.dtd ${CMAKE_CURRENT_BINARY_DIR}/navit.dtd)
- if(XSL_PROCESSING AND XSLTS)
- string(REPLACE "," ";" XSLTS "${XSLTS}")
- foreach(tmp ${XSLTS})
- set(XSLT_FILE "${PROJECT_SOURCE_DIR}/navit/xslt/${tmp}.xslt")
- list(APPEND XSLT_FILES "${XSLT_FILE}")
- list(APPEND XSLT_COMMANDS COMMAND ${CMAKE_COMMAND} -E echo Applying ${tmp}.xslt)
- compose_xslt_transform_command(CMD "${XSLT_FILE}" "${DEST_XML}" "${DEST_XML}.tmp" "${ARGN}")
- list(APPEND XSLT_COMMANDS ${CMD})
- list(APPEND XSLT_COMMANDS COMMAND ${CMAKE_COMMAND} -E rename ${DEST_XML}.tmp ${DEST_XML})
- endforeach()
- endif()
+ set(XSLT_COMMANDS COMMAND ${CMAKE_COMMAND} -E copy "${PROJECT_SOURCE_DIR}/navit/navit_shipped.xml" "${CMAKE_CURRENT_BINARY_DIR}/${DEST_XML}" )
+ if(XSL_PROCESSING)
+ if(NOT XSLTS STREQUAL "")
+ string(REPLACE "," ";" XSLTS "${XSLTS}")
+ foreach(tmp ${XSLTS})
+ set(XSLT_FILE "${PROJECT_SOURCE_DIR}/navit/xslt/${tmp}.xslt")
+ list(APPEND XSLT_FILES "${XSLT_FILE}")
+ list(APPEND XSLT_COMMANDS COMMAND ${CMAKE_COMMAND} -E echo Applying ${tmp}.xslt)
+ compose_xslt_transform_command(CMD "${XSLT_FILE}" "${CMAKE_CURRENT_BINARY_DIR}/${DEST_XML}" "${CMAKE_CURRENT_BINARY_DIR}/${DEST_XML}.tmp" "${ARGN}")
+ list(APPEND XSLT_COMMANDS ${CMD})
+ list(APPEND XSLT_COMMANDS COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/${DEST_XML}.tmp" ${CMAKE_CURRENT_BINARY_DIR}/${DEST_XML})
+ endforeach()
+ endif()
+ endif(XSL_PROCESSING)
# Depend on all XSLT files, because the main XSLT file may pull in other files.
# Ideally we'd parse the main XSLT file for includes, but that is tricky to do reliably.
# Note that this list of files is only updated when (re)running CMake, so if files are
# added/deleted, CMake must be re-run manually.
file(GLOB ALL_XSLT_FILES "${PROJECT_SOURCE_DIR}/navit/xslt/*.xslt")
+ #message(FATAL_ERROR ${CMAKE_CURRENT_BINARY_DIR}/${DEST_XML})
ADD_CUSTOM_COMMAND(
- OUTPUT ${DEST_XML}
- DEPENDS ${SRC_XML} ${ALL_XSLT_FILES}
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${DEST_XML}
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/navit/xslt/
+ DEPENDS ${SRC_XML} "${CMAKE_CURRENT_BINARY_DIR}/navit.dtd" ${ALL_XSLT_FILES}
${XSLT_COMMANDS}
)
endmacro()
if(ANDROID)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxxxhdpi.xml OSD_SIZE=5.33 ICON_SMALL=128 ICON_MEDIUM=192 ICON_BIG=256)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxxhdpi.xml OSD_SIZE=4 ICON_SMALL=96 ICON_MEDIUM=128 ICON_BIG=192)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitxhdpi.xml OSD_SIZE=2.67 ICON_SMALL=64 ICON_MEDIUM=96 ICON_BIG=128)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navithdpi.xml OSD_SIZE=2 ICON_SMALL=48 ICON_MEDIUM=64 ICON_BIG=96)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitmdpi.xml OSD_SIZE=1.33 ICON_SMALL=32 ICON_MEDIUM=48 ICON_BIG=64)
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navitldpi.xml OSD_SIZE=1 ICON_SMALL=24 ICON_MEDIUM=32 ICON_BIG=48)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml navitxxxhdpi.xml OSD_SIZE=5.33 ICON_SMALL=128 ICON_MEDIUM=192 ICON_BIG=256)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml navitxxhdpi.xml OSD_SIZE=4 ICON_SMALL=96 ICON_MEDIUM=128 ICON_BIG=192)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml navitxhdpi.xml OSD_SIZE=2.67 ICON_SMALL=64 ICON_MEDIUM=96 ICON_BIG=128)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml navithdpi.xml OSD_SIZE=2 ICON_SMALL=48 ICON_MEDIUM=64 ICON_BIG=96)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml navitmdpi.xml OSD_SIZE=1.33 ICON_SMALL=32 ICON_MEDIUM=48 ICON_BIG=64)
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml navitldpi.xml OSD_SIZE=1 ICON_SMALL=24 ICON_MEDIUM=32 ICON_BIG=48)
add_custom_target( navit_config_xml ALL DEPENDS navitxxxhdpi.xml navitxxhdpi.xml navitxhdpi.xml navithdpi.xml navitmdpi.xml navitldpi.xml)
else()
- process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml ${CMAKE_CURRENT_BINARY_DIR}/navit.xml "")
+ process_xslt(${CMAKE_CURRENT_SOURCE_DIR}/navit_shipped.xml navit.xml "")
add_custom_target( navit_config_xml_resource DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/navit.xml COMMAND mkdir -p resources/share/navit COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/navit.xml resources/share/navit)
add_custom_target( locale_resource DEPENDS locales COMMAND mkdir -p resources/share COMMAND cp -a ${CMAKE_CURRENT_BINARY_DIR}/../locale resources/share/locale)
- add_custom_target( navit_config_xml ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/navit.xml)
+ add_custom_target( navit_config_xml ALL DEPENDS navit.xml)
endif()
ADD_DEPENDENCIES(${NAVIT_LIBNAME} git_version)
@@ -182,17 +191,17 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/navit.xml
get_directory_property(INCLUDE_DIRECTORIES INCLUDE_DIRECTORIES)
WRITE_FILE("cmake_plugin_settings.txt"
- "set(APPLE ${APPLE} CACHE BOOL init)\n"
- "set(ANDROID ${ANDROID} CACHE BOOL init)\n"
- "set(USE_PLUGINS ${USE_PLUGINS} CACHE BOOL init)\n"
- "set(MODULE_BUILD_TYPE \"${MODULE_BUILD_TYPE}\" CACHE STRING init)\n"
- "set(NAVIT_COMPILE_FLAGS \"${NAVIT_COMPILE_FLAGS}\" CACHE STRING init)\n"
- "set(navit_SOURCE_DIR \"${navit_SOURCE_DIR}\" CACHE STRING init)\n"
- "set(NAVIT_LIBNAME \"${NAVIT_LIBNAME}\" CACHE STRING init)\n"
- "set(ANDROID_API_VERSION \"${ANDROID_API_VERSION}\" CACHE STRING init)\n"
- "set(ANDROID_NDK_API_VERSION \"${ANDROID_NDK_API_VERSION}\" CACHE STRING init)\n"
- "set(CMAKE_TOOLCHAIN_FILE \"${CMAKE_TOOLCHAIN_FILE}\" CACHE STRING init)\n"
- "set(INCLUDE_DIRECTORIES \"${INCLUDE_DIRECTORIES}\" CACHE STRING init)\n"
- "set(LIB_DIR \"${LIB_DIR}\" CACHE STRING init)\n"
- "set(CMAKE_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\" CACHE STRING init)\n"
- )
+ "set(APPLE ${APPLE} CACHE BOOL init)\n"
+ "set(ANDROID ${ANDROID} CACHE BOOL init)\n"
+ "set(USE_PLUGINS ${USE_PLUGINS} CACHE BOOL init)\n"
+ "set(MODULE_BUILD_TYPE \"${MODULE_BUILD_TYPE}\" CACHE STRING init)\n"
+ "set(NAVIT_COMPILE_FLAGS \"${NAVIT_COMPILE_FLAGS}\" CACHE STRING init)\n"
+ "set(navit_SOURCE_DIR \"${navit_SOURCE_DIR}\" CACHE STRING init)\n"
+ "set(NAVIT_LIBNAME \"${NAVIT_LIBNAME}\" CACHE STRING init)\n"
+ "set(ANDROID_API_VERSION \"${ANDROID_API_VERSION}\" CACHE STRING init)\n"
+ "set(ANDROID_NDK_API_VERSION \"${ANDROID_NDK_API_VERSION}\" CACHE STRING init)\n"
+ "set(CMAKE_TOOLCHAIN_FILE \"${CMAKE_TOOLCHAIN_FILE}\" CACHE STRING init)\n"
+ "set(INCLUDE_DIRECTORIES \"${INCLUDE_DIRECTORIES}\" CACHE STRING init)\n"
+ "set(LIB_DIR \"${LIB_DIR}\" CACHE STRING init)\n"
+ "set(CMAKE_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\" CACHE STRING init)\n"
+)
diff --git a/navit/gui/gtk/gui_gtk_statusbar.c b/navit/gui/gtk/gui_gtk_statusbar.c
index 5497f9a9c..6e5c9980d 100644
--- a/navit/gui/gtk/gui_gtk_statusbar.c
+++ b/navit/gui/gtk/gui_gtk_statusbar.c
@@ -87,7 +87,7 @@ statusbar_route_update(struct statusbar_priv *this, struct navit *navit, struct
struct map_rect *mr=NULL;
struct item *item=NULL;
struct attr attr;
- double route_len=0;
+ double route_len=0; /* Distance to destination. We get it in kilometers. */
time_t eta;
struct tm *eta_tm=NULL;
char buffer[128];
diff --git a/navit/icons/crossing.svg b/navit/icons/crossing.svg
index 51a5aeab6..d3c1ebc17 100644
--- a/navit/icons/crossing.svg
+++ b/navit/icons/crossing.svg
@@ -9,14 +9,17 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- height="22"
+ height="200"
id="svg2"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
sodipodi:docname="crossing.svg"
sodipodi:version="0.32"
version="1.0"
- width="22">
+ width="200"
+ inkscape:export-filename="C:\Users\jeremy\Pictures\svg\crossing.png"
+ inkscape:export-xdpi="96"
+ inkscape:export-ydpi="96">
<defs
id="defs22">
<inkscape:perspective
@@ -49,7 +52,7 @@
guidetolerance="10.0"
id="base"
inkscape:current-layer="svg2"
- inkscape:cx="12.599127"
+ inkscape:cx="7.9303017"
inkscape:cy="7.2481934"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
@@ -57,7 +60,7 @@
inkscape:window-width="1366"
inkscape:window-x="-8"
inkscape:window-y="-8"
- inkscape:zoom="17.933333"
+ inkscape:zoom="1"
objecttolerance="10.0"
pagecolor="#ffffff"
showgrid="false"
@@ -67,16 +70,16 @@
inkscape:lockguides="true" />
<g
id="g1327"
- transform="matrix(0.04083073,0,0,0.04083073,-0.1767767,-1.0602338)">
+ transform="matrix(0.34431731,0,0,0.34431731,-0.1767767,0.6565548)">
<path
- d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 l 0,450.123 c 0,40.844 20.894,62.229 62.192,62.229 l 452.024,0 c 41.307,0 62.229,-20.316 62.229,-62.229 l 0,-450.123 c 0,-42.601 -20.922,-65.036 -63.522,-65.036 -0.003,0 -448.494,-0.143 -448.352,0 z"
+ d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 v 450.123 c 0,40.844 20.894,62.229 62.192,62.229 H 515.92 c 41.307,0 62.229,-20.316 62.229,-62.229 V 66.804 c 0,-42.601 -20.922,-65.036 -63.522,-65.036 -0.003,0 -448.494,-0.143 -448.352,0 z"
id="path1329"
style="fill:#111111;fill-opacity:0;stroke:#eeeeee;stroke-width:3.40799999;stroke-opacity:0"
inkscape:connector-curvature="0" />
</g>
<g
id="g2319"
- transform="matrix(0.04083073,0,0,0.04083073,35.725326,0.442546)">
+ transform="matrix(0.04083073,0,0,0.04083073,35.725326,178.44255)">
<path
d=""
id="path2323"
@@ -85,107 +88,87 @@
</g>
<g
id="g2325"
- transform="matrix(0.04083073,0,0,0.04083073,35.725326,0.442546)">
+ transform="matrix(0.04083073,0,0,0.04083073,35.725326,178.44255)">
<path
d=""
id="path2329"
style="fill:#0089cd;stroke:none"
inkscape:connector-curvature="0" />
</g>
- <path
- style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:1.16406763px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 11.89298,0.29824419 C 6.7920335,0.36448969 3.0245422,3.9744881 3.0160085,9.208339 c -0.00777,4.764226 8.8769715,12.089905 8.8769715,12.089905 0,0 8.399996,-7.12183 8.41325,-12.089905 C 20.3186,4.5706582 16.993926,0.29824419 11.89298,0.29824419 Z"
- id="path1492"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cscsc" />
- <path
- style="fill:#0089cd;fill-opacity:1;stroke:#ffffff;stroke-width:0.30000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 11.875679,1.0590326 C 7.1553836,1.1203346 3.669036,4.4609421 3.6611391,9.3042242 3.6539491,13.712926 11.875679,20.491937 11.875679,20.491937 c 0,0 7.773159,-6.590374 7.785423,-11.1877128 0.01145,-4.2916004 -3.065128,-8.2451916 -7.785423,-8.2451916 z"
- id="path1492-2"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cscsc"
- inkscape:transform-center-x="-1.3165584"
- inkscape:transform-center-y="3.1070785" />
- <circle
- style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.25710332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="path1494"
- cx="11.661134"
- cy="8.7982445"
- r="7" />
<rect
- style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:0.47141925;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:6.964746;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1530-1"
- width="1.1041681"
- height="5.7941589"
- x="15.890425"
- y="5.9333854" />
+ width="16.312975"
+ height="85.602875"
+ x="165.07462"
+ y="59.240246" />
<rect
- style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:0.47141925;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:6.964746;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1530-1-1"
- width="1.1041681"
- height="5.7941589"
- x="13.416132"
- y="5.9333854" />
+ width="16.312975"
+ height="85.602875"
+ x="128.51941"
+ y="59.240246" />
<rect
- style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:0.47141925;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:6.964746;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1530-1-1-7"
- width="1.1041681"
- height="5.7941589"
- x="10.965008"
- y="-11.597079"
+ width="16.312975"
+ height="85.602875"
+ x="92.306519"
+ y="-142.91566"
transform="scale(1,-1)" />
<rect
- style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:0.47141925;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:6.964746;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1530-1-1-7-2"
- width="1.1041681"
- height="5.7941589"
- x="8.4675465"
- y="5.9333854" />
+ width="16.312975"
+ height="85.602875"
+ x="55.409027"
+ y="59.240246" />
<rect
- style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:0.47141925;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:6.964746;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1530-1-1-7-2-7"
- width="1.1041681"
- height="5.7941589"
- x="5.9932542"
- y="5.9333854" />
+ width="16.312975"
+ height="85.602875"
+ x="18.853848"
+ y="59.240246" />
<rect
- style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:0.18637794;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:2.75354671;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1530-1-1-7-6"
- width="1"
- height="1"
- x="11.017092"
- y="-4.9517441"
+ width="14.773995"
+ height="14.773995"
+ x="93.075996"
+ y="-44.737671"
transform="scale(1,-1)"
- inkscape:transform-center-x="-0.071419827"
- inkscape:transform-center-y="0.50357632" />
+ inkscape:transform-center-x="-1.0551502"
+ inkscape:transform-center-y="7.4398368" />
<rect
- style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:0.18637794;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:2.75354671;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1530-1-1-7-6-5"
- width="1"
- height="1"
- x="11.017092"
- y="-3.1005669"
+ width="14.773995"
+ height="14.773995"
+ x="93.075996"
+ y="-17.388329"
transform="scale(1,-1)"
- inkscape:transform-center-x="-0.071419827"
- inkscape:transform-center-y="0.50357632" />
+ inkscape:transform-center-x="-1.0551502"
+ inkscape:transform-center-y="7.4398331" />
<rect
- style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:0.18637794;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:2.75354671;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1530-1-1-7-6-5-6"
- width="1"
- height="1"
- x="11.017092"
- y="-13.448256"
+ width="14.773995"
+ height="14.773995"
+ x="93.075996"
+ y="-170.265"
transform="scale(1,-1)"
- inkscape:transform-center-x="-0.071419827"
- inkscape:transform-center-y="0.50357632" />
+ inkscape:transform-center-x="-1.0551502"
+ inkscape:transform-center-y="7.4398298" />
<rect
- style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:0.18637794;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:2.75354671;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect1530-1-1-7-6-5-6-0"
- width="1"
- height="1"
- x="11.017092"
- y="-15.299434"
+ width="14.773995"
+ height="14.773995"
+ x="93.075996"
+ y="-197.61433"
transform="scale(1,-1)"
- inkscape:transform-center-x="-0.071419827"
- inkscape:transform-center-y="0.50357632" />
+ inkscape:transform-center-x="-1.0551502"
+ inkscape:transform-center-y="7.4398249" />
</svg>
diff --git a/navit/icons/drinking_water.svg b/navit/icons/drinking_water.svg
index b7c676fa0..d4cf5a0c4 100644
--- a/navit/icons/drinking_water.svg
+++ b/navit/icons/drinking_water.svg
@@ -41,7 +41,7 @@
<cc:license
rdf:resource="http://web.resource.org/cc/PublicDomain" />
<dc:language>en</dc:language>
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -52,15 +52,15 @@
guidetolerance="10.0"
id="base"
inkscape:current-layer="svg2"
- inkscape:cx="11.370929"
- inkscape:cy="13.89007"
+ inkscape:cx="24.94017"
+ inkscape:cy="6.5543801"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:window-height="705"
inkscape:window-width="1366"
inkscape:window-x="-8"
inkscape:window-y="-8"
- inkscape:zoom="1"
+ inkscape:zoom="1.2239456"
objecttolerance="10.0"
pagecolor="#ffffff"
showgrid="false"
@@ -69,15 +69,6 @@
inkscape:measure-end="0,0"
inkscape:lockguides="true" />
<g
- id="g1327"
- transform="matrix(0.04083073,0,0,0.04083073,-0.1767767,176.93977)">
- <path
- d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 v 450.123 c 0,40.844 20.894,62.229 62.192,62.229 H 515.92 c 41.307,0 62.229,-20.316 62.229,-62.229 V 66.804 c 0,-42.601 -20.922,-65.036 -63.522,-65.036 -0.003,0 -448.494,-0.143 -448.352,0 z"
- id="path1329"
- style="fill:#111111;fill-opacity:0;stroke:#eeeeee;stroke-width:3.40799999;stroke-opacity:0"
- inkscape:connector-curvature="0" />
- </g>
- <g
id="g2319"
transform="matrix(0.04083073,0,0,0.04083073,35.725326,178.44255)">
<path
@@ -96,71 +87,51 @@
inkscape:connector-curvature="0" />
</g>
<path
- style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:10.5320406px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- d="M 103.33151,6.29824 C 57.180085,6.8971924 23.093259,39.55955 23.016049,86.91343 c -0.0703,43.10485 80.315461,109.38481 80.315461,109.38481 0,0 75.99996,-64.4356 76.11988,-109.38481 C 179.56331,44.953469 149.48292,6.29824 103.33151,6.29824 Z"
- id="path1492"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cscsc" />
- <path
- style="fill:#0089cd;fill-opacity:1;stroke:#ffffff;stroke-width:2.71428585;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 103.17497,13.181578 C 60.467538,13.736197 28.924393,43.960764 28.852945,87.780916 28.787893,127.66924 103.17497,189.00314 103.17497,189.00314 c 0,0 70.32858,-59.62724 70.43954,-101.222224 0.1036,-38.828762 -27.73211,-74.599338 -70.43954,-74.599338 z"
- id="path1492-2"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cscsc"
- inkscape:transform-center-x="-11.911717"
- inkscape:transform-center-y="28.11166" />
- <circle
- style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:11.37379169;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- id="path1494"
- cx="101.23385"
- cy="83.203079"
- r="63.333332" />
- <path
- style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:4.48494482;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="m 75.78481,42.116135 v 6.044172 h 6.613544 v 5.037714 H 56.097479 l -6.394551,-5.190076 v 24.527009 l 6.15366,-4.993019 h 22.096237 c 0,0 1.032332,5.948357 7.292416,5.628072 5.132345,-0.262381 5.649978,-5.628072 5.649978,-5.628072 0,0 4.88195,-0.08143 8.650166,0 1.512935,0.03619 1.881805,1.131857 1.861425,2.167991 -0.11572,5.880771 0,8.4531 0,8.4531 0,0 7.17054,-0.08143 11.56274,0 0.0416,-6.641405 0.12667,-11.843515 0,-17.672624 -0.10875,-5.017629 -7.93841,-7.188333 -12.89858,-7.292381 -4.960176,-0.104048 -12.964297,0 -12.964297,0 l 3.6e-5,-5.037714 h 7.445666 v -6.044172 z"
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:10.13824272;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 62.783034,3.5735704 V 17.236455 h 14.94995 v 11.38778 H 18.27971 L 3.8247918,16.892039 V 72.335481 L 17.735175,61.048734 h 49.948669 c 0,0 2.33359,13.446294 16.48455,12.722288 11.60169,-0.593114 12.7718,-12.722288 12.7718,-12.722288 0,0 11.035676,-0.184073 19.553746,0 3.42,0.08181 4.25383,2.558569 4.20776,4.900756 -0.26158,13.293515 0,19.108279 0,19.108279 0,0 16.20905,-0.184073 26.13764,0 0.094,-15.012933 0.28634,-26.772332 0,-39.949066 -0.24583,-11.342378 -17.94482,-16.249267 -29.15731,-16.484468 -11.21251,-0.235201 -29.305866,0 -29.305866,0 l 8e-5,-11.38778 H 105.20721 V 3.5735704 Z"
id="path1679"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccscccccccccccc" />
<path
- style="fill:none;stroke:#0089cd;stroke-width:1.80952382;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
- d="M 84.295582,83.191692 94.891661,127.47526 H 120.88204 L 131.07827,83.191692"
+ style="fill:none;stroke:#0089cd;stroke-width:4.09043884;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="M 82.021684,96.425097 105.97417,196.52835 h 58.7514 L 187.7742,96.425097"
id="path1681"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccc" />
<path
- style="fill:none;fill-opacity:1;stroke:#0089cd;stroke-width:2.09227252;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ style="fill:none;fill-opacity:1;stroke:#0089cd;stroke-width:4.72959375;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path830-6-0-0-4"
sodipodi:type="arc"
- sodipodi:cx="94.43795"
- sodipodi:cy="94.236076"
- sodipodi:rx="6.6486578"
- sodipodi:ry="5.2003613"
+ sodipodi:cx="104.94855"
+ sodipodi:cy="121.39098"
+ sodipodi:rx="15.029328"
+ sodipodi:ry="11.755445"
sodipodi:start="0"
sodipodi:end="3.1415927"
sodipodi:open="true"
- d="m 101.08661,94.236076 a 6.6486578,5.2003613 0 0 1 -3.324331,4.503645 6.6486578,5.2003613 0 0 1 -6.648658,0 6.6486578,5.2003613 0 0 1 -3.324329,-4.503645" />
+ d="m 119.97788,121.39098 a 15.029328,11.755445 0 0 1 -7.51467,10.18052 15.029328,11.755445 0 0 1 -15.029327,0 15.029328,11.755445 0 0 1 -7.514664,-10.18052" />
<path
- style="fill:none;fill-opacity:1;stroke:#0089cd;stroke-width:2.09227252;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ style="fill:none;fill-opacity:1;stroke:#0089cd;stroke-width:4.72959375;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path830-0-8-2-8-2"
sodipodi:type="arc"
- sodipodi:cx="107.89147"
- sodipodi:cy="94.236076"
- sodipodi:rx="6.6486578"
- sodipodi:ry="5.2003613"
+ sodipodi:cx="135.36032"
+ sodipodi:cy="121.39098"
+ sodipodi:rx="15.029328"
+ sodipodi:ry="11.755445"
sodipodi:start="0"
sodipodi:end="3.1415927"
sodipodi:open="true"
- d="m 114.54013,94.236076 a 6.6486578,5.2003613 0 0 1 -3.32433,4.503645 6.6486578,5.2003613 0 0 1 -6.64866,0 6.6486578,5.2003613 0 0 1 -3.32433,-4.503645" />
+ d="m 150.38965,121.39098 a 15.029328,11.755445 0 0 1 -7.51466,10.18052 15.029328,11.755445 0 0 1 -15.02933,0 15.029328,11.755445 0 0 1 -7.51467,-10.18052" />
<path
- style="fill:none;fill-opacity:1;stroke:#0089cd;stroke-width:2.09227252;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ style="fill:none;fill-opacity:1;stroke:#0089cd;stroke-width:4.72959375;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path830-0-3-4-9-1-1"
sodipodi:type="arc"
- sodipodi:cx="121.27702"
- sodipodi:cy="94.286331"
- sodipodi:rx="6.6486578"
- sodipodi:ry="5.2003613"
+ sodipodi:cx="165.61842"
+ sodipodi:cy="121.5046"
+ sodipodi:rx="15.029328"
+ sodipodi:ry="11.755445"
sodipodi:start="6.2639059"
sodipodi:end="3.1415927"
sodipodi:open="true"
- d="m 127.92445,94.186078 a 6.6486578,5.2003613 0 0 1 -3.24937,4.570107 6.6486578,5.2003613 0 0 1 -6.68531,0.05041 6.6486578,5.2003613 0 0 1 -3.3614,-4.520262" />
+ d="m 180.64496,121.27798 a 15.029328,11.755445 0 0 1 -7.34521,10.33075 15.029328,11.755445 0 0 1 -15.11219,0.11395 15.029328,11.755445 0 0 1 -7.59846,-10.21808" />
</svg>
diff --git a/navit/icons/goverment_building.svg b/navit/icons/goverment_building.svg
new file mode 100644
index 000000000..d01f4842b
--- /dev/null
+++ b/navit/icons/goverment_building.svg
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ height="200"
+ id="svg2"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"
+ inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"
+ sodipodi:docname="goverment_building.svg"
+ sodipodi:version="0.32"
+ version="1.0"
+ width="200">
+ <defs
+ id="defs22">
+ <inkscape:perspective
+ id="perspective24"
+ inkscape:persp3d-origin="290 : 193.33333 : 1"
+ inkscape:vp_x="0 : 290 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="580 : 290 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ </defs>
+ <metadata
+ id="metadata10">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <cc:license
+ rdf:resource="http://web.resource.org/cc/PublicDomain" />
+ <dc:language>en</dc:language>
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10.0"
+ guidetolerance="10.0"
+ id="base"
+ inkscape:current-layer="svg2"
+ inkscape:cx="63.25448"
+ inkscape:cy="98.118112"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:window-height="705"
+ inkscape:window-width="1366"
+ inkscape:window-x="-8"
+ inkscape:window-y="-8"
+ inkscape:zoom="2.1796875"
+ objecttolerance="10.0"
+ pagecolor="#ffffff"
+ showgrid="false"
+ inkscape:window-maximized="1"
+ inkscape:measure-start="0,0"
+ inkscape:measure-end="0,0"
+ inkscape:lockguides="true" />
+ <g
+ id="g1327"
+ transform="matrix(0.04083073,0,0,0.04083073,-0.1767767,176.93977)">
+ <path
+ d="M 66.275,1.768 C 24.94,1.768 1.704,23.139 1.704,66.804 v 450.123 c 0,40.844 20.894,62.229 62.192,62.229 H 515.92 c 41.307,0 62.229,-20.316 62.229,-62.229 V 66.804 c 0,-42.601 -20.922,-65.036 -63.522,-65.036 -0.003,0 -448.494,-0.143 -448.352,0 z"
+ id="path1329"
+ style="fill:#111111;fill-opacity:0;stroke:#eeeeee;stroke-width:3.40799999;stroke-opacity:0"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g2319"
+ transform="matrix(0.04083073,0,0,0.04083073,35.725326,178.44255)">
+ <path
+ d=""
+ id="path2323"
+ style="fill:#0089cd;stroke:none"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ id="g2325"
+ transform="matrix(0.04083073,0,0,0.04083073,35.725326,178.44255)">
+ <path
+ d=""
+ id="path2329"
+ style="fill:#0089cd;stroke:none"
+ inkscape:connector-curvature="0" />
+ </g>
+ <path
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:19.49269104px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M 9.1798926,59.466906 H 190.52231 L 99.851101,2.7306848 Z"
+ id="path925"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccc" />
+ <rect
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:9.1354475;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect927"
+ width="160.5358"
+ height="10.516355"
+ x="19.583216"
+ y="61.701366" />
+ <path
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:9.29089642;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ d="m 16.846267,171.67451 v 10.51391 H 8.0568816 v 15.54226 H 191.64467 v -15.54226 h -8.78936 v -10.51391 z"
+ id="rect927-7"
+ inkscape:connector-curvature="0" />
+ <rect
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:9.59141922;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect960"
+ width="18.032125"
+ height="93.275604"
+ x="27.863939"
+ y="74.209015" />
+ <rect
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:9.59141922;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect960-2"
+ width="18.032125"
+ height="93.275604"
+ x="154.58975"
+ y="74.209015" />
+ <rect
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:9.59141922;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect960-9"
+ width="18.032125"
+ height="93.275604"
+ x="122.90829"
+ y="74.209015" />
+ <rect
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:9.59141922;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect960-0"
+ width="18.032125"
+ height="93.275604"
+ x="59.545391"
+ y="74.209015" />
+ <rect
+ style="fill:#0089cd;fill-opacity:1;stroke:none;stroke-width:9.59141922;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect960-3"
+ width="18.032125"
+ height="93.275604"
+ x="91.22686"
+ y="74.209015" />
+</svg>
diff --git a/navit/navigation.c b/navit/navigation.c
index 0812093d1..cc1b47bc2 100644
--- a/navit/navigation.c
+++ b/navit/navigation.c
@@ -1014,11 +1014,11 @@ round_distance_reduced( int dist )
* 'imperial' if set distinguishes the distance statement between miles and feet. Maximum distance in feet is 500.
* 'vocabulary_distances' if set constrains the distance values to a set of simple pronounceable numbers.
*
-* @param nav The navigation object.
-* @param dist Distance in meters.
-* @param type The type of announcement precision.
-* @param is_length 1 for length statement, 0 for distance statement.
-* @return String with length/distance statement.
+* @param nav The navigation object.
+* @param dist_meters Distance in meters.
+* @param type The type of announcement precision.
+* @param is_length 1 for length statement, 0 for distance statement.
+* @return String with length/distance statement.
*/
static char *
get_distance_str(struct navigation *nav, int dist_meters, enum attr_type type, int is_length)
@@ -1058,7 +1058,7 @@ get_distance_str(struct navigation *nav, int dist_meters, enum attr_type type, i
return g_strdup_printf(_("in %d feet"), dist_feet);
}
- int dist_miles = (double) dist_meters / (double)METERS_PER_MILE + 0.5;
+ int dist_miles = (double) dist_meters * (double)METERS_TO_MILES + 0.5;
if (vocabulary == 0)
{
@@ -1066,10 +1066,10 @@ get_distance_str(struct navigation *nav, int dist_meters, enum attr_type type, i
dist_miles = round_distance_reduced(dist_miles);
}
- if ((dist_meters < METERS_PER_MILE) && (vocabulary > 0))
+ if ((dist_meters < METERS_TO_MILES) && (vocabulary > 0))
{
/* values smaller than one need extra treatment for one decimal place. For reduced vocabulary it shall remain 'one'. */
- int rem = (((double)dist_meters / (double)METERS_PER_MILE) + 0.05) * 10.0;
+ int rem = (((double)dist_meters * (double)METERS_TO_MILES) + 0.05) * 10.0;
dist_miles= 0;
if (is_length)
return g_strdup_printf(_("%d.%d miles"), dist_miles, rem);
diff --git a/navit/navigation.h b/navit/navigation.h
index 789d4fcbf..0651dbc79 100644
--- a/navit/navigation.h
+++ b/navit/navigation.h
@@ -23,8 +23,16 @@
#define FEET_PER_METER 3.2808399
#define FEET_PER_MILE 5280
#define KILOMETERS_TO_MILES 0.62137119 /* Kilometers to miles */
-#define METERS_PER_MILE 1/(KILOMETERS_TO_MILES/1000.00)
-#define MPS_TO_KPH 3.6 /* Meters per second to klicks/hr */
+
+/* It appears that distances to be displayed, such as distances to
+ * maneuvers, are in meters. Multiply that by METERS_PER_MILE and you
+ * have miles. */
+#define METERS_TO_MILES (KILOMETERS_TO_MILES/1000.0) /* Meters to miles */
+/* #define METERS_PER_MILE (1000.0/KILOMETERS_TO_MILES) */
+
+/* Meters per second to kilometers per hour. GPSD delivers speeds in
+ * meters per second. */
+#define MPS_TO_KPH 3.6
#ifdef __cplusplus
extern "C" {
diff --git a/navit/navit.c b/navit/navit.c
index 75975996b..c49c5f625 100644
--- a/navit/navit.c
+++ b/navit/navit.c
@@ -1975,14 +1975,15 @@ navit_window_roadbook_update(struct navit *this_)
param[0].value=_("Position");
param[0].name=_("Command");
+ /* Distance to the next maneuver. */
item_attr_get(item, attr_length, &attr);
- dbg(lvl_info, "Length=%ld\n", attr.u.num);
+ dbg(lvl_info, "Length=%ld in meters\n", attr.u.num);
param[1].name=_("Length");
if ( attr.u.num >= 2000 )
{
param[1].value=g_strdup_printf("%5.1f %s",
- imperial == TRUE ? (float)attr.u.num / (METERS_PER_MILE/1000.00) : (float)attr.u.num / 1000,
+ imperial == TRUE ? (float)attr.u.num * METERS_TO_MILES : (float)attr.u.num / 1000,
imperial == TRUE ? _("mi") : _("km")
);
}
@@ -1994,6 +1995,7 @@ navit_window_roadbook_update(struct navit *this_)
);
}
+ /* Time to next maneuver. */
item_attr_get(item, attr_time, &attr);
dbg(lvl_info, "Time=%ld\n", attr.u.num);
secs=attr.u.num/10;
@@ -2007,13 +2009,14 @@ navit_window_roadbook_update(struct navit *this_)
param[2].value=g_strdup_printf("%d:%02d",secs / 60, secs % 60);
}
+ /* Distance from next maneuver to destination. */
item_attr_get(item, attr_destination_length, &attr);
- dbg(lvl_info, "Destlength=%ld\n", attr.u.num);
+ dbg(lvl_info, "Destlength=%ld in meters.\n", attr.u.num);
param[3].name=_("Destination Length");
if ( attr.u.num >= 2000 )
{
param[3].value=g_strdup_printf("%5.1f %s",
- imperial == TRUE ? (float)attr.u.num / METERS_PER_MILE : (float)attr.u.num / 1000,
+ imperial == TRUE ? (float)attr.u.num * METERS_TO_MILES : (float)attr.u.num / 1000,
imperial == TRUE ? _("mi") : _("km")
);
}
@@ -2025,6 +2028,7 @@ navit_window_roadbook_update(struct navit *this_)
);
}
+ /* Time from next maneuver to destination. */
item_attr_get(item, attr_destination_time, &attr);
dbg(lvl_info, "Desttime=%ld\n", attr.u.num);
secs=attr.u.num/10;
diff --git a/navit/route.c b/navit/route.c
index 2251ffb7f..fcbbb4d13 100644
--- a/navit/route.c
+++ b/navit/route.c
@@ -137,13 +137,19 @@ struct size_weight_limit {
#define RSD_DANGEROUS_GOODS(x) *((int *)route_segment_data_field_pos((x), attr_vehicle_dangerous_goods))
+/**
+ * @brief Data for a segment in the route graph
+ */
struct route_graph_segment_data {
- struct item *item;
- int offset;
- int flags;
- int len;
- int maxspeed;
- struct size_weight_limit size_weight;
+ struct item *item; /**< The item which this segment is part of */
+ int offset; /**< If the item passed in "item" is segmented (i.e. divided
+ * into several segments), this indicates the position of
+ * this segment within the item */
+ int flags; /**< Flags for this segment */
+ int len; /**< The length of this segment */
+ int maxspeed; /**< The maximum speed allowed on this segment in km/h,
+ * -1 if not known */
+ struct size_weight_limit size_weight; /**< Size and weight limits for this segment */
int dangerous_goods;
};
@@ -250,8 +256,8 @@ struct route {
struct route_graph *graph; /**< Pointer to the route graph */
struct route_path *path2; /**< Pointer to the route path */
- struct map *map;
- struct map *graph_map;
+ struct map *map; /**< The map containing the route path */
+ struct map *graph_map; /**< The map containing the route graph */
struct callback * route_graph_done_cb ; /**< Callback when route graph is done */
struct callback * route_graph_flood_done_cb ; /**< Callback when route graph flooding is done */
struct callback_list *cbl2; /**< Callback list to call when route changes */
@@ -1607,6 +1613,15 @@ route_segment_data_size(int flags)
}
+/**
+ * @brief Checks if the route graph already contains a particular segment.
+ *
+ * This function compares the item IDs of both segments. If the item is segmented, the segment offset is
+ * also compared.
+ *
+ * @param start The starting point of the segment
+ * @param data The data for the segment
+ */
static int
route_graph_segment_is_duplicate(struct route_graph_point *start, struct route_graph_segment_data *data)
{
@@ -1629,9 +1644,6 @@ route_graph_segment_is_duplicate(struct route_graph_point *start, struct route_g
/**
* @brief Inserts a new segment into the route graph
*
- * This function performs a check if a segment for the item specified already exists, and inserts
- * a new segment representing this item if it does not.
- *
* @param this The route graph to insert the segment into
* @param start The graph point which should be connected to the start of this segment
* @param end The graph point which should be connected to the end of this segment
diff --git a/navit/transform.c b/navit/transform.c
index 1c6eeae67..8a6713ab6 100644
--- a/navit/transform.c
+++ b/navit/transform.c
@@ -1187,6 +1187,14 @@ transform_overflow_possible_if_squared(int count, ...) {
return result;
}
+/**
+ * @brief Determines the squared Mercator distance between two points.
+ *
+ * @param c0 The first coordinate
+ * @param c1 The second coordinate
+ *
+ * @return The squared distance between `c1` and `c2`, or `INT_MAX` if an overflow occurs.
+ */
int
transform_distance_sq(struct coord *c1, struct coord *c2)
{
@@ -1216,6 +1224,17 @@ transform_distance_sq_pc(struct pcoord *c1, struct pcoord *c2)
return transform_distance_sq(&p1, &p2);
}
+/**
+ * @brief Determines the point on a line segment that is closest to a reference point, and its distance
+ * from the reference point.
+ *
+ * @param l0 The first coordinate of the line segment
+ * @param l1 The second coordinate of the line segment
+ * @param ref The reference point
+ * @param lpnt Receives the coordinates of the point on the line segment that is closest to `ref`, can be `NULL`
+ *
+ * @return The square of the Mercator distance between `ref` and `lpnt`, or `INT_MAX` if an overflow occurred
+ */
int
transform_distance_line_sq(struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt)
{
@@ -1287,6 +1306,18 @@ transform_distance_line_sq_float(struct coord *l0, struct coord *l1, struct coor
return transform_distance_sq_float(&l, ref);
}
+/**
+ * @brief Determines the point on a polyline that is closest to a reference point, and its distance
+ * from the reference point.
+ *
+ * @param c An array containing the coordinates of the polyline
+ * @param count Number of elements in `c`
+ * @param ref The reference point
+ * @param lpnt Receives the coordinates of the point on the polyline that is closest to `ref`, can be `NULL`
+ * @param pos Receives the index of the line segment containing `lpnt`, can be NULL
+ *
+ * @return The square of the Mercator distance between `ref` and `lpnt`, or `INT_MAX` if an overflow occurred
+ */
int
transform_distance_polyline_sq(struct coord *c, int count, struct coord *ref, struct coord *lpnt, int *pos)
{