Giter VIP home page Giter VIP logo

valhalla-docs's Introduction

valhalla-docs

This repository contains most of the documentation for the Valhalla routing project. Deeper technical information about individual components of Valhalla can be found in the individual repositories contained with the Valhalla organization. This document gives some hints on where to look for specific information.

Documentation available within the valhalla-docs repository includes:

  • Introduction - This is the early history of Valhalla. Introduces the core team and describes overall objectives of the project and some insight on why we chose the name Valhalla.
  • Terminology - Contains commonly used terms and definitions within Valhalla. Also lists the various repositories.
  • Route API Reference - The structure of API requests and responses to a Valhalla routing service is described here. This shows the JSON inputs and describes the JSON responses to form routes and directions.
  • Map Matching API Reference - The structure of API requests and responses to a Valhalla map matching service is described here. This shows the JSON inputs and describes the JSON responses to perform map-matching. There are two flavors: 1) trace_route: froms a route result from the path that matches the input geometry, and 2) trace_attributes: returns detailed attribution along the path that matches the input geometry.
  • Locate API Reference - The structure of API requests and responses to a Valhalla locate service is described here. This shows the JSON inputs and describes the JSON responses to get detailed information about streets and interesections near a location.
  • Matrix API Reference - The structure of API requests and responses to a Valhalla time distance matrix service is described here. This shows the JSON inputs and describes the JSON responses to retrieve times and distances between locations.
  • Optimized Route API Reference - The structure of API requests and responses to a Valhalla optimized route service is described here. This shows the JSON inputs and describes the JSON responses to retrieve the route which optimizes the path through the input locations. This is essentially the Traveling Salesman Problem (TSP)
  • Elevation API Reference - The structure of API requests and responses to a Valhalla elevation service is described here. This shows the JSON inputs and describes the JSON responses to query elevation at specific locations.
  • Isochrone API Reference - The structure of API requests and responses to a Valhalla isochrone service is described here. This shows the JSON inputs and describes the JSON responses to query accessibility polygons around specific locations.
  • Release Notes - Contains information about changes to the API, changes to the data import processing, new features, and general software updates of importance.
  • Add Routing to a Map - A tutorial showing how to add Valhalla routing to web based maps using the Leaflet Routing Machine with Valhalla plugins.
  • Decoding Shape - Describes how to decode the route path's shape (returned as an encoded polyline). Contains sample code in several languages.
  • Tile Description - Describes the tiling system used within Valhalla. Discusses the road hierarchy and tile numbering system.
  • Speed information - Describes the use of speed information and how OpenStreetMap tags impact speeds.

Data source listing and attribution information can be found here:

Technical descriptions available in other Valhalla repositories includes:

  • Why Tiles? - Some of the objectives and reasons for designing a tiled, routing data set are included here.
  • OSM Connectivity Map - Discusses creation of a "Connectivity Map" of OSM that uses Valhalla routing tiles to provide a first order of approximation of connectivity between locations.
  • Use of Administrative Data in Valhalla - Discusses the importance of administrative information to routing and some of the ways that Valhalla uses adminstrative information.
  • Dynamic Costing - Describes the basics of the dynamic, run-time path costing provided within the sif repository.
  • Elevation Influenced Bicycle Routing - Discusses how elevation is factored into bicycle costing to allow features such as "avoid hills".

valhalla-docs's People

Contributors

acwilton avatar alexey-gl avatar bradh avatar dgearhart avatar dnesbitt61 avatar drewda avatar erictheise avatar flother avatar gknisely avatar glennon avatar j-e-d avatar kdiluca avatar kevinkreiser avatar louh avatar migurski avatar njohnston avatar npmcdn-to-unpkg-bot avatar nvkelso avatar oxidase avatar rmglennon avatar rui-santos avatar sleepylemur avatar themarex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

valhalla-docs's Issues

Installation instructions from source

