code:work:lvisf:2021:rtp:server
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
code:work:lvisf:2021:rtp:server [2022/02/02 21:32] – [Installing osm2pgsql] david | code:work:lvisf:2021:rtp:server [2022/02/02 22:39] (current) – [Subdivisions] david | ||
---|---|---|---|
Line 453: | Line 453: | ||
< | < | ||
- | sudo apt install autoconf apache2-dev libtool libxml2-dev libbz2-dev libgeos-dev libgeos++-dev libproj-dev gdal-bin libmapnik-dev mapnik-utils python3-mapnik python3-psycopg2 python3-yaml | + | sudo apt -y install autoconf apache2-dev libtool libxml2-dev libbz2-dev libgeos-dev libgeos++-dev libproj-dev gdal-bin libmapnik-dev mapnik-utils python3-mapnik python3-psycopg2 python3-yaml |
</ | </ | ||
Line 467: | Line 467: | ||
- Make and install < | - Make and install < | ||
./configure | ./configure | ||
- | make | + | CPUCOUNT=$(grep -c " |
+ | make -j $CPUCOUNT | ||
sudo make install | sudo make install | ||
sudo make install-mod_tile | sudo make install-mod_tile | ||
Line 481: | Line 482: | ||
</ | </ | ||
- Add some more things < | - Add some more things < | ||
- | sudo apt install npm | + | sudo apt -y install npm |
sudo npm install -g carto | sudo npm install -g carto | ||
carto -v | carto -v | ||
Line 519: | 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:// | * [[https:// | ||
+ | |||
+ | < | ||
+ | time osm2pgsql -d gis --create --slim | ||
+ | time osm2pgsql -d gis --append --slim | ||
+ | </ | ||
Line 530: | Line 536: | ||
===== Shapefile download ===== | ===== Shapefile download ===== | ||
+ | |||
+ | This gets the basic water and land information | ||
< | < | ||
Line 539: | Line 547: | ||
< | < | ||
- | 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 |
</ | </ | ||
Line 574: | Line 582: | ||
sudo nano / | sudo nano / | ||
</ | </ | ||
- | - And add the following line < | + | - And add the following line and then exit out of the editor< |
LoadModule tile_module / | LoadModule tile_module / | ||
</ | </ | ||
Line 626: | Line 634: | ||
</ | </ | ||
- | Try our locally hosted map now! [[http:// | + | ===== Viewing local tiles ===== |
+ | |||
+ | * Good info: [[https:// | ||
+ | * Try our locally hosted map now! [[http:// | ||
+ | |||
+ | - Put this into **leaflet.html** in your html folder <code html> | ||
+ | < | ||
+ | <html lang=" | ||
+ | < | ||
+ | <meta charset=" | ||
+ | <meta name=" | ||
+ | <script src=" | ||
+ | <link rel=" | ||
+ | < | ||
+ | html, body { | ||
+ | height: 100%; | ||
+ | padding: 0; | ||
+ | margin: 0; | ||
+ | } | ||
+ | #map { | ||
+ | /* configure the size of the map */ | ||
+ | width: 100%; | ||
+ | height: 100%; | ||
+ | } | ||
+ | </ | ||
+ | </ | ||
+ | < | ||
+ | <div id=" | ||
+ | < | ||
+ | // initialize Leaflet | ||
+ | var map = L.map(' | ||
+ | |||
+ | // add the OpenStreetMap tiles | ||
+ | L.tileLayer(' | ||
+ | maxZoom: 19, | ||
+ | attribution: | ||
+ | }).addTo(map); | ||
+ | |||
+ | // show the scale bar on the lower left corner | ||
+ | L.control.scale({imperial: | ||
+ | |||
+ | // show a marker on the map | ||
+ | L.marker({lon: | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | - And modify the line that renders the tile layer with this line < | ||
+ | L.tileLayer(' | ||
+ | </ |
code/work/lvisf/2021/rtp/server.1643837520.txt.gz · Last modified: 2022/02/02 21:32 by david