<commit_before>#BC Route Planner
#Developer Guide
This guide is aimed at developers and web masters that would like to incorporate the BC Route Planner into their applications and websites.
<br>
##Introduction
The BC Route Planner REST API lets you integrate basic routing between BC locations into your own applications. This document defines aspects of the REST API that are not covered in the [Swagger definition](https://raw.githubusercontent.com/bcgov/DBC-APIM/master/api-specs/router/router.json). You can explore the API in the [API Console](http://apps.gov.bc.ca/pub/api-explorer/?url=https://raw.githubusercontent.com/bcgov/DBC-APIM/master/api-specs/router/router.json). 
<br>

Your application can store router results or display them on any web map.

##API Key
Use of the BC Route Planner REST API is currently restricted to government. If you are working on a government application that needs routing, please email [DataBC](mailto:<EMAIL>) for an API key. Be sure to include the name of the project and the business area responsible.


##Distance Resource
The distance resource represents the length and duration of the shortest or fastest route between given points. Here are some examples:

1. Length of shortest route in km and json between Duncan and Metchosin<br>https://router.api.gov.bc.ca/distance.json?routeDescription=shortest%20distance%20in%20km%20and%20json&points=-123.707942%2C48.778691%2C-123.537850%2C48.382005&outputSRS=4326&criteria=shortest&distanceUnits=km&apikey=myapikey<br>
   
2. Length of shortest route in km and kml between Duncan and Metchosin<br>https://router.api.gov.bc.ca/distance.kml?routeDescription=shortest%20distance%20in%20km%20and%20kml&points=-123.707942%2C48.778691%2C-123.537850%2C48.382005&outputSRS=4326&criteria=shortest&distanceUnits=km&apikey=myapikey<br>

3. Length of fastest route in miles and html between Duncan and Metchosin<br>https://router.api.gov.bc.ca/distance.html?routeDescription=fastest%20distance%20in%20km%20and%20html&points=-123.707942%2C48.778691%2C-123.537850%2C48.382005&outputSRS=4326&criteria=shortest&distanceUnit=mi&apikey=myapikey<br>

### HTTP Response

Given the following GET Request<br>
https://router.api.gov.bc.ca/distance.json?routeDescription=shortest%20distance%20in%20km%20and%20json&points=-123.1485847%2C55.3933927%2C-123.1515025%2C55.3913904&outputSRS=4326&criteria=shortest&distanceUnits=km&apikey=a82472ff8f754968b4e70943adc63888

the distance resource will return this representation:

    {

        "routeDescription": "shortest distance in km and json",
        "searchTimestamp": "2016-03-30 11:18:07.752",
        "executionTime": ​1,
        "version": "1.1.1",
        "disclaimer": "http://www2.gov.bc.ca/gov/content/home/disclaimer",
        "privacyStatement": "http://www2.gov.bc.ca/gov/content/home/privacy",
        "copyrightNotice": "Copyright 2016 Province of British Columbia - Access only",
        "copyrightLicense": "http://www2.gov.bc.ca/gov/content/home/copyright",
        "srsCode": ​4326,
        "criteria": "shortest",
        "points": 

        [
    
        [

            ​-123.1485847,
            ​55.3933927

        ],

            [
               ​-123.1515025,
                ​55.3913904
            ]
        ],
        "distance": ​1.17,
        "distanceUnit": "km",
        "time": ​95,
        "timeText": "1 minutes 35 seconds"

    }






##Route Resource
The route resource represents the shortest or fastest route between given points and the length and duration of that route. Here are some examples:

1. Shortest route in km and json between Duncan and Metchosin<br>https://router.api.gov.bc.ca/route.json?routeDescription=shortest%20route%20in%20km%20and%20json&points=-123.707942%2C48.778691%2C-123.537850%2C48.382005&outputSRS=4326&criteria=shortest&distanceUnits=km&apikey=myapikey<br>
   
2. Shortest route in km and kml between Duncan and Metchosin<br>https://router.api.gov.bc.ca/route.kml?routeDescription=shortest%20route%20in%20km%20and%20kml&points=-123.707942%2C48.778691%2C-123.537850%2C48.382005&outputSRS=4326&criteria=shortest&distanceUnits=km&apikey=myapikey<br><commit_msg>Update router-developer-guide.md<commit_after>#BC Route Planner
#Developer Guide
This guide is aimed at developers and web masters that would like to incorporate the BC Route Planner into their applications and websites.
<br>
##Introduction
The BC Route Planner REST API lets you integrate basic routing between BC locations into your own applications. This document defines aspects of the REST API that are not covered in the [Swagger definition](https://raw.githubusercontent.com/bcgov/DBC-APIM/master/api-specs/router/router.json). You can explore the API in the [API Console](http://apps.gov.bc.ca/pub/api-explorer/?url=https://raw.githubusercontent.com/bcgov/DBC-APIM/master/api-specs/router/router.json). 
<br>

Your application can store router results or display them on any web map.

##API Key
Use of the BC Route Planner REST API is currently restricted to government. If you are working on a government application that needs routing, please email [DataBC](mailto:<EMAIL>) for an API key. Be sure to include the name of the project and the business area responsible.


##Distance Resource
The distance resource represents the length and duration of the shortest or fastest route between given points. Here are some examples:

1. Length of shortest route in km and json between Duncan and Metchosin<br>https://router.api.gov.bc.ca/distance.json?routeDescription=shortest%20distance%20in%20km%20and%20json&points=-123.707942%2C48.778691%2C-123.537850%2C48.382005&outputSRS=4326&criteria=shortest&distanceUnits=km&apikey=myapikey<br>
   
2. Length of shortest route in km and kml between Duncan and Metchosin<br>https://router.api.gov.bc.ca/distance.kml?routeDescription=shortest%20distance%20in%20km%20and%20kml&points=-123.707942%2C48.778691%2C-123.537850%2C48.382005&outputSRS=4326&criteria=shortest&distanceUnits=km&apikey=myapikey<br>

3. Length of fastest route in miles and html between Duncan and Metchosin<br>https://router.api.gov.bc.ca/distance.html?routeDescription=fastest%20distance%20in%20km%20and%20html&points=-123.707942%2C48.778691%2C-123.537850%2C48.382005&outputSRS=4326&criteria=shortest&distanceUnit=mi&apikey=myapikey<br>

### HTTP Response

Given the following GET Request<br>
https://router.api.gov.bc.ca/distance.json?routeDescription=shortest%20distance%20in%20km%20and%20json&points=-123.1485847%2C55.3933927%2C-123.1515025%2C55.3913904&outputSRS=4326&criteria=shortest&distanceUnits=km&apikey=a82472ff8f754968b4e70943adc63888

the distance resource will return this representation:

    {

        "routeDescription": "shortest distance in km and json",
        "searchTimestamp": "2016-03-30 11:18:07.752",
        "executionTime": ​1,
        "version": "1.1.1",
        "disclaimer": "http://www2.gov.bc.ca/gov/content/home/disclaimer",
        "privacyStatement": "http://www2.gov.bc.ca/gov/content/home/privacy",
        "copyrightNotice": "Copyright 2016 Province of British Columbia - Access only",
        "copyrightLicense": "http://www2.gov.bc.ca/gov/content/home/copyright",
        "srsCode": ​4326,
        "criteria": "shortest",
        "points": 

        [
    
            [

               ​-123.1485847,
                ​55.3933927

            ],

            [
               ​-123.1515025,
                ​55.3913904
            ]
        ],
        "distance": ​1.17,
        "distanceUnit": "km",
        "time": ​95,
        "timeText": "1 minutes 35 seconds"

    }






##Route Resource
The route resource represents the shortest or fastest route between given points and the length and duration of that route. Here are some examples:

1. Shortest route in km and json between Duncan and Metchosin<br>https://router.api.gov.bc.ca/route.json?routeDescription=shortest%20route%20in%20km%20and%20json&points=-123.707942%2C48.778691%2C-123.537850%2C48.382005&outputSRS=4326&criteria=shortest&distanceUnits=km&apikey=myapikey<br>
   
2. Shortest route in km and kml between Duncan and Metchosin<br>https://router.api.gov.bc.ca/route.kml?routeDescription=shortest%20route%20in%20km%20and%20kml&points=-123.707942%2C48.778691%2C-123.537850%2C48.382005&outputSRS=4326&criteria=shortest&distanceUnits=km&apikey=myapikey<br>
{'fraction_non_alphanumeric': 0.11296518607442978, 'fraction_numerical': 0.09987995198079232, 'mean_word_length': 4.354113110539846, 'pattern_counts': {'":': 30, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 16, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '965142', 'n_tokens_mistral': 3186, 'n_tokens_neox': 2688, 'n_words': 616}