User Tools

Site Tools


code:work:lvisf:2021:rtp:server

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
code:work:lvisf:2021:rtp:server [2022/02/02 21:48] – [Shapefile download] davidcode:work:lvisf:2021:rtp:server [2022/02/02 22:39] (current) – [Subdivisions] david
Line 520: Line 520:
 If you want a smaller **pbf** file which should take less time to ingest, you can grab the subdivisions here: If you want a smaller **pbf** file which should take less time to ingest, you can grab the subdivisions here:
   * [[https://download.geofabrik.de/]]  <- Get smaller PBF files here! :!:   * [[https://download.geofabrik.de/]]  <- Get smaller PBF files here! :!:
 +
 +<code>
 +time osm2pgsql -d gis --create --slim  -G --hstore --tag-transform-script ~/src/openstreetmap-carto/openstreetmap-carto.lua -C 2500 --number-processes 16 -S ~/src/openstreetmap-carto/openstreetmap-carto.style ~/data/greenland-latest.osm.pbf
 +time osm2pgsql -d gis --append --slim  -G --hstore --tag-transform-script ~/src/openstreetmap-carto/openstreetmap-carto.lua -C 2500 --number-processes 16 -S ~/src/openstreetmap-carto/openstreetmap-carto.style ~/data/antarctica-latest.osm.pbf
 +</code>
  
  
Line 542: Line 547:
  
 <code> <code>
-sudo apt install fonts-noto-cjk fonts-noto-hinted fonts-noto-unhinted ttf-unifont+sudo apt -y install fonts-noto-cjk fonts-noto-hinted fonts-noto-unhinted ttf-unifont
 </code> </code>
  
Line 577: Line 582:
 sudo nano /etc/apache2/conf-available/mod_tile.conf sudo nano /etc/apache2/conf-available/mod_tile.conf
 </code> </code>
-    - And add the following line <code>+    - And add the following line and then exit out of the editor<code>
 LoadModule tile_module /usr/lib/apache2/modules/mod_tile.so LoadModule tile_module /usr/lib/apache2/modules/mod_tile.so
 </code> </code>
Line 629: Line 634:
 </code> </code>
  
-Try our locally hosted map now!  [[http://10.4.1.10/rtp_leaflet.html]]+===== Viewing local tiles ===== 
 + 
 +  * Good info: [[https://switch2osm.github.io/using-tiles/getting-started-with-leaflet/]] 
 +  * Try our locally hosted map now!  [[http://10.4.1.10/rtp_leaflet.html]] 
 + 
 +  - Put this into **leaflet.html** in your html folder <code html> 
 +<!DOCTYPE HTML> 
 +<html lang="en"> 
 +  <head> 
 +    <meta charset="utf-8" /> 
 +    <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
 +    <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script> 
 +    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" /> 
 +    <style> 
 +      html, body { 
 +        height: 100%; 
 +        padding: 0; 
 +        margin: 0; 
 +      } 
 +      #map { 
 +        /* configure the size of the map */ 
 +        width: 100%; 
 +        height: 100%; 
 +      } 
 +    </style> 
 +  </head> 
 +  <body> 
 +    <div id="map"></div> 
 +    <script> 
 +      // initialize Leaflet 
 +      var map = L.map('map').setView({lon: 0, lat: 0}, 2); 
 + 
 +      // add the OpenStreetMap tiles 
 +      L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
 +        maxZoom: 19, 
 +        attribution: '&copy; <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>' 
 +      }).addTo(map); 
 + 
 +      // show the scale bar on the lower left corner 
 +      L.control.scale({imperial: true, metric: true}).addTo(map); 
 + 
 +      // show a marker on the map 
 +      L.marker({lon: 0, lat: 0}).bindPopup('The center of the world').addTo(map); 
 +    </script> 
 +  </body> 
 +</html> 
 +</code> 
 +  - And modify the line that renders the tile layer with this line <code> 
 +L.tileLayer('http://localhost/hot/{z}/{x}/{y}.png',
 +</code>
code/work/lvisf/2021/rtp/server.1643838532.txt.gz · Last modified: 2022/02/02 21:48 by david