تخصيص محرك التوجيه
في بعض الحالات قد ترغب في توسيع أو تعديل تجربة التوجيه في OsmAnd، بحيث يمكنك إضافة معلمات إضافية، أو إضافة حواجز إضافية أو تغيير بعض العقوبات. يرجى إلقاء نظرة على routing.xml. يستخدم توجيه OsmAnd خوارزمية A* ثنائية الاتجاه تعتمد على أسرع وقت (= distance/(speed*priority) + penalties). إنه تنسيق سهل للغاية. وهو مقسم إلى 7 أقسام (مجموعات تقييم):
- access (1 allow, -1 not allow)
- speed (number that presents speed in kmh)
- priority (number between 0 and 1) - a multiplier to the speed and it is still bound to maxSpeed, so minimum (speed * multiplier, maxSpeed) will be used for A*
- oneway (1, -1 or 0) - used to clarify access based on direction of the movement
- penalty_transition (penalty in seconds) - used to define penalty when user goes from high class road to low class road. For example, motorway - 10, trunk - 15, if user goes from motorway to trunk penalty will be 5 seconds (=10 - 15). This penalty will be used by A* algorithm. There is no penalty if user goes from motorway to trunk and there is no penalty if route continues from motorway to motorway.
- obstacle (penalty in seconds) - defines penalty which is to the routing time
- obstacle_time (penalty in seconds) - defines penalty which is displayed to the user but it is not considered by routing engine i.e. obstacle_time - 2 hours, obstacle - 1 minute, on the shortest route engine will find a route using 1 minute obstacle but user will see that route time is 2 hours.
لاختبار routing.xml، يمكنك استخدام OsmAndMapCreator. لاختبار routing.xml على الجهاز، يمكنك ببساطة استبدال routing.xml الافتراضي في المجلد الجذر لـ OsmAnd ببطاقة SD.