To be able to build and run valhalla stack on local machine, would be great to have installation instructions that are applicable to non-supported distributions. Right now, its probably possible but relatively hard to see which of the components has to be installed and in which sequence. While README has a section "Building and Running Valhalla" [ https://github.com/valhalla/tools ], it would be great to get instructions that don't rely on apt-get. In addition, I suggest to add these instructions under valhalla-docs and refer to them from valhalla repo.

Kind regards,

rinigus

Rework folders in valhalla-docs to simplify publishing process

With the docs being moved to a section at https://mapzen.com/documentation/mobility/ for all of mobility (rather than separate sections for Turn-by-Turn, Matrix, and Optimized route like we had before), there was a lot of custom work with our publishing process to make sure that files were renamed and old URLs redirected.

It's become clearer that we should do these changes upstream in the source files, rather than as part of the publishing process. For example, because of the valhalla-docs file structure and redirecting that has to happen to build the mobility help, we are no longer able to use relative links between files within the same mobility section because they do not forward properly. We have to link with the full, hard-coded URL to link within the mobility help.

I believe it is OK to reorganize the content as it is displayed in GitHub, as we have made no promises for stable links there, and anyone with bookmarks should be able to figure out the new location.

  • rename optimized_route to optimized. We are doing the renaming on the publish.
  • move the loose, root-level md files for Turn-by-Turn into a folder named turn-by-turn. We are forwarding these right now on the output so they will have the same URL structure as the other services in mobility.

Unclear steps

In this issue I'm just adding some potential wording changes based on what tripped me up along the way. Feel free to ignore.

Change <my routing mode> to auto to perform routing by automobile. js router: L.Routing.valhalla('valhalla-xxxxxx', 'auto'),

The 2nd half of that suggestion is unclear. Because of the example text below I see what you're trying to get me to do, but I'm not exactly sure what to make of that line.


From Rhonda - this is the markdown rendering issue.

Roundabout Inconsistencies

Hi,

I'm hoping this is the correct place to create this issue.

I've started to implement Mapzen into our mobile apps, but I'm having issues with the directions regarding Roundabouts. We're using biking directions and I'm finding many of the roundabouts give inconsistent and often inaccurate values for the exit number. Even going to a single roundabout and making a request for each different exit, I often get the same exit number in both the exit count and the description to the user in which exit to take.

This roundabout in particular:
https://www.google.ca/maps/place/49%C2%B004'39.9%22N+6%C2%B006'04.7%22E/@49.077756,6.0999106,17z/data=!3m1!4b1!4m6!3m5!1s0x0:0x0!7e2!8m2!3d49.0777564!4d6.1013132

Coming from the North East, the exit number says to take the first exit for the first 3 exits and the 4th and 5th exit say take the 2nd exit.

Thanks, let me know if I should post this issue in another place.

Tutorial - plugin-organization link doesn't really apply

In https://github.com/valhalla/valhalla-docs/blob/master/add-routing-to-a-map.md, there is this text:

Note that there are guidelines for organizing code for Leaflet plug-ins. You can use a more sophisticated structure for your own work as you progress in your development.

The link that it points to (https://github.com/Leaflet/Leaflet/blob/master/PLUGIN-GUIDE.md) is for people who are going to be project owners of their own Leaflet plugin that is intended to be distributed to a wider audience of developers. It doesn't apply to people who are creating personal projects that use Leaflet. This is going to be extremely confusing for people in the latter group who aren't aware of the difference.

Isochrones enpoint times out on transit

When a sent a request to the isochrone endpoint with an invalid costing value I get a proper response:

$ curl -X GET "http://matrix.mapzen.com/isochrone?json=%7B%22locations%22:%5B%7B%22lat%22:40.744014,%22lon%22:-73.990508%7D%5D,%22costing%22:%22foo%22,%22contours%22:%5B%7B%22time%22:15%7D%5D%7D&api_key=mapzen-3zVshhL"
{"code":400,"status":"Bad Request","error":"No costing method found for 'foo'"}

However when use transit as costing it times out without returning anything.

$ curl -X GET "http://matrix.mapzen.com/isochrone?json=%7B%22locations%22:%5B%7B%22lat%22:40.744014,%22lon%22:-73.990508%7D%5D,%22costing%22:%22transit%22,%22contours%22:%5B%7B%22time%22:15%7D%5D%7D&api_key=mapzen-3zVshhL"

I assume the transit costing isn't fully implemented yet for isochrones, is it?

Consider not self-closing CSS link tags in documentation

E.g.:

<link rel="stylesheet" href="leaflet.css"/>

This appears commonly, but is a relic of an ancient and bygone era of writing HTML. I have personally never been bitten by writing, instead, the semantically correct and much cleaner:

<link rel="stylesheet" href="leaflet.css">

I'm open to counter arguments.

Add ` ` around head tag

In the tag, add a title, such as <title>My Valhalla Map</title>.

Looks like this is supposed to say <head>.

Use and document a CDN for Leaflet Routing Machine

We are getting “good idea” feedback from @perliedman about a CDN for LRM (perliedman/leaflet-routing-machine#192), let’s help that along. CDNJS might be confusing and weird, but in principle any stable URL on S3 or behind Fastly should work. @baldur might have some opinions on this.

Valhalla tutorial - add more instructions for other installation methods

The tutorial describes the download method of getting the libraries, but only mentions that you can use a package manager. Consider adding more details on this workflow, perhaps as a sidebar or subsection. Both Lou and Randy mentioned this.

From @louh:

For people who are fairly experienced front-end developers, package management is the ideal tool for getting dependencies. If that's not available, the next thing we'd look for are CDN links to popular libraries (which Leaflet has, for example). Downloading manually is perhaps the least workflow-friendly way of doing it, although pure beginners or non-developers are likely to do that first because it's a mental model that's already well understood. I think it would make sense to provide some additional instructions even for npm, Bower, or CDN, perhaps in a sub-section; developers who are scanning the document are likely to have the question "is this compatible with my preferred workflow?" and want to know immediately that the answer is yes, even if they don't need to be hand-held through the process. I've often scanned through READMEs of a library I plan to use and it's interesting to see how sometimes they have instructions for certain workflows and not at all for others (sometimes barely a mention) and the question I have is "So, does this mean it won't work at all, or you just haven't explained how it works in X workflow?"

Add hyperlinks for API query examples (but without API key)

Behaviour not consistent when trying to avoid tolls

I'm experiencing an inconsistent behaviour when trying to avoid tolls roads:

Example1: The below 2-legs trip returned shape avoids toll roads as I would expect:
http://valhalla.mapzen.com/route?api_key=valhalla-xxx&json={"locations":[{"lat": 45.113120,"lon": 11.776360},{"lat": 45.020066,"lon": 11.706396},{"lat":44.86595,"lon": 11.575852}],"costing":"auto","costing_options":{"auto":{"toll_booth_penalty":10000.0}},"directions_options": { "unit":"km", "narrative":"false" }}

Example2: However the below 1-legs (obtained by removing the 2nd location) does NOT avoid tolls (it uses part of A13 highway):
http://valhalla.mapzen.com/route?api_key=valhalla-xxx&json={"locations":[{"lat": 45.113120,"lon": 11.776360},{"lat":44.86595,"lon": 11.575852}],"costing":"auto","costing_options":{"auto":{"toll_booth_penalty":10000.0}},"directions_options": { "unit":"km", "narrative":"false" }}

what is surprising is that the removed location is contained in the shape returned by Example2, so I would have expected the same behaviour.

Note, toll_booth is there:https://www.openstreetmap.org/node/255852706
as well as the way https://www.openstreetmap.org/way/28910847 has toll=yes so the returned shape in Example2 should have not entered into the toll road in any case.

What am I doing wrong? Thanks in advance (note: this might linked to #27)

Enrico

Determine whether examples folder is still needed

The examples folder contains files that were used to support the tutorial when it used skin-and-bones yaml. This was updated to cinnabar (see #48). I'm pretty sure these are not used anymore, but I need to investigate.

Clean up API key and rate limit references in docs

We've started a pattern to put the info on getting an API key and the Mapzen-hosted service limits in one topic in the documentation. Doing this is a start to separating the service from the open-source project (which we've been thinking about for ages). It also makes updates easier because there is only one place.

I did this with the new isochrone doc, but need to do it throughout the mobility help.

https://mapzen.com/documentation/mobility/isochrone/api-reference/#inputs-of-the-isochrone-service

Need to remove content in mobility docs and replace with a link to the developer overview that has info for all Mapzen products.

polyline encoding samples

we need a corollary to: https://github.com/valhalla/valhalla-docs/blob/master/decoding.md in which we share sample code to generate an encoded polyline that valhalla will accept. there are off the shelf ones but they may not allow for 6 digits of precision or they may swap lat and lon. its best to just show the example ourselves:

for starters heres the c++11 version: https://github.com/valhalla/midgard/blob/6a74643fed445588a2997d37132370bf3e456991/valhalla/midgard/encoded.h#L81-L119

we can do python and js as well.

question on location limits

Hello, thank you for this great service. I have a question about limits.

The docs here say both that "Pedestrian routes have a limit of 50 locations and 250 kilometers.", and later, under "Locations" that "Locations are visited in the order specified, with a maximum of eight locations currently supported."

In testing, I was able to pass many more than 8 locations. Can you clarify what limits are in effect here?

Confusion around directory names

@rmglennon I don't know what your thoughts are on this, but what are your thoughts on just establishing directory names, rather than always reminding the user to use their own? I am finding that I'm getting confused about which directory I need to reference, and if I was able to set my own directories to all have the same name as yours, that would help. For example, lrm-valhalla is the directory that came w/ the lrm-valhalla download, but because it's such a general name, I'm not sure if sometimes that's how you're referring to your root directory for the whole tutorial.

Let me know if this doesn't make sense, and we can discuss more.

Update documentation for new Mobility Explorer visual styles and tiles

There are some display changes coming to Mobility Explorer that need to be reflected in documentation.

  • updating the colors used in the sidebar to match Mapzen purple stylesheet (mostly affects screenshots of the headings)
  • changing the map tiles to Mapzen vector tiles (with a fallback)

I think users should be able to figure out the screenshots, so it's OK if the documentation lags (in other words, don't let docs hold up a production release).

cc @meghanhade

Calling the elevation API with a POST request

Hi,
when calling the elevation API I noticed that for some of the longer path requests I started getting "Failed to parse json request" error. The json query parameter was probably too long and got cut off. So I tried sending the JSON in a POST HTTP body instead and it worked. I think mentioning this in the docs could be useful.
Ondrej

How to avoid Tolls?

Hi!

From the documentation:
https://github.com/valhalla/valhalla-docs/blob/master/api-reference.md
It's not so clear for me how to avoid all the tolls.

Should be like this? "costing_options":{"auto":{"toll_booth_penalty":100000.0}}

https://valhalla.mapzen.com/route?json={"locations":[{"lat":42.358528,"lon":-83.271400},{"lat":42.996613,"lon":-78.749855}],"costing":"auto","costing_options":{"auto":{"toll_booth_penalty":100000.0}}}&api_key=valhalla-xxxxxx

Thanks in advance!

Tutorial - enhancements for languages and URL hash

Some feedback from @burritojustice for the tutorial (source file: https://github.com/valhalla/valhalla-docs/blob/master/add-routing-to-a-map.md)

  1. Show how to switch languages. Code from tutorial is something like this:
    L.Routing.control({
      waypoints: [
        L.latLng(41.8758,-87.6189),
        L.latLng(33.8128,-117.9259)
      ],
      lineOptions: {
        styles: [ {color: "white",opacity: 0.8, weight: 12},
                {color: "#2676C6", opacity: 1, weight: 6}
      ]},
      router: L.Routing.mapzen("your-api-key", {costing:"auto"}),
      formatter: new L.Routing.mapzenFormatter(),
      summaryTemplate:'<div class="start">{name}</div><div class="info {costing}">{distance}, {time}</div>',
      routeWhileDragging: false
    }).addTo(map);
  1. Add ability to use a URL hash to re-create the route. Mapzen.js has this capability. I think the hash will be easier to get after lrm-mapzen is integrated into mapzen.js.

Doubt in documentation about changing cost

According to the documentation it says:

var rr = L.Routing.mapzen('mapzen-xxxxxx', {costing:'auto'});
[...]
bikeButton.onClick: function () {
  rr.route({costing: "bicycle"});
}

https://github.com/mapzen/lrm-mapzen

But I got the error that I have a null value: route

I applied the following solution:

routeControl.getRouter().options.costing = "auto";
routeControl.route();

Found here: http://gis.stackexchange.com/questions/202432/leaflet-change-routing-vehicle-when-clicked-on-button
where routeControl is the object that holds the lrm control.

The code:

function crearControlRouting() {
    routeControl = L.Routing.control({
    routeLine: function (route, options) { return L.Routing.mapzenLine(route, options); },

  plan: L.Routing.plan([], {
                   geocoder: L.Control.Geocoder.nominatim({
                   geocodingQueryParams: { countrycodes: 'uy'}
                 }),
                 reverseWaypoints: true,
                 city:'Montevideo',
                 language: 'sp'
               }),
    lineOptions: {
            styles:
                [
                  {color: 'black', opacity: 0.15, weight: 9}, //sombra
                  {color: 'white', opacity: 0.8, weight: 6}, // Contorno
                  {color: 'red', opacity: 1, weight: 4}] // Centro
       },

    router: L.Routing.mapzen('mapzen-xxxxxx', {
                 costing: 'bicycle',
                directions_options: {
                    language: 'es'
                  }
    }),

    collapsible: true,
    formatter: new L.Routing.mapzenFormatter(),
    summaryTemplate:'<div class="start">{name}</div><div class="info {costing}">{distance}, {time} aproximado</div>'

}).addTo(mapa);

Thanks for any clarification:

Tutorial Covering How to Add Custom Data to Affect Routes

A number of potential users of valhalla want to add their own open or proprietary data to valhalla route tiles so that they can influence the route computation in certain ways. It would be nice to give a brief overview of where one might make such changes to accomplish this.

I've got a start on this already but I need to turn it into a proper tutorial. After that, it would be nice to have @rmglennon look it over to make sure it makes sense, is properly organized, reads properly etc.

Remove Mapzen References

Scrub references to Mapzen.
For any links to demos - link to github.io pages if they can be configured to run with localhost.
Demos that reference MobilityExplorer may be OK - just point that the user will have to have a local Valhalla instance.

Tutorial - "Unhandled promise rejection Cannot assign to read only property 'layer_name' of false"

Hello.

I'm working through the tutorial https://mapzen.com/documentation/turn-by-turn/add-routing-to-a-map/, and ran into a problem getting the initial Tangram layer added to the map.

Here's a screenshot of the error I'm seeing in the console (using https://mapzen.com/tangram/tangram.debug.js for more clarity):
http://ep.d.pr/19TMS/2Z5DQiAB

HTML and scripts

<body>
  <div id="map"></div>
  <script src="leaflet/leaflet.js"></script>
  <script src="https://mapzen.com/tangram/tangram.debug.js"></script>
  <script src="leaflet-routing-machine/leaflet-routing-machine.js"></script>
  <script src="lrm-valhalla/lrm-valhalla.js"></script>
  <script>
    var map = L.map('map');
    var layer = Tangram.leafletLayer({
      scene: 'https://raw.githubusercontent.com/valhalla/valhalla-docs/master/examples/skin-and-bones-scene.yaml',
      attribution: '<a href="https://mapzen.com/tangram" target="_blank">Tangram</a> | <a href="http://www.openstreetmap.org/about" target="_blank">&copy; OSM contributors | <a href="https://mapzen.com/" target="_blank">Mapzen</a>',
    });
    layer.addTo(map);
    map.setView([41.8758,-87.6189], 16)
  </script>
</body>

Any help you can provide would be great. I'm excited to start working with Valhalla.

Thanks.

Michael

Simpler shapes

Hi!

On the route response you include the shape as a polyline. It is highly detailed with many points. Is there a way to request the shape of an 'overview' of the route? That overview would have way less points but still allow rendering the route over a map with acceptable precision.

Thanks!

Add more examples of costing options syntax

We have had a couple of support tickets recently (such as Desk 1295) where users have missed the syntax for costing options, usually because they are not including the model name again. The proper way is "costing_options":{"bicycle":{...}}, rather than "costing_options":{...}. Without this, they never see a difference when setting the bicycle type, for example.

We should add more examples of how to do this for all models.

{"locations":[{"lat":37.94152381803029,"lon":-121.96226477622986},{"lat":37.931335857027115,"lon":-121.97398066520691}],"costing":"bicycle","costing_options":{"bicycle":{"bicycle_type":"Mountain","use_roads":"0.5","use_hills":"0.0"}}}

Make some updates to the README

We need to make a few updates to the README, such as:

  • links to formatted version on mapzen.com
  • new APIs like isochrone, map-matching, and so on (or remove them here to keep it easier to update) and Mobility Explorer
  • contribution instructions
  • links to other repositories that no longer exist

Crash when building tiles with recent Asia data

Hello, all.

When importing any of the last several OSM planet dumps (I've tried 3), valhalla_build_tiles crashes. In an attempt to at least get a server running on a reasonable subset of the world, I downloaded the latest extracts from Geofabrik to isolate the problem. It appears to be somewhere in Asia. After isolating the issue data-wise, I reran a fresh build with everything but Asia (and Antarctica; I didn't bother testing that) and everything worked. I didn't try to go much further than that, but if someone on the project thinks this would be helpful, I'm happy to do some more legwork.

screen shot 2017-06-19 at 22 49 16

POSTing and GETting Pros and Cons Elaboration

We need to document the fact that its just far easier to POST json to our services than to GET with it. json is awesome but it makes use of a lot of characters that need urlencoded. On top of that some of our API's like you to send the polyline encoded string as input instead of literal coordinates. The polyline encoded string is all visible ascii so that is nice but it has even more characters that need to be urlencoded. Couple that with the fact that it allows for escape chars and you are in for a painful bit of programming. At any rate at this point we have assembled workign code for POSTing in ruby and javascript and we can add python too. We can also describe the pitfalls above and suggest some best practices.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.