[
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Report a bug you encountered in Qwant Maps\ntitle: ''\nlabels: bug\nassignees: ''\n\n---\n\n<!--\n - give a description of the bug as concise and clear as possible\n - specify your environement (OS / Browser / versions ...) if you know it\n - add a screenshot if it is relevant\n-->\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for the project\ntitle: ''\nlabels: enhancement\nassignees: ''\n\n---\n\n<!-- We are a small team and may not be able to implement your feature in the short term, however any suggestion is welcome and will be taken into consideration. You can read more about how we treat issues in https://github.com/Qwant/qwantmaps/issues/167 -->\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/question.md",
    "content": "---\nname: Question\nabout: You have a question or a topic you want to discuss about the project\ntitle: ''\nlabels: question\nassignees: ''\n\n---\n\n\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Qwant Maps Changelog\n\n## Release v0.1.2\nRelease date: May 22, 2019\n\n### Components\n* Erdapfel [v0.1.9](https://github.com/QwantResearch/erdapfel/releases/tag/v0.1.9)\n* Idunn [v0.1.5](https://github.com/QwantResearch/idunn/releases/tag/v0.1.5)\n* Mimir [v1.7.0](https://github.com/CanalTP/mimirsbrunn/releases/tag/v1.7.0)\n\n### Improvements\n- Add \"images\" to the POI panel\n- Add possibility to fetch multiple external data sources\n- Fix in wiki details request\n- Optimization in \"opening hours\" parsing\n- Fix directions\n- IE11 better compatibility\n- Suggest improvements\n- Masq integration\n- Category filters\n- Add image thumbnail on POI\n- Misc minor fixes\n\n## Release v0.1.1\nRelease date: April 1, 2019\n\n### Components\n* Erdapfel [v0.1.8](https://github.com/QwantResearch/erdapfel/tree/v0.1.8)\n* Idunn [v0.1.4](https://github.com/QwantResearch/idunn/releases/tag/v0.1.4)\n* Mimir [v1.7.0](https://github.com/CanalTP/mimirsbrunn/releases/tag/v1.7.0)\n\n### Improvements\n* Itineraries available for cars, pedestrians and bicycles.\n* Internationalized queries possible for administrative zones (cities, regions...).\n* Improvements on search field and geolocation process\n* Improvements about Directions UI and error handling\n* Misc fixes\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright [yyyy] [name of copyright owner]\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "contributing.md",
    "content": "# Contributing\n\nWant help us on Qwant Maps ? Awesome, thanks for taking the time to contribute ! Here are a few things you can do.\n\n# Improving the map\nQwant Maps main data source is OpenStreetMap (OSM). It's an international project to create an open geographical database of the entire world: https://www.openstreetmap.org/about\n\nIf you know your neighborhood, you are entitled to participate: join the community and improve the map with us.\nYou will need a free account here: https://www.openstreetmap.org/user/new\nTo get you started, check out:\n* https://www.openstreetmap.org/welcome\n* https://learnosm.org/fr/beginner/\n* https://wiki.openstreetmap.org/wiki/Contribute_map_data\n* [French local chapter website](https://www.openstreetmap.fr/contribuer/) (:fr:)\n\n# Translating\n :fr:  :it:  :ru:  :de: *Help us bring Qwant Maps in your language*   :jp:  :kr:  :cn:  :es:\n\nYou can join the translation team on [transifex](https://www.transifex.com/qwant-1/qwant-maps/), ask for your language and start translating.\n\n# Reporting Bugs or suggesting enhancements\n\nIf you find a bug on the map (a missing place or some outdated location), you can fix it by [contributing to OpenStreetMap](https://www.openstreetmap.org/welcome). If you don't want to take the time to sign up and learn how to edit, you can also [add a note on OSM website](https://www.openstreetmap.org/note/new) so other contributors may investigate.\n\nOtherwise, you can [submit an issue](https://github.com/Qwant/qwantmaps/issues/new) in this repository. Please provide as much details as you can, with screenshots and steps to reproduce.\n\n# Contributing code and documentation changes\n\nIf you want to deep dive and help out with some development on Qwant Maps, then first read along in this repository to understand the architecture and find out some repository to contribute on. [Cosmogony](https://github.com/osm-without-borders/cosmogony) (the tool we use to understand administrative zones) or [Erdapfel](https://github.com/Qwant/erdapfel) (Qwant Maps website) may be good candidates to get started.\n\nIf you have a bugfix or new feature that you would like to contribute to the project, please find or open an issue about it first: maybe we are already working on it, or there are particular issues that you should know about before implementing the change. :pray: Thanks again!\n\n# Expanding\n :earth_americas: *Help us bring Qwant Maps in your country*  :earth_asia:\n\nQwant Maps is developed in France and for now has been mainly tested by French people. We need your local knowledge to make it work in the entire world :rocket:\n* Test Qwant Maps in your language and in your country and tell us what should be improved\n* [Join](https://wiki.openstreetmap.org/wiki/Mailing_lists) your local OpenStreetMap community, meet other mappers and improve the map\n* Tell us more about the administrative divisions in your country: we need them to add local context to your geographical searches. Learn more with [Cosmogony](https://github.com/osm-without-borders/cosmogony#contribute)\n* Enrich the test cases we use for our geographical search engine by contributing to [geocoder-tester](https://github.com/qwant/geocoder-tester): Write a few search queries for your country and tell us what you expect Qwant Maps to find when you type these queries. [This file](https://github.com/qwant/geocoder-tester/blob/master/geocoder_tester/world/italy/test_from_user_input.csv) provides a good example :it: to get you started.\n* Did we mention \"contribute to OpenStreetMap\" ? :wink:\n\n# Update\nWhen should you expect your contributions on Qwant Maps ? \n* Point of interest are updated on a daily basis.\n* Addresses are updated on a monthly basis.\n\n# Others\nThere are many other ways to contribute, from improving the documentation to writing blog posts. Please share your favorite locations on Qwant Maps with your friends and help them #SwitchToQwant #SwitchToOSM\n"
  },
  {
    "path": "images/readme.md",
    "content": "# Note\n\nThe images were generated with [draw.io](https://www.draw.io/).\n\nwhen editing an image don't forget to update both the raw data (.xml) and the generated image."
  },
  {
    "path": "readme.md",
    "content": "<h1 align=\"center\">\n  <img src=\"./images/logo.png\" alt=\"QwantMaps\" width=\"520\" height=\"200\" />\n</h1>\n\n<h5 align=\"center\">\n  <a href=\"https://www.qwant.com/maps\">Maps</a> |\n  <a href=\"./contributing.md\">Contribute</a> |\n  <a href=\"https://betterweb.qwant.com/en/qwant-maps-a-open-and-privacy-focused-map/\">About</a> |\n  <a href=\"https://github.com/Qwant/erdapfel\">Frontend</a> |\n  <a href=\"https://github.com/Qwant/kartotherian_docker\">Tile server</a> |\n  <a href=\"https://github.com/CanalTP/mimirsbrunn\">Geocoder</a> |\n  <a href=\"https://github.com/Qwant/idunn\">Internal API</a>\n</h5>\n\n<p align=\"center\">\n🗺️ <a href=\"https://www.qwant.com/maps\"><strong>Qwant Maps</strong></a> is a map application that respects your privacy 🔍\n</p>\n\n![Qwant Maps screenshot](screenshot.png)\n\n## Qwant Maps URLs\n\nQwant Maps provides links you can share with your friends to help them to #SwitchToQwant and #SwitchToOSM.\nFor instance, you can:\n- search for a specific location on the map with the following format:  \n`https://www.qwant.com/maps/#map=<zoom level>/<latitude>/<longitude>`  \nExample: https://www.qwant.com/maps/#map=12.08/48.8642287/2.3391427\n\n\n- search a specific place on the map with the following path:  \n`https://www.qwant.com/maps/place/<id>`  \nExample: https://www.qwant.com/maps/place/osm:node:532031656@LExpress_de_Lyon\n\n#### A routing request\n\nThis endpoint points to a routing form and can pre-fill some of the fields.  \nFor instance: https://www.qwant.com/maps/routes/?origin=latlon:48.8459543:2.3714015&destination=latlon:48.8702200:2.27863300&mode[]=walking#map=18.00/48.8459543/2.3714015\n\nThe parameters corresponding to this endpoint are the following:\n\n| Name | Required| Description |\n| -------- | :--------: | -------- |\n| origin    |   :x:   | `id` of some place to use as the starting point     |\n| destination    |   :x:   | `id` of some place to use as the ending point  |\n| mode   |   :x:   | if you want to pre-select a routing mode in the routing form. One of `walking`, `cycling`, `driving`, `public_transport`\n\n## Architecture\n\nQwant Maps can be seen as 4 separated components:\n\n* a tile server,\n* a search engine (geocoder),\n* an API to detail points of interest and places,\n* a front end.\n\n![global architecture](images/maps_archi.jpg)\n\nNB: To provide the Qwant Maps service, Qwant hosts instances of the tile server, the geocoder and the Idunn API on its own servers.\n\nPlease note that Qwant instances are internal components and are not meant (yet) to be used directly other than as part of Qwant Maps. You can learn more in our [Terms of services](https://about.qwant.com/fr/legal/cgu/qwant-maps/)\n\n#### Tile server\n\nA tile server is a service whose job is to give all that is needed to display a fraction of a map.\n\nQwant Maps provides only [vector tiles](https://en.wikipedia.org/wiki/Vector_tiles) so the tile server does not serve images (as it is done with [raster tiles](https://switch2osm.org/the-basics/)) but raw data. It is the front end, [Erdapfel](#erdapfel), that takes the data and renders it into a user browsable map.\n\nThe tile server is a combination of 2 great opensource projects:\n\n* [Planetiler](https://github.com/onthegomap/planetiler), a flexible tool to build planet-scale vector tilesets from OpenStreetMap data fast without database\n* [OpenMapTiles](https://github.com/openmaptiles/openmaptiles), for their great and flexible tile schema.\n\nOpenMapTiles makes it possible for Qwant Maps to have an [easy to define/extend](https://github.com/Qwant/openmaptiles) vector tile schema.\n\n#### Geocoder\n\nThe geographical search engine (also called geocoder) used for Qwant Maps is [Bragi](https://github.com/CanalTP/mimirsbrunn).\n\nBragi is a geocoder based on [Elasticsearch](https://www.elastic.co) and rust components developed by [Kisio Digital](http://www.kisiodigital.com/).\n\n#### Places API\n\nTo get more details on places and Points Of Interest (POIs), Qwant Maps uses an additional API: [Idunn](https://github.com/Qwant/idunn), that combines the information in the geocoder with external APIs to format detailed POIs data to display in the front end.\n\n#### Front end <a name=\"erdapfel\"></a>\n\nQwant Maps's front, [Erdapfel](https://github.com/Qwant/erdapfel), is a Javascript single page app that allows to browse the map, search for places, see your position on the map, etc.\n\nThe front end uses [Mapbox GL](https://www.mapbox.com/mapbox-gl-js/api/) to render the map, using both the tiles from the tile server, and Qwant Maps [custom map style](https://github.com/Qwant/qwant-basic-gl-style).\n\n## Data\n\n#### Tiles data <a name=\"tilesdata\"></a>\n\nThe main source of data for the tile server is the awesome [OpenStreetMap](https://www.openstreetmap.org) (OSM) data :heart: but other data like [natural earth](http://www.naturalearthdata.com/), better water polygon... are also used.\n\nTo run the tileserver, we utilize a custom version of [Openmaptiles](https://github.com/openmaptiles/openmaptiles) adapt to work with [Planetiler](https://github.com/onthegomap/planetiler): we have a fork project of [Planetiler Openmaptiles](https://github.com/openmaptiles/planetiler-openmaptiles).\n\nThis configuration leverages the  [PMtiles format](https://github.com/protomaps/PMTiles), served by [Martin](https://github.com/maplibre/martin)\n\n#### Geocoder data <a name=\"geocoder_data\"><a/>\n\nThe data import process in [Mimirsbrunn](https://github.com/CanalTP/mimirsbrunn) is defined in a [python script](https://github.com/Qwant/docker_mimir/blob/master/tasks.py).\n\nFirst, the OSM data is given to [Cosmogony](https://github.com/osm-without-borders/cosmogony) which outputs a big JSON file with all the world's administrative regions.\n\nThis file is then imported in Mimir by [cosmogony2mimir](https://github.com/CanalTP/mimirsbrunn#cosmogony2mimir).\n\nWe then import addresses using [addresses-importer](https://github.com/Qwant/addresses-importer). It downloads datasets of addresses (from [OpenAddresses](http://openaddresses.io/) and [OpenStreetMap](https://www.openstreetmap.org) mostly), deduplicate them and then import them into our geocoder using [openaddresses2mimir](https://github.com/CanalTP/mimirsbrunn#openaddresses2mimir).\n\nThe streets are imported afterwards, from the OSM pbf file with [osm2mimir](https://github.com/CanalTP/mimirsbrunn#osm2mimir).\n\nFinally, the POIs are extracted from the PostgreSQL database created thanks to [imposm](https://github.com/omniscale/imposm3) using [Fafnir](https://github.com/Qwant/fafnir).\n\n#### Places API data\n\nIdunn does not need its own data import process, but the API depends on:\n\n* the data of the [geocoder](#geocoder_data),\n* Wikipedia data, fetched either on the Wikipedia APIs or in a custom Elasticsearch database.\n\n##### OSM updates <a name=\"osm_updates\"></a>\n\nThe world keeps moving and OpenStreetMap data is getting better and better every day, so we need to update the data in all our components on a regular basis.\nWe update the tiles entirely on weekly basis from [OSM planet pbf](https://registry.opendata.aws/osm/)\n\nIn the same time we have to up-to-date data in PostgreSQL, we can import again the geocoder POIs data with  the current version of the tiles.\n\nWe update the remaining geocoder data (administrative regions, streets and addresses) on a monthly basis.\n\n## How to run\n\nQwant maps use to be fully Opensource but migrate to internal repository. Our idea is to keep update version on Github.\n"
  }
]