Using local openroute Service with custom osm file

1,271 views
Skip to first unread message

salvador.pe...@gmail.com

unread,
Jan 23, 2018, 4:20:07 AM1/23/18
to openrouteservice.org
Hi, I'm trying to deploy openRoute service in local with an Open Streep Map of Madrid using docker. As explained in the section from doc: https://github.com/GIScience/openrouteservice/blob/master/docker/README.md , I follow these steps:
  1. Set the file Madrid.osm.gz in the folder docker/data
  2. Change in docker/conf the file app.config: Set as source in Routing: sources: ["data/Madrid.osm.gz"]
  3. Change in docker-compose.yml the variable App-Config to point to: APP_CONFIG: ./docker/conf/app.config

Then I run sudo docker-compose up as explained in the doc. The deployment seems to work fine, I even execute a terminal in the ors-core container and go to the folder "/usr/local/tomcat/data/" and the only osm file I find is Madrid.osm.gz.


However, if I execute a routing command in Madrid Area as: curl 'http://localhost:8080/ors/routes?profile=foot-walking&coordinates=-3.718479,40.438718|-3.711752,40.438938The answer is:


curl 'http://localhost:8080/ors/routes?profile=foot-walking&coordinates=-3.718479,40.438718|-3.711752,40.438938'
{"error":{"code":299,"message":"Point 0 is ouf of bounds: 40.438718,-3.718479"},"info":{"engine":{"version":"4.4.0","build_date":"2018-01-23T08:53:43Z"},"timestamp":1516698780566}}


(Those points are for sure in Madrid, if I consult the openRouteService API, I get a Route in Madrid:

curl 'https://api.openrouteservice.org/directions?api_key=My_API_Key&profile=foot-walking&coordinates=-3.718479,40.438718|-3.711752,40.438938')


On the other hand, if I execute a routing command in Heidelberg Area (the default) I get the route, but supposedly, Heidelberg map is not included in the config file anymore.


Am I doing anything wrong? Maybe missing some step? I also tried to force the build:

  • sudo docker-compose build --force-rm --no-cache 
  • sudo docker-compose up

but the result is the same, Heidelberg Works and Madrid doesn't.



Timothy

unread,
Jan 24, 2018, 10:53:40 AM1/24/18
to openrouteservice.org
Hi Salvador,

this seems to be an issue with the app.config pointing to the sample dataset. Can you 

docker exec -it ors-app bash 

and check the webapps ors folder and paste the app.config in here?

Cheers, Tim
Message has been deleted

salvador.pe...@gmail.com

unread,
Jan 25, 2018, 4:11:12 AM1/25/18
to openrouteservice.org
Hi Timothy,

Thanks for your quick answer!

It seems to be fine (in Sources field only Madrid is written). I also checked that in the /data folder, inside the container, the only "OSM" file is Madrid.osm.gz

