Giter Site home page Giter Site logo

atlasr-org / atlasr Goto Github PK

View Code? Open in Web Editor NEW
225.0 11.0 11.0 1.16 MB

Atlasr is a truly open-source and free map browser.

Home Page: http://atlasr.org/

License: Other

CSS 9.59% HTML 2.41% JavaScript 9.19% Elm 34.05% Rust 44.77%
atlasr map openstreetmap tile routing geocoding rust elm http server client web

atlasr's Introduction

🌍 Atlasr

Atlasr is a truly open-source and free map browser. The goal is threefold:

  1. Learn about all the layers and components that make a map,
  2. Provide a ready-to-use set of tools to build a 100% open-source, free, and standalone map browser,
  3. Provide an alternative service to the famous Google Maps or Apple Maps, with no ads, with respect to user privacy, with 100% open-source and free data, and the top 10 features of Google Maps.

A map architecture is composed of the following components:

  • Map data, A giant database containing all information about roads, trails, cafés, railway stations, buildings etc. The biggest major project is OpenStreetMap,
  • Tile server, A program that, given a specific region, reads the map database and compiles those information in a certain format like .mbtiles for instance. Each region of a planet is named a tile. A tile is defined by a longitude, a latitude, and a zoom (an altitude scale),
  • Map renderer, A program that, given a set of tiles, renders/draws a map, so each roads, buildings etc. finally come alive at this step. A map renderer requires at least the following components:
    • Tile decoder to decode the tiles received from the tile server,
    • Styles to know how to draw the data from the map (e.g. “roads must be blue with a white strike”),
    • Fonts to render texts,
    • Icons to represent some places with an image (like hospitals, police stations, parcs etc.).
  • Geocoding, A program that can find the longitude and the latitude of a labellised element on earth, like a postal address, a building name, or a river name for examples,
  • Routing, A program that is able to find a path/route between one or many points (longitude + latitude) given some constraints (like the vehicule type, the road preference etc.). A route preferably comes with descriptions, like “Turn right in 100m”, “Follow A10 for 7km” etc.

Obviously, each component comes with thousands of details and constraints. The previous list is a high overview of how it works.

Goals

The open-source map ecosystem is mature. Many projects already exist to address one component of the map architecture. However, a mainstream tool that combined all these projects, based on 100% open-source and free data, is still missing. Atlasr aims to be the response to this problem.

The quality must be comparable with Google Maps or Apple Maps:

  • Smooth and fast experience,
  • Reliable data,
  • Beautiful design for the map and the UI.

Roadmap

The main technologies are the following: Rust for the server, Elm for the client, and PostgreSQL/SQLite for the databases.

The actual roadmap is the following:

  • Map data, all data comes from OpenStreetMap,
  • Tile server [source/api/tile/]:
    • Vector tiles are pre-computed by OpenMapTiles, which relies on OpenStreetMap.
    • Format is .mbtiles,
    • Solid and robust tile server.
  • Map renderer [source/map-style]:
    • Use Mapbox GL JS to render the map,
    • Elm ports to Mapbox GL (JavaScript) for the Web UI,
    • Use OSM Liberty for the style, forked to remove the dependencies to external services, and to use only “local” data,
    • Icons/sprites,
    • Fonts.
  • Geocoding [source/api/geocode]:
    • Data are pre-computed by OSM Names, which relies on OpenStreetMap,
    • Transform the data to build an index for the search engine,
    • Custom and fast search engine to query the index, build with Tantivy,
    • Solid and robust server.
  • Routing [source/api/route/]:
    • Delegate all the works to GraphHopper, only use the open-source API. API to use:
      • Routing API,
      • Isochrone API.
  • HTTP server [source/server/]:
    • Fast and robust HTTP server between the client and all the API.
  • Client/Web UI [source/client]:
    • Mobile-first,
    • Smooth and fast,
    • Search one or many positions (geocoding),
    • Search a route (routing),
    • Search a route with constraints,
    • Enhance data with Wikipedia (photos, descriptions, metadata etc.),
    • All links are sharable,
    • More features.

Current focus: The current hard work is to provide all map components as local and standalone instances. Everything has been addressed except the fonts in the map renderer (yet).

Next focus: Replace the top 10 features on Google Maps.

Screenshots

  • Map renderer: The tiles, the style, the icons, everything comes from Atlasr. No external service is used.

    Map

  • Geocoding and Routing: Atlasr is able to geoencode 2 postal addresses, and find a route between the two:

    Geocoding and routing

Usages/Installations

