Name: osm-mirror
Owner: SpatialDev
Description: OSM mirror - full stack
Forked from: makinacorpus/osm-mirror
Created: 2017-05-11 16:43:52.0
Updated: 2017-05-11 16:43:54.0
Pushed: 2017-02-15 22:02:44.0
Homepage: null
Size: 1316
Language: Shell
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Up-to-date OpenStreetMap tile server, with various map styles.
Requirements
Just run the following commands :
curl https://raw.github.com/makinacorpus/osm-mirror/master/install.sh > install.sh
chmod +x install.sh
sudo ./install.sh 2>&1 | tee install.log
That's it ! Access your server URL.
You will be prompted for an extent (xmin,ymin,xmax,ymax). The default one is the city of Albi. Use the OpenStreetMap extent tool for help.
A lot of data will be downloaded (Approx. 1Go).
A planned task will be setup to overwrite the whole database with up-to-date OpenStreetMap data, every month (root crontab).
var map = L.map('map').setView([43.92751, 2.14760], 14);
L.tileLayer('http://SERVER/STYLE/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
attributions: [new ol.Attribution({
html: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
})],
source: new ol.source.XYZ({
url: 'http://SERVER/STYLE/{z}/{y}/{x}.png'
})
})
],
view: new ol.View2D({
center: ol.proj.transform([43.92751, 2.14760], 'EPSG:4326', 'EPSG:3857'),
zoom: 14
})
});
Edit the EXTENT
value in /etc/default/openstreetmap-conf
.
Update the configuration :
sudo ./update-conf.sh
Refresh the data on the new extent :
sudo ./update-data.sh
Generate a raster file on the extent at the specified scale :
./render-raster.sh osm osm-25000
Will render the style osm
into osm-25000.tif
, on the extent stored
in configuration file at the default scale (1:25000).
Extent and scale can be specified as options :
./render-raster.sh osm osm-7000 --scale=7000 --extent=-180 90 180 -90
Create a style with Tilemill, export it as Mapnik XML ( osm2pgsql flavor ).
Post-process the XML file :
<Parameters>
bloc ( Mapnik 2.0 compatibility )/usr/share/mapnik-osm-data/world_boundaries/
Copy the whole folder into styles/
. Name the .xml
file with the same
name as the folder.
Update the configuration :
sudo ./update-conf.sh