Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Excluding areas from routing
Forum Updated to NodeBB v4.3 + New Features

Excluding areas from routing

Scheduled Pinned Locked Moved Unsolved General and Desktop
locationaddexcludedareaqt5.5qml
1 Posts 1 Posters 747 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Red181
    wrote on last edited by Red181
    #1

    Hello guys,

    currently I am working on a navigation app using the QT Location API and the osm plugin. The app allows routing between two given coordinates. Additionally, certain areas can be excluded from the routing by using the addExcludedArea method of the RouteQuery type. Adding those areas works just fine, which I have checked by calling the excludedAreas property (a list of all saved areas). My problem here is, that those excluded areas are not considered when the route is calculated. In all my tests the calculated route leads right through the excluded area. So far I tried everything possible to find the reason for this and I am slowly considering that the method is not working properly.
    The geo rectangle which represents the excluded area is also defined correctly.
    I am using the following function to obtain the route:

        function routeDownload()
        {
            if (startCoordinate.isValid && endCoordinate.isValid){
            //clearing previous data
            routeQuery.clearExcludedAreas()
            routeQuery.clearWaypoints()
    
            //adding the excluded area
            routeQuery.addExcludedArea(region)
            console.debug(routeQuery.excludedAreas)
    
            //adding start and end coordinate
            routeQuery.addWaypoint(startCoordinate)
            routeQuery.addWaypoint(endCoordinate)
    
            //additional routing settings
            routeQuery.travelModes = RouteQuery.CarTravel
            routeQuery.routeOptimizations = RouteQuery.FastestRoute
    
            routeModel.update();
            }
        }
    

    I am very thankfull for every possible advice you could give me. This problem is keeping me busy for some time now.
    Also, can anyone confirm that the addExcludedArea method is actually working?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved