{"componentChunkName":"component---src-templates-page-js","path":"/en/services/","result":{"data":{"markdownRemark":{"fields":{"slug":"/en/services/"},"frontmatter":{"title":"Services","isFront":null,"panels":[]},"html":"<h2 id=\"digitransit-services\" style=\"position:relative;\"><a href=\"#digitransit-services\" aria-label=\"digitransit services permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Digitransit services</h2>\n<p>The main components of Digitransit service platform are:</p>\n<ol>\n<li>Multimodal routing engine</li>\n<li>Address search</li>\n<li>Background map service</li>\n<li>Web browser-based user interface</li>\n</ol>\n<p>The first three of these need some source data. Digitransit includes the respective data loading processes for them.</p>\n<p>The multimodal routing engine OpenTripPlanner uses GTFS-compliant public transit data together with map information from OpenStreetMap in pbf form.</p>\n<p>The address search engine is based on Pelias open source project. The service searches coordinates for place names and addresses, or\nreturns the nearest place / address from the given coordinate point.</p>\n<p>The background map service provides map information as raster and vector tiles.</p>\n<p>Digitransit user interface is a browser based application, which combines the above mentioned services for example in route itinerary searches.</p>\n<p>In addition to these main components, Digitransit includes a set of additional services for realtime and information purposes. They are not\nmandatory for running the multimodal trip planning service.</p>\n<h2 id=\"deploying-a-digitransit-service-instance\" style=\"position:relative;\"><a href=\"#deploying-a-digitransit-service-instance\" aria-label=\"deploying a digitransit service instance permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Deploying a Digitransit service instance</h2>\n<p>All Digitransit micro services are packaged as Docker containers, which are easy to run in your own server. To certain extent,\nit is possible to tune and modify the execution of the containers using environment variables.</p>\n<p>The easiest solution is to use the source data provided by Digitransit (OpenTripPlanner data container, Pelias data container, hsl-map-server).\nHowever, the service will then work only on areas covered by existing Digitransit data sources.</p>\n<p>To use your own data in a microservice, you need to copy the respective data loading process of Digitransit and modify it to suit your needs.\nIn some cases, it may be sufficient to define additional data sources using environment variables (OpenTripPlanner data loader allows this),\nbut in general case, you have to fork the source code repository of github/hsldevcom and modify it, or develop a totally new data loader.</p>\n<p>The dataloading configuration for OpenTripPlanner routing is fairly easy to modify to include desired data sources.\nThe configuration includes a list of web addresses, from where the loader fetches GTFS packages, and the address of OSM map data.\nIt is a straightforward task to replace these addresses.</p>\n<p>Source data for Pelias address search is collected and processed with a set of scripts. A single data source is processed using\na tailored javascript library, for example <a href=\"https://github.com/hsldevcom/pelias-gtfs\">https://github.com/hsldevcom/pelias-gtfs</a> for stop data. Unnecessary scripts can be removed and new\nones added to obtain the desired address data collection. It should be noted that the administrational attributes (neighbourhood, locality, postal area etc)\nare mapped to address items using built-in area information fetched from WhosOnFirst data service. This mechanism should be replaced\nor the data content changed.</p>\n<p>The dataloading process of background maps is heavily tied with services provided by HSL. A replacement can be developed by following\nthe <a href=\"../developers/apis/4-map-api\">map api specifications</a>.</p>\n<p>It should be noted that hosting only a subset of services and using APIs of Digitransit for the rest is also possible. For example, a new local\nrouting service in Finland may well use the address search of Digitransit, because it covers the whole country.</p>\n<p>An example of hosting your private  trip planning service using Helsinki region data:</p>\n<ol>\n<li>Install Docker environment</li>\n<li>Start the multimodal routing engine:</li>\n</ol>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token function\">docker</span> run <span class=\"token parameter variable\">-d</span> <span class=\"token parameter variable\">--rm</span>  <span class=\"token parameter variable\">-p</span> <span class=\"token number\">9080</span>:8080 <span class=\"token parameter variable\">-e</span> <span class=\"token assign-left variable\">ROUTER_NAME</span><span class=\"token operator\">=</span>hsl <span class=\"token parameter variable\">-e</span> <span class=\"token assign-left variable\">JAVA_OPTS</span><span class=\"token operator\">=</span>-Xmx3g <span class=\"token parameter variable\">-e</span> <span class=\"token assign-left variable\">ROUTER_DATA_CONTAINER_URL</span><span class=\"token operator\">=</span>https://api.digitransit.fi/routing-data/v2/hsl hsldevcom/opentripplanner:prod</code></pre></div>\n<p>OpenTriPlanner services are now available in the address <code class=\"language-text\">localhost:9080</code>.</p>\n<ol start=\"3\">\n<li>Start the address information database:</li>\n</ol>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token function\">docker</span> run <span class=\"token parameter variable\">-d</span> <span class=\"token parameter variable\">--rm</span> <span class=\"token parameter variable\">--name</span> pelias-data-container hsldevcom/pelias-data-container</code></pre></div>\n<ol start=\"4\">\n<li>Start the address search engine:</li>\n</ol>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token function\">docker</span> run <span class=\"token parameter variable\">-d</span> <span class=\"token parameter variable\">--rm</span> <span class=\"token parameter variable\">--name</span> pelias-api <span class=\"token parameter variable\">-p</span> <span class=\"token number\">3100</span>:8080 <span class=\"token parameter variable\">--link</span> pelias-data-container:pelias-data-container hsldevcom/pelias-api</code></pre></div>\n<p>Address search is now served at <code class=\"language-text\">localhost:3100</code>. To test, open a browser and browse to url <code class=\"language-text\">https://localhost:3100/v1/search?text=Helsinki</code></p>\n<ol start=\"5\">\n<li>Run the user interface service:</li>\n</ol>\n<div class=\"gatsby-highlight\" data-language=\"bash\"><pre class=\"language-bash\"><code class=\"language-bash\"><span class=\"token function\">docker</span> run <span class=\"token parameter variable\">-d</span> <span class=\"token parameter variable\">--rm</span>  <span class=\"token parameter variable\">-p</span> <span class=\"token number\">8080</span>:8080 <span class=\"token parameter variable\">-e</span> <span class=\"token assign-left variable\">OTP_URL</span><span class=\"token operator\">=</span>http://localhost:9080/otp/ <span class=\"token parameter variable\">-e</span> <span class=\"token assign-left variable\">CONFIG</span><span class=\"token operator\">=</span>hsl <span class=\"token parameter variable\">-e</span> <span class=\"token assign-left variable\">GEOCODING_BASE_URL</span><span class=\"token operator\">=</span>localhost:3100/v1 hsldevcom/digitransit-ui</code></pre></div>\n<p>You can now browse to the address <code class=\"language-text\">localhost:8080</code> and use your private trip planning service, which uses background maps from Digitransit API.</p>\n<h2 id=\"theming-the-user-interface\" style=\"position:relative;\"><a href=\"#theming-the-user-interface\" aria-label=\"theming the user interface permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Theming the user interface</h2>\n<p>The default theme of the Digitransit user interface does not include any city specific features. It is configured to work with the data of the entirety of Finland.</p>\n<p>The UI can be themed and configured to suit a new target area by adding a new configuration file into to repository\n<a href=\"https://github.com/HSLdevcom/digitransit-ui\">https://github.com/HSLdevcom/digitransit-ui</a>, to the folder <code class=\"language-text\">app/configurations</code>. For more information, check out\n<a href=\"https://github.com/HSLdevcom/digitransit-ui/blob/master/docs/Themes.md\">https://github.com/HSLdevcom/digitransit-ui/blob/master/docs/Themes.md</a> .</p>\n<p>The language collection available in the user interface can be extended by adding required strings into <code class=\"language-text\">app/translations.js</code> file and by updating\nthe language selector component respectively.</p>\n<h2 id=\"resources\" style=\"position:relative;\"><a href=\"#resources\" aria-label=\"resources permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Resources</h2>\n<p>Examples:</p>\n<ul>\n<li>The routing engine OpenTripPlanner with the data of the entirety of Finland requires 12 GB of RAM and a powerful multi core CPU.</li>\n<li>An address search which covers the entirety of Finland requires 3 GB of RAM for the API server (pelias-api) and 4 GB of RAM for the address database (pelias-data-container).\nA powerful CPU will speed up the service.</li>\n<li>The background map server (hsl-map-server) needs 4 GB of RAM and a basic CPU.</li>\n<li>The UI-server requires 1 GB of RAM and a basic CPU.</li>\n</ul>\n<p>These resources can serve multiple simultaneous uses without delays. If the service load is high, it may be necessary to deploy a load balancing\nsolution to distribute service requests to multiple servers. For example, Digitransit uses over 20 OpenTripPlanner instances to serve\nthe capital area of Finland.</p>\n<p>It is possible to optimize the resources and speed up the response times using various caching technologies (CDN, proxy caching).\nEspecially the background map service benefits from those.</p>\n<h2 id=\"country-specific-features-of-digitransit\" style=\"position:relative;\"><a href=\"#country-specific-features-of-digitransit\" aria-label=\"country specific features of digitransit permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Country specific features of Digitransit</h2>\n<p>The OpenTripPlanner fork developed for Digitransit is fairly generic, and does not include significant Finland-specific features.\nSome features, such as ticket price computation for the Helsinki area, can be activated using a suitable configuration.</p>\n<p>Pelias address search has been modified to support searches in many languages and local character set. All country specific features are defined\nin the configuration file.</p>\n<h2 id=\"links-to-source-code-repositories\" style=\"position:relative;\"><a href=\"#links-to-source-code-repositories\" aria-label=\"links to source code repositories permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Links to source code repositories</h2>\n<ul>\n<li><a href=\"https://github.com/HSLdevcom/OpenTripPlanner\">Routing engine</a></li>\n<li><a href=\"https://github.com/HSLdevcom/OpenTripPlanner-data-container\">Routing data loading</a></li>\n<li><a href=\"https://github.com/HSLdevcom/pelias-api\">Address search</a></li>\n<li><a href=\"https://github.com/HSLdevcom/pelias-data-container\">Address data loading</a></li>\n<li><a href=\"https://github.com/HSLdevcom/hsl-map-server\">Background maps</a></li>\n<li><a href=\"https://github.com/HSLdevcom/digitransit-ui\">Web UI</a></li>\n</ul>","excerpt":"Digitransit services The main components of Digitransit service platform are: Multimodal routing engine Address search Background map service Web browser-based user interface The first three of these…"}},"pageContext":{"slug":"/en/services/"}},"staticQueryHashes":["3675773199","4050193485"]}