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:16] – [Build GMT From Source] david | code:work:lvisf:2021:rtp:server [2022/02/02 22:39] (current) – [Subdivisions] david | ||
|---|---|---|---|
| Line 320: | Line 320: | ||
| - Install httpd < | - Install httpd < | ||
| - | sudo apt update | + | sudo apt -y update |
| - | sudo apt install apache2 | + | sudo apt -y install apache2 |
| </ | </ | ||
| - Adjust firewall if necessary (was not necessary (see link above) but this shows apache already through the firewall < | - Adjust firewall if necessary (was not necessary (see link above) but this shows apache already through the firewall < | ||
| Line 337: | Line 337: | ||
| sudo chmod 775 / | sudo chmod 775 / | ||
| sudo chgrp -R lvis / | sudo chgrp -R lvis / | ||
| + | ln -s / | ||
| mkdir / | mkdir / | ||
| </ | </ | ||
| Line 368: | Line 369: | ||
| - Log in to this account | - Log in to this account | ||
| - Install some required software < | - Install some required software < | ||
| - | sudo apt install libboost-all-dev git tar unzip wget bzip2 build-essential autoconf libtool libxml2-dev libgeos-dev libgeos++-dev libpq-dev libbz2-dev libproj-dev munin-node munin protobuf-c-compiler libfreetype6-dev libtiff5-dev libicu-dev libgdal-dev libcairo2-dev libcairomm-1.0-dev apache2 apache2-dev libagg-dev liblua5.2-dev ttf-unifont lua5.1 liblua5.1-0-dev | + | sudo apt -y install libboost-all-dev git tar unzip wget bzip2 build-essential autoconf libtool libxml2-dev libgeos-dev libgeos++-dev libpq-dev libbz2-dev libproj-dev munin-node munin protobuf-c-compiler libfreetype6-dev libtiff5-dev libicu-dev libgdal-dev libcairo2-dev libcairomm-1.0-dev apache2 apache2-dev libagg-dev liblua5.2-dev ttf-unifont lua5.1 liblua5.1-0-dev |
| </ | </ | ||
| Line 374: | Line 375: | ||
| - Install data base packages needed < | - Install data base packages needed < | ||
| - | sudo apt install postgresql postgresql-contrib postgis postgresql-12-postgis-3 postgresql-12-postgis-3-scripts | + | sudo apt -y install postgresql postgresql-contrib postgis postgresql-12-postgis-3 postgresql-12-postgis-3-scripts |
| </ | </ | ||
| - Migrate our database to the other drive as it has way more space | - Migrate our database to the other drive as it has way more space | ||
| Line 429: | Line 430: | ||
| - Create the actual database< | - Create the actual database< | ||
| sudo -u postgres -i | sudo -u postgres -i | ||
| + | createuser renderaccount # answer yes for superuser (although this isn't strictly necessary) | ||
| createdb -E UTF8 -O renderaccount gis | createdb -E UTF8 -O renderaccount gis | ||
| </ | </ | ||
| Line 445: | Line 447: | ||
| < | < | ||
| - | sudo apt install osm2pgsql | + | sudo apt -y install osm2pgsql |
| </ | </ | ||
| Line 451: | 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 465: | 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 479: | 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 517: | 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 528: | Line 536: | ||
| ===== Shapefile download ===== | ===== Shapefile download ===== | ||
| + | |||
| + | This gets the basic water and land information | ||
| < | < | ||
| Line 537: | 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 572: | 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 624: | 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.1643836590.txt.gz · Last modified: by david
