Manually Building Your Own Tile Server with OSM

Total Page:16

File Type:pdf, Size:1020Kb

Manually Building Your Own Tile Server with OSM Manually Building your Own Tile Server With OSM Yogesh K S IT for Change What is a Tile server? Tiles are square map images that are placed together to make a map on the web. A tile server draws (renders) these images from a map database. 3rd party provider vs own tile server What you want?! -- Depends on your requirements 3rd party tiles Own tiles Easier to get started Difficult to set up Lesser control Full control Paid plans Hardware resources Serving your own tiles with OSM Data OpenStreetMap tile server The OSM tile server stack has five main components 1. Mod_tile 2. Renderd 3. Mapnik 4. Osm2pgsql 5. Postgis Building Tile server on Ubuntu GNU/Linux 16.04 Packages to build these components: sudo apt install libboost-all-dev git-core tar unzip wget bzip2 build-essential autoconf libtool libxml2-dev libgeos-dev libgeos++-dev libpq-dev libbz2-dev libproj- dev munin-node munin libprotobuf-c0-dev protobuf-c- compiler libfreetype6-dev libpng12-dev libtiff5-dev libicu-dev libgdal-dev libcairo-dev libcairomm-1.0-dev apache2 apache2-dev libagg-dev liblua5.2-dev ttf- unifont lua5.1 liblua5.1-dev libgeotiff-epsg Installing postgresql/postgis Installed via the Ubuntu package manager sudo apt install postgresql postgresql-contrib postgis postgresql-9.5-postgis-2.2 Setup postgresql/postgis * Create database * Create user * Add extensions – postgis, hstore Install osm2pgsql from source Get the source from github: git clone git://github.com/openstreetmap/osm2pgsql.git Get into osm2pgsql directory: cd osm2pgsql Build and install: mkdir build && cd build cmake .. make sudo make install Mapnik Install Mapnik from Ubuntu package manager sudo apt-get install autoconf apache2-dev libtool libxml2-dev libbz2-dev libgeos-dev libgeos++-dev libproj-dev gdal-bin libgdal1-dev libmapnik-dev mapnik-utils python-mapnik Check mapnik python >>> import mapnik >>> mod_tile and renderd Install mod_tile and renderd from source git clone git://github.com/SomeoneElseOSM/mod_tile.git cd mod_tile ./autogen.sh ./configure make sudo make install sudo make install-mod_tile Stylesheet configuration Stylesheet controls representation of map data in tiles. Standard style on osm.org is “OpenStreetMap Carto” Get it from github: git clone git://github.com/gravitystorm/openstreetmap- carto.git cd openstreetmap-carto sudo apt install npm nodejs-legacy sudo npm install -g carto convert the carto to mapnik: carto project.mml > mapnik.xml Loading Data Get data extracts from Geofabrik mkdir ~/data cd ~/data wget http://download.geofabrik.de/asia/india-latest.osm.pbf Load it database with osm2pgsql osm2pgsql -d gis --create --slim -G --hstore --tag-transform- script ~/openstreetmap-carto/openstreetmap-carto.lua -C 2500 --number-processes 1 -S ~/openstreetmap- carto/openstreetmap-carto.style ~/data/india- latest.osm.pbf Low zoom country boundaries and fonts Use python script within openstreetmap-carto cd ~/openstreetmap-carto/ scripts/get-shapefiles.py Fonts for non-latin, unicode characters sudo apt-get install fonts-noto-cjk fonts-noto-hinted fonts- noto-unhinted ttf-unifont Setting up your webserver Configure renderd sudo nano /usr/local/etc/renderd.conf num_threads=4 XML=/home/renderaccount/src/openstreetmap- carto/mapnik.xml URI=/india/ Run and check for errors renderd -f -c /usr/local/etc/renderd.conf Run in background as “systemd” service sudo systemctl enable renderd Configure Apache Tell Apache about mod_tile here: sudo nano /etc/apache2/conf-available/mod_tile.conf Tell Apache about renderd here: sudo nano /etc/apache2/sites-available/000-default.conf sudo service apache2 reload Viewing tiles See the lowest zoom level tile here: http://yourserveripaddress/india/0/0/0.png Using tiles: * OpenLayers - http://openlayers.org/ * Leaflet - http://leafletjs.com/ Thank you! Photos under CC-BY-SA https://switch2osm.org/ .
Recommended publications
  • Osmand - This Article Describes How to Use Key Feature
    HowToArticles - osmand - This article describes how to use key feature... http://code.google.com/p/osmand/wiki/HowToArticles#First_steps [email protected] | My favorites ▼ | Profile | Sign out osmand Navigation & routing based on Open Street Maps for Android devices Project Home Downloads Wiki Issues Source Search for ‹‹ HowToArticles HowTo Articles This article describes how to use key features How To First steps Featured How To Understand vector en, ru Updated and raster maps How To Download data How To Find on map Introduction How To Filter POI This articles helps you to understand how to use the application, and gives you idea's about how the functionality could be used. How To Customize map view How To How To Arrange layers and overlays How To Manage favorite How To First steps places How To Navigate to point First you can think about which features are most usable and suitable for you. You can use Osmand online and offline for How To Use routing displaying a lot of online maps, pre-downloaded very compact so-called OpenStreetMap "vector" map-files. You can search and How To Use voice routing find adresses, places of interest (POI) and favorites, you can find routes to navigate with car, bike and by foot, you can record, How To Limit internet replay and follow selfcreated or downloaded GPX tracks by foot and bike. You can find Public Transport stops, lines and even usage shortest public transport routes!. You can use very expanded filter options to show and find POI's. You can share your position with friends by mail or SMS text-messages.
    [Show full text]
  • The Uch Enmek Example(Altai Republic,Siberia)
    Faculty of Environmental Sciences Institute for Cartography Master Thesis Concept and Implementation of a Contextualized Navigable 3D Landscape Model: The Uch Enmek Example(Altai Republic,Siberia). Mussab Mohamed Abuelhassan Abdalla Born on: 7th December 1983 in Khartoum Matriculation number: 4118733 Matriculation year: 2014 to achieve the academic degree Master of Science (M.Sc.) Supervisors Dr.Nikolas Prechtel Dr.Sander Münster Submitted on: 18th September 2017 Faculty of Environmental Sciences Institute for Cartography Task for the preparation of a Master Thesis Name: Mussab Mohamed Abuelhassan Abdalla Matriculation number: 4118733 Matriculation year: 2014 Title: Concept and Implementation of a Contextualized Navigable 3D Landscape Model: The Uch Enmek Example(Altai Republic,Siberia). Objectives of work Scope/Previous Results:Virtual Globes can attract and inform websites visitors on natural and cultural objects and sceneries.Geo-centered information transfer is suitable for majority of sites and artifacts. Virtual Globes have been tested with an involvement of TUD institutes: e.g. the GEPAM project (Weller,2013), and an archaeological excavation site in the Altai Mountains ("Uch enmek", c.f. Schmid 2012, Schubert 2014).Virtual Globes technology should be flexible in terms of the desired geo-data configuration. Research data should be controlled by the authors. Modes of linking geo-objects to different types of meta-information seems evenly important for a successful deployment. Motivation: For an archaeological conservation site ("Uch Enmek") effort has already been directed into data collection, model development and an initial web-based presentation.The present "Open Web Globe" technology is not developed any further, what calls for a migra- tion into a different web environment.
    [Show full text]
  • Development of a Web Mapping Application Using Open Source
    Centre National de l’énergie des sciences et techniques nucléaires (CNESTEN-Morocco) Implementation of information system to respond to a nuclear emergency affecting agriculture and food products - Case of Morocco Anis Zouagui1, A. Laissaoui1, M. Benmansour1, H. Hajji2, M. Zaryah1, H. Ghazlane1, F.Z. Cherkaoui3, M. Bounsir3, M.H. Lamarani3, T. El Khoukhi1, N. Amechmachi1, A. Benkdad1 1 Centre National de l’Énergie, des Sciences et des Techniques Nucléaires (CNESTEN), Morocco ; [email protected], 2 Institut Agronomique et Vétérinaire Hassan II (IAV), Morocco, 3 Office Régional de la Mise en Valeur Agricole du Gharb (ORMVAG), Morocco. INTERNATIONAL EXPERTS’ MEETING ON ASSESSMENT AND PROGNOSIS IN RESPONSE TO A NUCLEAR OR RADIOLOGICAL EMERGENCY (CN-256) IAEA Headquarters Vienna, Austria 20–24 April 2015 Context In nuclear disaster affecting agriculture, there is a need for rapid, reliable and practical tools and techniques to assess any release of radioactivity The research of hazards illustrates how geographic information is being integrated into solutions and the important role the Web now plays in communication and disseminating information to the public for mitigation, management, and recovery from a disaster. 2 Context Basically GIS is used to provide user with spatial information. In the case of the traditional GIS, these types of information are within the system or group of systems. Hence, this disadvantage of traditional GIS led to develop a solution of integrating GIS and Internet, which is called Web-GIS. 3 Project Goal CRP1.50.15: “ Response to Nuclear Emergency affecting Food and Agriculture” The specific objective of our contribution is to design a prototype of web based mapping application that should be able to: 1.
    [Show full text]
  • Das Handbuch Zu Marble
    Das Handbuch zu Marble Torsten Rahn Dennis Nienhüser Deutsche Übersetzung: Stephan Johach Das Handbuch zu Marble 2 Inhaltsverzeichnis 1 Einleitung 6 2 Marble Schnelleinstieg: Navigation7 3 Das Auswählen verschiedener Kartenansichten für Marble9 4 Orte suchen mit Marble 11 5 Routenplanung mit Marble 13 5.1 Eine neue Route erstellen . 13 5.2 Routenprofile . 14 5.3 Routen anpassen . 16 5.4 Routen laden, speichern und exportieren . 17 6 Entfernungsmessung mit Marble 19 7 Kartenregionen herunterladen 20 8 Aufnahme eines Films mit Marble 23 8.1 Aufnahme eines Films mit Marble . 23 8.1.1 Problembeseitigung . 24 9 Befehlsreferenz 25 9.1 Menüs und Kurzbefehle . 25 9.1.1 Das Menü Datei . 25 9.1.2 Das Menü Bearbeiten . 26 9.1.3 Das Menü Ansicht . 26 9.1.4 Das Menü Einstellungen . 27 9.1.5 Das Menü Hilfe . 28 10 Einrichtung von Marble 29 10.1 Einrichtung der Ansicht . 29 10.2 Einrichtung der Navigation . 30 10.3 Einrichtung von Zwischenspeicher & Proxy . 31 10.4 Einrichtung von Datum & Zeit . 32 10.5 Einrichtung des Abgleichs . 32 10.6 Einrichtungsdialog „Routenplaner“ . 34 10.7 Einrichtung der Module . 34 Das Handbuch zu Marble 11 Fragen und Antworten 38 12 Danksagungen und Lizenz 39 4 Zusammenfassung Marble ist ein geografischer Atlas und ein virtueller Globus, mit dem Sie ganz leicht Or- te auf Ihrem Planeten erkunden können. Sie können Marble dazu benutzen einen Adressen zu finden, auf einfache Art Karten zu erstellen, Entfernungen zu messen und Informationen über bestimmte Orte abzufragen, über die Sie gerade etwas in den Nachrichten gehört oder im Internet gelesen haben.
    [Show full text]
  • OSM Datenformate Für (Consumer-)Anwendungen
    OSM Datenformate für (Consumer-)Anwendungen Der Weg zu verlustfreien Vektor-Tiles FOSSGIS 2017 – Passau – 23.3.2017 - Dr. Arndt Brenschede - Was für Anwendungen? ● Rendering Karten-Darstellung ● Routing Weg-Berechnung ● Guiding Weg-Führung ● Geocoding Adress-Suche ● reverse Geocoding Adress-Bestimmung ● POI-Search Orte von Interesse … Travelling salesman, Erreichbarkeits-Analyse, Geo-Caching, Map-Matching, Transit-Routing, Indoor-Routing, Verkehrs-Simulation, maxspeed-warning, hazard-warning, Standort-Suche für Pokemons/Windkraft-Anlagen/Drohnen- Notlandeplätze/E-Auto-Ladesäulen... Was für (Consumer-) Software ? s d l e h Mapnik d Basecamp n <Garmin> a OSRM H - S QMapShack P Valhalla G Oruxmaps c:geo Route Converter Nominatim Locus Map s Cruiser (Overpass) p OsmAnd p A Maps.me ( Mapsforge- - e Cruiser Tileserver ) n MapFactor o h Navit (BRouter/Local) p t r Maps 3D Pro a Magic Earth m Naviki Desktop S Komoot Anwendungen Backend / Server Was für (Consumer-) Software ? s d l e h Mapnik d Garmin Basecamp n <Garmin> a OSRM H “.IMG“ - S QMapShack P Valhalla Mkgmap G Oruxmaps c:geo Route Converter Nominatim Locus Map s Cruiser (Overpass) p OsmAnd p A Maps.me ( Mapsforge- - e Cruiser Tileserver ) n MapFactor o h Navit (BRouter/Local) p t r Maps 3D Pro a Magic Earth m Naviki Desktop S Komoot Anwendungen Backend / Server Was für (Consumer-) Software ? s d l e h Mapnik d Basecamp n <Garmin> a OSRM H - S QMapShack P Valhalla G Oruxmaps Route Converter Nominatim c:geo Maps- Locus Map s Forge Cruiser (Overpass) p Cruiser p A OsmAnd „.MAP“ ( Mapsforge-
    [Show full text]
  • Project „Multilingual Maps“ Design Documentation
    Project „Multilingual Maps“ Design Documentation Copyright 2012 by Jochen Topf <[email protected]> and Tim Alder < kolossos@ toolserver.org > This document is available under a Creative Commons Attribution ShareAlike License (CC-BY-SA). http://creativecommons.org/licenses/by-sa/3.0/ Table of Contents 1 Introduction.............................................................................................................................................................2 2 Background and Design Choices........................................................................................................................2 2.1 Scaling..............................................................................................................................................................2 2.2 Optimizing for the Common Case.............................................................................................................2 2.3 Pre-rendered Tiles.........................................................................................................................................2 2.4 Delivering Base and Overlay Tiles Together or Separately..................................................................3 2.5 Choosing a Language....................................................................................................................................3 2.6 Rendering Labels on Demand.....................................................................................................................4 2.7 Language Decision
    [Show full text]
  • The State of Open Source GIS
    The State of Open Source GIS Prepared By: Paul Ramsey, Director Refractions Research Inc. Suite 300 – 1207 Douglas Street Victoria, BC, V8W-2E7 [email protected] Phone: (250) 383-3022 Fax: (250) 383-2140 Last Revised: September 15, 2007 TABLE OF CONTENTS 1 SUMMARY ...................................................................................................4 1.1 OPEN SOURCE ........................................................................................... 4 1.2 OPEN SOURCE GIS.................................................................................... 6 2 IMPLEMENTATION LANGUAGES ........................................................7 2.1 SURVEY OF ‘C’ PROJECTS ......................................................................... 8 2.1.1 Shared Libraries ............................................................................... 9 2.1.1.1 GDAL/OGR ...................................................................................9 2.1.1.2 Proj4 .............................................................................................11 2.1.1.3 GEOS ...........................................................................................13 2.1.1.4 Mapnik .........................................................................................14 2.1.1.5 FDO..............................................................................................15 2.1.2 Applications .................................................................................... 16 2.1.2.1 MapGuide Open Source...............................................................16
    [Show full text]
  • Web Map Tile Services Tiny Tile Server Bachelor Thesis
    Web Map Tile Services Tiny Tile Server Bachelor Thesis Department of Computer Science University of Applied Science Rapperswil Spring Term 2013 Author: Carmen Campos Bordons Advisor: Prof. Stefan Keller, HSR Project Partner: Klokan Technologies, Baar External Co-Examiner: Claude Eisenhut, Burgdorf Internal Co-Examiner: Prof. Dr. Andreas Rinkel, HSR Abstract Tiny Tile Server is a Python server that permits the user to display local MBTiles maps on the internet. It extracts the data from the SQLite database where the map information is stored in tables containing all the tiles, UTFGrid and metadata. The tiles are the map images, smaller than the screen for better performance. The UTFGrid is some extra information related with points in the map that appears in an infobox when the user interact with these points. The metadata is the information about the map: name, description, bounds, legend, center, minzoom, maxzoom. Tiny Tile Server shows the tiles composing the map on a website and the UTFGrid data on top of the tiles. It can also be used to show the getCapabilities information from Web Map Tile Service in XML format extracted by the metadata table. Tiny Tile Server supports two protocols to access the tiles: direct access with XYZ tile request to tiles in a directory or to MBTiles database; or Web Map Tile Service from a MBTiles database. The server is a part in a website whose purpose is to show how it works and provide templates for the user who wants to employ it, so he will not need to have programming knowledge in order to use Tiny Tile Server, just to follow a simple installation tutorial.
    [Show full text]
  • L6-Geospatial Technologies and Web Applications-Mr.Arulraj NRSC
    GeoSpatial Technologies and Web Applications M. Arulraj Sci/Engr – SF Manager, Bhuvan Web Services Development [email protected] GIS Activities in Problem Solving Environment Empowering Human Take to Activities Action Plan Complex Data Modeling Analyze Interactive Mapping Integration Measure Observe Visualization Modeling . Application of this science is multi-disciplinary Major Components of GIS and Role of open source s/w Data Creations Vector, Raster & attribute Data organizations & Management Complete GIS Data query, processing, Solutions analysis and modeling Data presentations and visualizations OpenLayers Data sharing and disseminations Tools and technologies • Quantum GIS • Open Jump • SAGA, MapWindow GIS • OpenLayer API Desktop GIS • Mapfish, • Geoeditor, • GRASS Geoweb Remote • Geexplorer • OSIM 2.0 Sensing • SAGA • Geonetwork Catalogue Statistical Server • R Geo-spatial DomainGn Geo- GPS • Gpsbabel RDBMS • POSTGIS+ POSTGRESQL • Gpsdrive • TerrLib GIS s/w GIS Servers developme nt • GDAL/OGR • Osgeo MapServer • Geotool • Geoserver • OpenLayer API What is open source? Open source software is software where the source code is made available under a license that allows the modification, and re-distribution of the software at will. The distribution terms of open-source software must comply with the following criteria: Free redistribution; Source code; Derived works; Integrity of the author's source code; No discrimination against persons or groups; No discrimination against fields of endeavor; Distribution of license; License must not be specific to a product; License must not restrict other software; License must be technology-neutral. What is open source? 1. Free Redistribution The license shall not restrict any party from selling or giving away the software as a component of an aggregate software distribution containing programs from several different sources.
    [Show full text]
  • Geographical Information System in Web Applica- Tion
    Zhipeng Jiang GEOGRAPHICAL INFORMATION SYSTEM IN WEB APPLICA- TION Developing Web Application to Serve Spatial Data to Users Thesis CENTRIA UNIVERSITY OF APPLIED SCIENCES Information Technology January 2020 ABSTRACT Centria University Date Author of Applied Sciences January 2020 Zhipeng Jiang Degree programme Information Technology Name of thesis GEOGRAPHICAL INFORMATION SYSTEM IN WEB APPLICATION. Developing Web Applica- tion to serve spatial data to users Instructor Pages Jari Isohanni 29 + 7 Supervisor Jari Isohanni This study is aimed to give a basic understanding of web GIS from a technological point of view. Also, how the approach is useable for other technologies. The technologies including JavaScript API for Google Maps and ArcGIS were tested with demonstration. Additionally, the open-sourced solu- tions are discussed with the self-hosted server, PostgreSQL database. And with Openlayers as the front-end JavaScript library to present the geospatial data. During the study, in the Google Maps API demonstration, the GeoJson data is made by geojson.io and attitude data of the spatial data is called with the API method, to create popup windows for each city area. Another layer that represents specific location for the school, park, and hospital at Kokkola area is marked out with Google Maps API marker and it is overlaid, on top of that city area layer. The same spatial data and its related attribute data are implemented once more with ArcGIS JavaScript API to find out what is the difference between these two technologies. The result is that the Google Maps JavaScript API does not need to have a popup template to have the popup functionality working, instead of popup template, in the Google Maps JavaScript API, the click event listener is created to handle the popup event.
    [Show full text]
  • Android Map Application
    IT 12 032 Examensarbete 15 hp Juni 2012 Android Map Application Staffan Rodgren Institutionen för informationsteknologi Department of Information Technology Abstract Android Map Application Staffan Rodgren Teknisk- naturvetenskaplig fakultet UTH-enheten Nowadays people use maps everyday in many situations. Maps are available and free. What was expensive and required the user to get a paper copy in a shop is now Besöksadress: available on any Smartphone. Not only maps but location-related information visible Ångströmlaboratoriet Lägerhyddsvägen 1 on the maps is an obvious feature. This work is an application of opportunistic Hus 4, Plan 0 networking for the spreading of maps and location-related data in an ad-hoc, distributed fashion. The system can also add user-created information to the map in Postadress: form of points of interest. The result is a best effort service for spreading of maps and Box 536 751 21 Uppsala points of interest. The exchange of local maps and location-related user data is done on the basis of the user position. In particular, each user receives the portion of the Telefon: map containing his/her surroundings along with other information in form of points of 018 – 471 30 03 interest. Telefax: 018 – 471 30 00 Hemsida: http://www.teknat.uu.se/student Handledare: Liam McNamara Ämnesgranskare: Christian Rohner Examinator: Olle Gällmo IT 12 032 Tryckt av: Reprocentralen ITC Contents 1 Introduction 7 1.1 The problem . .7 1.2 The aim of this work . .8 1.3 Possible solutions . .9 1.4 Approach . .9 2 Related Work 11 2.1 Maps . 11 2.2 Network and location .
    [Show full text]
  • Comparison of Tile Server Design Approaches for 3-D Geo-Visualization
    COMPARISON OF TILE SERVER DESIGN APPROACHES FOR 3-D GEO-VISUALIZATION Tao Wanga, Jianhua Gongb aState Key Laboratory of Remote Sensing Science ,Institute of remote sensing applications chinese academy of sciences - [email protected] bState Key Laboratory of Remote Sensing Science ,Institute of remote sensing applications chinese academy of sciences - [email protected] Commission VI, WG VI/4 KEY WORDS: Tile server, Wms, Visualization ABSTRACT: In order to display large-scale maps on the Internet, it is necessary to divide the huge spatial data into small tiles. And servers are needed to support the display across network. There are two kinds of tile server. One is tile server, which organizes the pre-rendered tiles on the server. Another one is MapServer, which generates the display tile. In this article, different servers are compared in efficiency. The open source software world wind is used to analyze the capacity of the two kinds of servers, and experiment results show that tile server spent more time than Mapserver, and it is suggested the Mapserver may have been optimized. 1. INTRODUCTION After researching Google Earth Enterprise, which includes Google Earth Fusion, and MapCruncher for Virtual Earth, we’re When displaying large-scale maps on personal and mobile finding out that the ability to serve tiles on demand that are computers, it is necessary to divide the huge spatial data into rendered at the time of the request, and overlay these tiles on a small tiles. There are many important characteristics of the Virtual Earth or Google Maps base map is unique. Google Earth tileset file format.
    [Show full text]