Skip to content

Commit

Permalink
Version 5.0.0
Browse files Browse the repository at this point in the history
Updated installation of Kosmtik
Updated with the latest openstreetmap-carto version
  • Loading branch information
Ircama committed Feb 21, 2021
1 parent 3918d67 commit e8d091f
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 121 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ This chapter summarizes all the steps to locally deploy and test this [jekill](h
gem install jekyll bundler
```

- Update the bundler version in Gemfile.lock. (Gemfile.lock is removed, so that Bundler will fetch all remote sources, resolve dependencies and install all needed gems.)
- Update the bundler version in Gemfile.lock. (Gemfile.lock is removed, so that Bundler will fetch all remote sources, resolve dependencies and install all needed gems. In general, this also fixes Dependabot security updates on vulnerabilities.)

```shell
cd ~/Documents/GitHub/osm-carto-tutorials
Expand Down
37 changes: 32 additions & 5 deletions pages/20_kosmtik-ubuntu-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ The following subfolders will be created:

## Install Kosmtik

```shell
sudo npm install -g kosmtik
```

Go to [next installation steps](#end-of-kosmtik-installation).

### Install Kosmtik from its GitHub repository

As alternative installation method, install Kosmtik from its GitHub repository:

```shell
mkdir -p ~/src ; cd ~/src
git clone https://github.com/kosmtik/kosmtik.git
Expand All @@ -49,7 +59,7 @@ In case the installation fails, this is possibly due to some incompatibility wit

Read [Kosmtik Install or Update](https://github.com/kosmtik/kosmtik#install-or-update) for further information.

## Test Kosmtik
### Test Kosmtik

```shell
cd ~/src/kosmtik
Expand All @@ -60,6 +70,10 @@ See [Start Kosmtik](#start-kosmtik).

{% include_relative _includes/test-app.md cdprogram='~/src' %}

### End of Kosmtik installation

Continue with next steps.

{% include_relative _includes/inst-osm-carto.md cdprogram='~/src' %}

{% include_relative _includes/configuration-variables.md os='Ubuntu' %}
Expand All @@ -68,7 +82,8 @@ See [Start Kosmtik](#start-kosmtik).

Using your favourite editor, create a file named *localconfig.json* in the *openstreetmap-carto* directory, including the following:

```
```json
cat > localconfig.json <<\eof
[
{
"where": "center",
Expand All @@ -87,19 +102,20 @@ Using your favourite editor, create a file named *localconfig.json* in the *open
}
}
]
eof
```

Notice the datasource parameters, including user and password, that you might need to change.

Replace coordinates and zoom with your preferred ones within the following line:

```
```json
"then": [9.111, 45.111, 15]
```

For instance, for Liechtenstein you would use:

```
```json
"then": [9.5634, 47.1237, 15]
```

Expand All @@ -115,8 +131,18 @@ Openstreetmap-carto suggests [installing some Kosmtik plugins](https://github.co

Case of local installation:

## Install Kosmtik plugins

```shell
cd ~/src/kosmtik && ./index.js plugins --install kosmtik-overpass-layer --install kosmtik-fetch-remote --install kosmtik-overlay --install kosmtik-open-in-josm --install kosmtik-map-compare --install kosmtik-osm-data-overlay --install kosmtik-mapnik-reference --install kosmtik-geojson-overlay
cd ~/src/kosmtik
./index.js plugins --install kosmtik-overpass-layer
./index.js plugins --install kosmtik-fetch-remote
./index.js plugins --install kosmtik-overlay
./index.js plugins --install kosmtik-open-in-josm
./index.js plugins --install kosmtik-map-compare
./index.js plugins --install kosmtik-osm-data-overlay
./index.js plugins --install kosmtik-mapnik-reference
./index.js plugins --install kosmtik-geojson-overlay
cd ~/src
```

Expand Down Expand Up @@ -166,3 +192,4 @@ To cosmetically remove these warinings, install the [Old unifont Medium font](#o
Accessing the database and rendering images is often a slow process (mainly depending on the amount of data to be managed, but also on the server performance and on the network), so give many seconds to Kosmtik to output or refresh the map.

{% include_relative _includes/edit-the-stylesheets.md editor='*vi*' program='Kosmtik' %}

2 changes: 1 addition & 1 deletion pages/_includes/grant.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Create PostgreSQL user "*{{ pg_login }}*" (if not yet existing) and grant rights to all *gis* db tables for "*{{ pg_login }}*" user and for all logged users:

```shell
wget https://raw.githubusercontent.com/openstreetmap/osm2pgsql/master/install-postgis-osm-user.sh
wget https://raw.githubusercontent.com/openstreetmap/osm2pgsql/1.2.2/install-postgis-osm-user.sh
chmod a+x ./install-postgis-osm-user.sh
sudo ./install-postgis-osm-user.sh gis {{ pg_login }}
```
46 changes: 23 additions & 23 deletions pages/_includes/inst-osm-carto.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

Check that [Python](https://www.python.org/) is installed:

python -V
python3 -V
```shell
sudo apt-get install -y python3 python3-distutils

Otherwise Python needs to be installed.
# Verify Python installation:
python -V
python3 -V
```

## Install Yaml and Package Manager for Python

Expand All @@ -15,20 +18,25 @@ This is necessary in order to run OpenStreetMap-Carto scripts/indexes.
sudo apt-get install -y python-yaml

pip -V # to verify whether pip is already installed
sudo apt-get install -y python-pip
sudo apt-get install -y python3-pip
python3 -m pip install --upgrade pip
```

## Install Mapnik Utilities

The *Mapnik Utilities* package includes shapeindex.

sudo apt-get install -y mapnik-utils
```shell
sudo apt-get install -y mapnik-utils
```

## Install *openstreetmap-carto*

cd {{ include.cdprogram }}
git clone https://github.com/gravitystorm/openstreetmap-carto.git
cd openstreetmap-carto
```shell
cd {{ include.cdprogram }}
git clone https://github.com/gravitystorm/openstreetmap-carto.git
cd openstreetmap-carto
```

Read [installation notes](https://github.com/gravitystorm/openstreetmap-carto/blob/master/INSTALL.md) for further information.

Expand All @@ -38,7 +46,9 @@ Currently Noto fonts are used.

To install them (except Noto Emoji Regular and Noto Sans Arabic UI Regular/Bold):

sudo apt-get install -y fonts-noto-cjk fonts-noto-hinted fonts-noto-unhinted fonts-hanazono ttf-unifont
```shell
sudo apt-get install -y fonts-noto-cjk fonts-noto-hinted fonts-noto-unhinted fonts-hanazono ttf-unifont
```

Installation of Noto fonts (hinted ones should be used if available[^71]):

Expand Down Expand Up @@ -71,7 +81,9 @@ fc-list | grep Emoji

DejaVu Sans is used as an optional fallback font for systems without Noto Sans. If all the Noto fonts are installed, it should never be used.

sudo apt-get install -y fonts-dejavu-core
```shell
sudo apt-get install -y fonts-dejavu-core
```

Read [font notes](https://github.com/gravitystorm/openstreetmap-carto/blob/master/INSTALL.md#fonts) for further information.

Expand All @@ -96,17 +108,5 @@ fc-list | grep -i unifont # both uppercase and lowercase fonts will be listed

Notice that above installation operation is useless, just removes the warning.

## Create the *data* folder

```shell
cd {{ include.cdprogram }}
cd openstreetmap-carto
scripts/get-shapefiles.py
```

The actual shapefiles loaded by the OpenStreetMap tile servers are reported in the related [Chef configuration](https://github.com/openstreetmap/chef/blob/master/roles/tile.rb#L65-L89).

Read [scripted download](https://github.com/gravitystorm/openstreetmap-carto/blob/master/INSTALL.md#scripted-download) for further information.

[^71]: [pnorman comment on hinted fonts](https://github.com/gravitystorm/openstreetmap-carto/issues/2402#issuecomment-252496456)
[^72]: [Is lowercase "unifont" needed?](https://github.com/gravitystorm/openstreetmap-carto/issues/2924)
[^72]: [Is lowercase "unifont" needed?](https://github.com/gravitystorm/openstreetmap-carto/issues/2924)
34 changes: 20 additions & 14 deletions pages/_includes/install-nodejs.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
## Install Node.js

[Node.js](https://nodejs.org/en/) can be installed via different methods, including:
Install [Node.js](https://nodejs.org/en/) with Ubuntu 20.04 LTS:

- [NodeSource Node.js Binary Distributions](https://github.com/nodesource/distributions)
```shell
# Check installations:
node -v
nodejs -v
npm -v

# If components needs to be installed, run the following:
sudo apt install -y nodejs npm
```

Go to [Check Node.js versions](#check-nodejs-versions).

Additional notes on Node.js: other modes to install it:

- [NodeSource Node.js Binary Distributions](https://github.com/nodesource/distributions). Check related [installation instructions](https://github.com/nodesource/distributions#installation-instructions).
- Standard mode with Ubuntu's Advanced Packaging Tool (APT)
- Version management tools, like:
- [n](https://github.com/tj/n) (Interactively Manage Your Node.js Versions)
- [nvm](https://github.com/creationix/nvm) (Node Version Manager)

A [list of useful commands](../nodejs-commands){:target="_blank"} to manage *Node.js* is available at a specific page.

### Installation procedure suggested by openstreetmap-carto

For running Kosmtik, Openstreetmap-carto currently suggests [installing Node.js v6.x](https://github.com/gravitystorm/openstreetmap-carto/blob/master/Dockerfile#L11-L12) from NodeSource Node.js Binary Distributions, basing on related [installation instructions](https://github.com/nodesource/distributions#installation-instructions):

```shell
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - && sudo apt-get install -y nodejs
node -v
nodejs -v
npm -v
```

The above reported Node.js version also supports installing TileMill and Carto.

### Distro version from the APT package manager
Expand Down Expand Up @@ -77,9 +80,12 @@ sudo n lts
```
{% endif %}

To get the installed version number:
### Check Node.js versions

To get the installed version numbers:

```shell
node -v
npm -v
```

Loading

0 comments on commit e8d091f

Please sign in to comment.