just is required to run all the commands. Run just --list to get an overview of all the commands.

  • Tile server:

    $ # Install API tile server.
    $ just install-api-tile
    
    $ # Run the tile server.
    $ just run-api-tile
  • Geocoding:

    $ # Download the data, install the indexer, and install the search engine.
    $ just install-api-geocode
    
    $ # Run the geocoding server.
    $ just run-api-geocode-searcher
  • Routing:

    $ # Install the geocoding server.
    $ just install-api-route
    
    $ # Run the geocoding server.
    $ just run-api-route
  • Client/Web UI:

    $ # Install the HTTP server for the client.
    $ just install-server
    
    $ # Run the HTTP server for the client.
    $ just run-server
    
    $ # Install the Web UI, its dependencies, and prepare the frontend.
    $ just install-client
    
    $ # Open the client.
    $ just open

Enjoy!

License

The entire project is under the BSD-3-Clause license. Please read the LICENSE file.

atlasr's People

Contributors

hywan avatar yanganto 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  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

atlasr's Issues

Multiple bugs when trying to install server

just install-api-geocode fails

error: failed to select a version for the requirement 'ring = "^0.12.0"'     
  candidate versions found which didn't match: 0.14.6, 0.14.5, 0.14.4, ...
  location searched: crates.io index
required by package 'cookie v0.10.0'
    ... which is depended on by 'actix-web v0.6.10'
    ... which is depended on by 'atlasr-api-geocode-searcher v0.1.0 (/home/superuser/Desktop/just/atlasr/source/api/geocode/searcher)'
error: Recipe 'install-api-geocode-searcher' failed on line 69 with exit code 101

This also means just run-api-geocode-searcher fails


cd source/api/geocode/searcher && cargo run --release
    Updating crates.io index
error: failed to select a version for the requirement 'ring = "^0.12.0"'
  candidate versions found which didn't match: 0.14.6, 0.14.5, 0.14.4, ...
  location searched: crates.io index
required by package 'cookie v0.10.0'
    ... which is depended on by 'actix-web v0.6.10'
    ... which is depended on by 'atlasr-api-geocode-searcher v0.1.0 (/home/superuser/Desktop/just/atlasr/source/api/geocode/searcher)'
