Git Product home page Git Product logo

osm-tiles-mapnik's Introduction

Building a tile server based on Ubuntu 16.04

How to use

Pre-reqs

Since this project is aiming to be contained within Docker, there isn't much you will need other than Docker, docker-compose, and a system that can run Ubuntu based Dockerfiles.

If you are running Ubuntu, and don't have Docker installed, there is a bash script in the "scripts" directory called "install_docker.sh". Running this with 'sudo' will install both Docker and docker-compose.

Loading the docker-file

This should be quite simple to start with docker-compose, although it may take a while depending on your system at network connection. (Depending on how you have Docker set up, you may need to 'sudo' some of these commands.)

  1. Clone the repository git clone https://github.com/jimmyrocks/osm-tiles-mapnik
  2. Navigate into the repo directory cd osm-tiles-mapnik
  3. Build the docker-compose using the command (This may take a while) docker-compose build
  4. Bring up the docker-compose docker-compose up -d
  5. Run the scripts to load the data into the database and start the tile server bash ./scripts/initialize-server.sh
  6. Navigate your browser to: http://localhost:3000

Changing the map data from the sample data

By default this project uses the US state of Rhode Island, since it is the smallest PBF available within the US. You may want to view different data.

  1. Find a .pbf file available for download, possibly from Geofabrik.
  2. Edit the "tileserver.env" file, change the "SAMPLE_DATASET_URL" variable to the URL for your selected PBF file.
  3. Edit the file at "tileserver/site/index.html", and find the Javascript variables "center" and "zoom". Replace these values with values that are relevant to your PDF file.

Background

This project includes a docker-compose.yml file that pulls together three Dockerfiles:

  1. A base PostGIS:10 image (from mdillon)
  2. A "tools" Dockerfile (based on Ubuntu 16.04) which takes care of the data transformation tasks at set up
  3. A "tileserver" Dockerfile (based on Ubuntu 16.04) which runs Apache and mod_tile.

The guide that was used to create this process can be found on the switch2osm.org website. Many of the steps that are outlined in that guide have been coding into the Dockerfiles (especially in the tileserver Dockerfile). The tools Dockerfile follows closely to the Dockerfile contained in the OpenStreetMap Carto Project. The differences are mostly changes that were made in order to support PostGIS as well.

osm-tiles-mapnik's People

Contributors

jimmyrocks avatar

Watchers

 avatar  avatar

osm-tiles-mapnik's Issues

Fix nodejs & apache

After start following actions are required:

# inside tools
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
apt-get install -y nodejs

# on host
docker-compose exec tools bash /scripts/create_xml.sh

# inside tileserver
a2enmod headers
# optionally enable CORS
service apache2 reload

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.