Here you go:
root@229c046bba72:/usr/local/
tomcat/webapps/ors/WEB-INF# cat app.config
{
    ors {
        services: {
            shortenlink: {
                enabled: true,
                #user_name: YOUR_USER,
                #user_password: YOUR_PASSWORD,
                #api_key: YOUR_API_KEY,
                #attribution: "openrouteservice.org, OpenStreetMap contributors"
            }
            accessibility: {
                enabled: true,
                maximum_range_distance: 120000,
                maximum_range_time: 3600,
                maximum_locations: 2,
                route_details_allowed: true,
                attribution: "openrouteservice.org, OpenStreetMap contributors"
            }           
            matrix: {
                enabled: true,
                maximum_locations: 200,
                maximum_visited_nodes: 100000,
                   allow_resolve_locations: true,
                attribution: "openrouteservice.org, OpenStreetMap contributors"
            }
            mapmatching: {
                enabled: true,
                maximum_locations: 100,
                maximum_search_radius: 200,
                maximum_visited_nodes: 10000,
                attribution: "openrouteservice.org, OpenStreetMap contributors"
            }
           
            isochrones: {
                enabled: true,
                # possible values for maximum_range_distance and maximum_range_time are an integer or a list of values specifically defined for each profile
                maximum_range_distance:
                [
                   { profiles: "any", value: 50000 }
                   { profiles: "driving-car, driving-hgv", value: 100000 }
                ],
                maximum_range_time:
                [
                   { profiles: "any", value: 18000 }
                   { profiles: "driving-car, driving-hgv", value: 3600 }
                ],
                maximum_intervals: 10,
                maximum_locations: 2,
                allow_compute_area: true,
                attribution: "openrouteservice.org, OpenStreetMap contributors"
            }
            geocoding: {
                enabled: true,
                geocoder_name: pelias,
                geocoding_url: "http://129.206.7.154:3100/v1/search",
                reverse_geocoding_url: "http://129.206.7.154:3100/v1/reverse",
                response_limit: 20,
                user_agent: openrouteservice.org,
                attribution: "openrouteservice.org, OpenStreetMap contributors"
            }
            locations: {
                enabled: true,
                provider_name: postgresql,
                provider_parameters: {
                    host: "129.206.7.103",
                    port: 5432,
                    db_name: "gis",
                    user: "admin",
                    password : "gZwe5Nj",
                    table_name : "planet_osm_pois_42"
                },
                response_limit: 1000,
                maximum_categories: 5,
                # maximum allowed length of a linestring, measured in meters
                maximum_feature_length: 10000000,
                # maximum allowed area of a polygon, measured in square meters
                maximum_feature_area: -1,
                # maximum allowed search radius
                maximum_search_radius_for_points: 50000,
                maximum_search_radius_for_linestrings: 2000,
                maximum_search_radius_for_polygons: 1000,
                attribution: "openrouteservice.org, OpenStreetMap contributors"
            }
            routing: {
                enabled: true,
                mode: "normal",
                sources: ["Madrid.osm.gz"],
                init_threads: 2,
                attribution: "openrouteservice.org, OpenStreetMap contributors, tmc - BASt",
                distance_approximation: true,
                profiles: {
                    active: ["vehicles", "bike", "bike2", "pedestrian"],
                    default_params: {
                        encoder_flags_size: 8,
                        graphs_root_path: "data/graphs",
                        elevation_provider: cgiar,
                        elevation_cache_path: "data/cgiar_provider",
                           instructions: true,
                           maximum_distance: 10000000,
                           maximum_segment_distance_with_dynamic_weights: 50000,
                           maximum_waypoints: 50
                       
                        preparation:
                        { 
                            min_network_size: 200,
                            min_one_way_network_size: 200,
                           
                            methods:
                            {
                                lm:
                                {
                                    enabled: true,
                                    threads: 1,
                                    weightings: "fastest,shortest",
                                    landmarks: 16
                                }
                            }
                        }
                        execution:
                        {
                            methods:
                            {
                                lm:
                                {
                                    disabling_allowed: true,
                                    active_landmarks: 8
                                }
                            }
                        }
                    },
                    profile-vehicles: {
                        profiles: "driving-car,driving-hgv",
                        parameters: {
                            encoder_flags_size: 4,
                            encoder_options : "turn_costs=true|block_fords=false|maximum_grade_level=1,turn_costs=true|block_fords=false",
                            maximum_distance: 100000000000,
                            elevation: true,
                            preparation:
                            { 
                                min_network_size: 200,
                                min_one_way_network_size: 200,
                           
                                methods:
                                {
                                    ch:
                                    {
                                        enabled: true,
                                        threads: 1,
                                        weightings: "fastest"
                                    },
                                    lm:
                                    {
                                        enabled: true,
                                        threads: 1,
                                        weightings: "fastest,shortest",
                                        landmarks: 16
                                    }
                                }
                            }
                            execution:
                            {
                                methods:
                                {
                                    ch:
                                    {
                                        disabling_allowed: true
                                    },
                                    lm:
                                    {
                                        disabling_allowed: true,
                                        active_landmarks: 8
                                    }
                                }
                            }
                            ext_storages: {
                                WayCategory: { },                               
                                HeavyVehicle: { restrictions: true },                               
                                WaySurfaceType: { },
                                Tollways: { }
                            }
                            traffic: false
                        }
                    }
                    profile-bike: {
                        profiles: "cycling-regular, cycling-mountain, cycling-road",
                        parameters: {
                            # extent: [5.866240, 15.042050, 47.270210, 55.058140], #
                             encoder_options :"consider_elevation=true|turn_costs=true|block_fords=false,consider_elevation=true|turn_costs=true|block_fords=false,consider_elevation=true|turn_costs=true|block_fords=false",
                              elevation: true,
                            ext_storages: {
                                WayCategory: { },                               
                                WaySurfaceType: { },
                                HillIndex: { },
                                TrailDifficulty: { }
                            }
                        }
                    }
                    profile-bike2: {
                        profiles: "cycling-safe,cycling-tour, cycling-electric",
                        parameters: {
                             encoder_options: "consider_elevation=true|turn_costs=true|block_fords=false,consider_elevation=true|turn_costs=true|block_fords=false,consider_elevation=true|turn_costs=true|block_fords=false",
                            elevation: true,
                             ext_storages: {
                                WayCategory: { },                               
                                WaySurfaceType: { },
                                HillIndex: { },
                                TrailDifficulty: { }
                            }
                        }
                    }
                    profile-pedestrian: {
                        profiles: "foot-walking,foot-hiking",
                        parameters: {
                            encoder_options: "block_fords=false,block_fords=false",
                            elevation: true,
                            ext_storages: {
                                GreenIndex: {
                                    filepath: "data/green_streets_hd.csv"
                                },
                                NoiseIndex: {
                                    filepath: "data/noise_data_hd.csv"
                                },
                                WayCategory: { },                               
                                WaySurfaceType: { },
                                HillIndex: { },
                                TrailDifficulty: { }
                            }                        
                        }
                    }
                }
                update: {
                    enabled: false,
                    time: "5, 10:10:00, 100000",
                    source: "URL/TO/**.osm.pbf",
                    extent: "",
                    working_directory: "./update_graphs"
                }

                traffic: {
                    enabled: false,
                    source: "type=ftp;server=viznrwftp.gewi.com;user=cacc016;password=4)Zn3450;file=viznrw.xml",
                    location_codes_path: "PATH/TO/TMC_LCL_LIST",
                    update_interval: 300000,
                    output_directory: "Temp"
                }
            }
        }
        logging: {
            enabled: true,
            level_file: "DEBUG_LOGGING.properties",
            location: "./logs",
            stdout: true
        }
    }
}


Timothy

unread,
Jan 29, 2018, 7:42:32 PM1/29/18
to openrouteservice.org
Can you try to delete the graphs folder and "docker restart ors-app" ?


On Tuesday, January 23, 2018 at 10:20:07 AM UTC+1, salvador.pe...@gmail.com wrote:

salvador.pe...@gmail.com

unread,
Jan 30, 2018, 3:28:18 AM1/30/18
to openrouteservice.org
It worked!! It seems that it doesn't properly recalculate graphs when the folder already exists.

Thank you for your help!
Reply all
Reply to author
Forward
0 new messages