error: Recipe 'run-api-geocode-searcher' failed on line 75 with exit code 101`

just run-api-route fails too

[INFO] Changes detected - recompiling the module!
[INFO] Compiling 288 source files to /home/superuser/Desktop/just/atlasr/source/api/route/core/target/classes
[WARNING] Unable to autodetect 'javac' path, using 'javac' from the environment.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] GraphHopper Parent Project ......................... SUCCESS [  2.048 s]
[INFO] GraphHopper Core ................................... FAILURE [ 23.851 s]
[INFO] GraphHopper Reader for OpenStreetMap Data .......... SKIPPED
[INFO] GraphHopper Reader JSON ............................ SKIPPED
[INFO] GraphHopper Tools .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.059 s
[INFO] Finished at: 2019-04-07T12:37:03+01:00
[INFO] Final Memory: 13M/54M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project graphhopper-core: Compilation failure -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :graphhopper-core
error: Recipe `run-api-route` failed on line 87 with exit code 1

However just install-api-route seems to work

Submodule 'source/api/graphhopper' (https://github.com/atlasr-org/graphhopper) registered for path 'source/api/route'
Cloning into '/home/superuser/Desktop/just/atlasr/source/api/route'...
Submodule path 'source/api/route': checked out '73ab179b4f477829b8d1bdd7237cd257a1eb0641'

just install-server, just run-server, just install-api-tile, just run-api-tile work

just install-client doesn't work

/tmp/just.HplcryVxAsp8/install-client-index: 122: /tmp/just.HplcryVxAsp8/install-client-index: [[: not found
cd source/client && elm make src/Main.elm --optimize --output ../../public/static/javascript/application.elm.js
sh: 1: elm: not found
error: Recipe `install-client-application` failed on line 134 with exit code 127

and just open decides to redownload the planet.tsv file although just install-api-geocode did this, so i couldn't let the command continue or it would eat up too much disk space.

Prequesities i Have installed
just binary in atlasr folder (so I use command ./just)
cargo
lua5.3
lua5.3-dev
lsqlite3
lsqlite3-dev
libstd-rust-1.31
libstd-rust-dev
rustc

Operating System: Linux Mint 19 Cinnamon

This is all that shows up at the localhost:

atlasr real

install client index fail

fail to run just install-client-index

sed: can't read s@{MAP-PLACEHOLDER.svg}@%3csvg xmlns='http://www.w3.org/2000/svg' width='1024' height='540' version='1'%3e%3cfilter id='blur'%3e%3cfeGaussianBlur stdDeviation='12' /%3e%3c/filter%3e%3cg filter='url(%23blur)'%3e%3cpath fill='%23e7e4d9' d='M0 0h1024v540H0z'/%3e%3cpath fill='%23a9cff7' d='M162 554l300-340-100 220z'/%3e%3cpath fill='%23b4d0ed' d='M690 126l240-48 128 72z'/%3e%3cpath fill='%23aacded' d='M454 202l308-96H590z'/%3e%3cpath fill='%23cedfc0' d='M702 450L466 126l-128 64z'/%3e%3cpath fill='%23f3e8e0' d='M602-62L-18 602 166-58z'/%3e%3cpath fill='%23dfe1b4' d='M878-62l204 160-208-12z'/%3e%3cpath fill='%23f1e8df' d='M1086 506l-908 96 224-240z'/%3e%3cpath fill='%23b8d3fc' d='M414 298l60-112 92-48z'/%3e%3cpath fill='%23d7e2be' d='M894 302l-80-12 64-228z'/%3e%3cpath fill='%23d3ddb2' d='M6 310l92-32-76-80z'/%3e%3cpath fill='%23f1e9e2' d='M874 130l116 4-4 404z'/%3e%3cpath fill='%23dde1a4' d='M-62 6L66-58-62 286z'/%3e%3cpath fill='%23f2e2b8' d='M458 274l216-140-112 24z'/%3e%3cpath fill='%23a6cef7' d='M262 514l-48-20-108 108z'/%3e%3cpath fill='%23f1e8df' d='M526 178l288 376 16-420z'/%3e%3cpath fill='%23f5e9d9' d='M918 102L690-62 438 98z'/%3e%3cpath fill='%23f1e2b0' d='M782 90L678 74l-100 40z'/%3e%3cpath fill='%23eeddaf' d='M394 230l-40 104 128-164z'/%3e%3cpath fill='%23dbdec2' d='M318 134l132-24 24 120z'/%3e%3cpath fill='%23ebddc0' d='M442 446l-88-140 104 96z'/%3e%3cpath fill='%23f8efec' d='M530 326l-100-20 24 132z'/%3e%3cpath fill='%23e2dab7' d='M830 378v200l32-112z'/%3e%3cpath fill='%23afd0ef' d='M1018 118l-120-12 180 72z'/%3e%3cpath fill='%23ffecda' d='M978 86l80-148 28 236z'/%3e%3cpath fill='%23eee0cb' d='M78 42l48 176 84-108z'/%3e%3cpath fill='%23f6ede5' d='M22 66L90-62 70 266z'/%3e%3cpath fill='%23b9d5f3' d='M514 146l116-32-196 128z'/%3e%3cpath fill='%23eee7e1' d='M86 586L-62 314l444-40z'/%3e%3cpath fill='%23eae0ca' d='M302 566l-132 36 224-212z'/%3e%3cpath fill='%23d4e7c6' d='M690 406l-64 36-112-228z'/%3e%3cpath fill='%23b5d3f1' d='M734 138l12-40 144 16z'/%3e%3cpath fill='%23d4dab5' d='M994 122l-28-96-132-88z'/%3e%3cpath fill='%23e2d7a9' d='M6 178v-60l36-4z'/%3e%3cpath fill='%23eedaa8' d='M298 394l80-92-52 32z'/%3e%3cpath fill='%23f0e9e3' d='M410 246l-88 104-36-172z'/%3e%3cpath fill='%23f6e7c8' d='M1034 174l-68-44-116 8z'/%3e%3cpath fill='%23ead9bd' d='M466 474l156 128 32-48z'/%3e%3cpath fill='%23ede8e2' d='M846 594l228-548-32 520z'/%3e%3cpath fill='%23efd6a5' d='M638 138l12-60 8 76z'/%3e%3cpath fill='%23f5e2c3' d='M302 394l-116 64-72 136z'/%3e%3cpath fill='%23ede7e3' d='M422-62L926 50 654 90z'/%3e%3cpath fill='%23b5d2f4' d='M402 354l44-128-52 68z'/%3e%3cpath fill='%23f6e9d8' d='M454 98l24 64 156-72z'/%3e%3cpath fill='%23f4eeea' d='M774 418L578 602l76-144z'/%3e%3cpath fill='%23feebde' d='M494 210l-36 44 92-64z'/%3e%3cpath fill='%23ded8ba' d='M798 362l4-132 20 56z'/%3e%3cpath fill='%23b89e95' d='M170 138l20-8h-36z'/%3e%3cpath fill='%23e9e1d0' d='M302 378l28-116-116-92z'/%3e%3cpath fill='%23e5d7bf' d='M90 266l40 28 80-16z'/%3e%3cpath fill='%23e6ddba' d='M626 78L490 90l64-32z'/%3e%3cpath fill='%23dedeae' d='M618 142l-24 40-76 24z'/%3e%3cpath fill='%23ffdb8e' d='M498 242l-20-4-20-24z'/%3e%3cpath fill='%23d3e9c2' d='M982 438l20-48v108z'/%3e%3cpath fill='%23e8dfcf' d='M110 514l112-136L22 510z'/%3e%3cpath fill='%23d2c8bf' d='M1018 310l-56-4 44-20z'/%3e%3cpath fill='%23dcd1b0' d='M430 290l36-16-56 72z'/%3e%3cpath fill='%23eeebe6' d='M802 302l20 88 144-100z'/%3e%3cpath fill='%23dee2c7' d='M890 138l12 212-96-216z'/%3e%3cpath fill='%23f2dbaf' d='M126 102l-36-4-52 40z'/%3e%3cpath fill='%23cddab9' d='M802 30l12-92 124 20z'/%3e%3c/g%3e%3c/svg%3e@: No such file or directory
error: Recipe install-client-index failed on line 118 with exit code 2

Indexing fails on planet.tsv

Running the install-api-geocode-data recipe results in an error:

Error: Error(Deserialize { pos: Some(Position { byte: 6844445313, line: 23872188, record: 23872187 }), err: DeserializeError { field: Some(9), kind: ParseFloat(ParseFloatError { kind: Empty }) } })

error: Recipe `install-api-geocode-data` failed on line 55 with exit code 1

Line 23872188 of planet.tsv is the culprit:

$ sed '23872188q;d' planet.tsv
Perrongen		node	2581279162	multiple	city_block	18.0112208	59.2795054				Södertörn		Svealand	Sweden	se	Perrongen, Älvsjö postort, Södertörn, Stockholms län, Svealand, Sweden	18.0112208	59.2795054	18.0112208	59.2795054			

Putting this record into a small TSV file and trying to ingest it with the indexer is a simple reproduction of the problem:

name	alternative_names	osm_type	osm_id	class	type	lon	lat	place_rank	importance	street	city	county	state	country	country_code	display_name	west	south	east	north	wikidata	wikipedia	housenumbers
Perrongen		node	2581279162	multiple	city_block	18.0112208	59.2795054				Södertörn		Svealand	Sweden	se	Perrongen, Älvsjö postort, Södertörn, Stockholms län, Svealand, Sweden	18.0112208	59.2795054	18.0112208	59.2795054			

Comparing this line with those around it, we see it's missing both the importance field, and the place_rank field. Sure enough, if those values are added, the problem no longer occurs.

Presumably the deserialiser is failing when trying to represent these missing fields as floats.

Aside:
Weirdly, looking at the byte offset in the error doesn't point us to the byte where the error occurred, it just points us to the start of the line with missing data:

$ dd if="planet.tsv" ibs=1 skip=6844445313 count=10
Perrongen	10+0 records in
0+1 records out
10 bytes transferred in 0.000062 secs (160701 bytes/sec)

Make a command to install the tile database

When I set up all servers and go to http://127.0.0.1:8889, the browser say that /api/tile/metadata.json is missing. It returns 404 with "error" in the body.

I trace the code and find this error, DatabaseError(__Unknown, "file is not a database"), at line 171in source/api/tile/src/main.rs

How can I fix this issue?
Thanks.

Index corruption

I ran just install-api-geocode-data, which appeared to create the index as expected.

However, on further examination the index is corrupted:

tantivy search -i index -q "search string"
thread 'main' panicked at 'Index corrupted. Failed to open field positions in composite file.', libcore/option.rs:1008:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Installation troubleshoot : Ubuntu pre-requirements

Hi, can we make a list of all the programs required to be installed before the just just command, in Ubuntu?

  • Just : binary has to be download from their releases, and copied to /home/[user]/.local/bin so that "just" can be run from command line.
  • cargo : this needed to be installed, first script errored out for it. sudo apt install cargo
  • now it's stuck here: /usr/bin/ld: cannot find -lsqlite3 . I have sqlite3 installed already, so am stuck.

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.