Mapbox Tile Seeder : un outil qui remplit, réamorce ou supprime le cache de tuiles Mapbox d'un projet / Mapbox Tile Seeder: an executable that fill, reseed or delete the Mapbox tile cache for a project



Produit concerné / Related product

JMap Server

Versions

7

 

Mapbox Tile Seeder est un script python externe à JMap Server dont le but est de créer, réamorcer ou supprimer en partie ou en tout les tuiles Mapbox d'un projet. 

Le script appelle le endpoint de l'API pour demander chaque tuile pour l'étendue d'un projet. 

Mapbox Tile Seeder fonctionne dans Windows (64), MACOS et Ubuntu (16, 18 et 20).

Guide étape par étape

Paramètres d'entrée

  • URL des services REST de JMap Server.

  • L'ID du projet.

  • Les paramètres de BBOX (--xmin, --xmax, --ymin, --ymax) définissent l'étendue de l’action sur le cache. Ils sont toujours fournis en EPSG:3857.

  • Si la projection du projet est EPSG:3857 et si l'étendue initiale du projet est définie, celle-ci sera utilisée par défaut si les paramètres du BBOX ne sont pas spécifiés.

Input pour Mapbox Tile Seeder

Positional arguments:

  • server host:port

  • project JMap project Id

Optional arguments:

  • -h, --help

show this help message and exit

  • --user

Username (Default='Administrator')

  • --pwd

Password (Default='')

  • --session

Session Id

  • --close

True, close the session. (Default=true)

  • --cache

True, enable caching. (Default=true)

  • --reseed

True, reseed the tiles in the cache. (Default=false)

  • --truncate

True, truncate the tiles in the cache. (Default=false)

  • --xmax

The x max extent (BBOX in EPSG:3857)

  • --xmin

The x min extent (BBOX in EPSG:3857)

  • --ymin

The y max extent (BBOX in EPSG:3857)

  • --ymax

The y min extent (BBOX in EPSG:3857)

  • --min

The min zoom level (>= 0)

  • --max

The max zoom level (<= 21)

  • --json

True, to enable JSON output responses. (Default=false)

  • --output

True, to enable JSON report. (Default=false)

  • --file

The name of the output file with JSON extension (Exemple: output.json)

Processus

L'outil fait les tâches suivantes, schématisées dans le diagramme :

  1.  Se connecte à JMap Server avec :
     Nom d'utilisateur et mot de passe (Utilisateur par défaut : 'administrator' et mot de passe : ' ')
     Ou Session Id

  2. Obtient les informations du projet nécessaires pour la mise en marche du cache.

  3. Calcule le min/max de chaque niveau de zoom à partir du niveau de zoom initial.
    Peut aussi utiliser l'étendue du projet donnée comme argument.  

  4. Démarre la mise en cache, le réensemencement ou la suppression des tuiles dans JMap Server. 

  5. Ferme la session.

Output

Le processus met en cache, réamorce le cache ou le supprime dans JMap Server. 

Des résultats optionnels sont :

  • Fichier rapport en format JSON.

  • Une sortie JSON à la fin du processus.

Exemples

1. Faire le cache d'un Projet (EPSG:3857) des niveaux de zoom 9 à 16 et dont le id du projet est 1 (User: admin/Password: pass1234).

  • LINUX/MacOS: ./MapboxTileSeeder www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16

  • Windows: MapboxTileSeeder.exe www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16

2. Faire le cache d'un Projet (EPSG:32188) des niveaux de zoom 9 à 16 et dont le id du projet est 1 (User: admin/Password: pass1234).

  • LINUX/MacOS: ./MapboxTileSeeder www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346

  • Windows: MapboxTileSeeder.exe www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 1234 

3. Réamorcer un Projet (EPSG:32188) des niveaux de zoom 9 à 16 et dont le id du projet est 1 (User: admin/Password: pass1234).

  • LINUX/MacOS: ./MapboxTileSeeder www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346 --reseed true

  • Windows: MapboxTileSeeder.exe www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346 --reseed true

4. Tronquer un Projet (EPSG:32188) des niveaux de zoom 9 à 16 et dont le id du projet est 1 (User: admin/Password: pass1234).

  • LINUX/MacOS: ./MapboxTileSeeder www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346 --truncate true

  • Windows: MapboxTileSeeder.exe www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346 --truncate true

5. Voir un Projet (EPSG:32188) en mettant en cache l'information seulement pour les niveaux de zoom 9 à 16 et dont le id du projet est 1 (User: admin/Password: pass1234).

  • LINUX/MacOS: ./MapboxTileSeeder www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346 --cache false

  • Windows: MapboxTileSeeder.exe www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346 --cache false

6. Faire le cache d'un Projet (EPSG:3857) des niveaux de zoom 9 à 16 et dont le id du projet est 1 (session id: 1234567789).

  • LINUX/MacOS: ./MapboxTileSeeder www.exemple.com 1 --session 1234567789 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346 

  • Windows: MapboxTileSeeder.exe www.exemple.com 1 --session 1234567789  --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346

 

Télécharger l’outil

Linux (Ubuntu 20.4) : https://downloads.jmaponline.net/TileSeeder/v1.1.0/ubuntu_20.4_LTS/MapboxTileSeeder

MacOS : https://downloads.jmaponline.net/TileSeeder/v1.1.0/macOS/MapboxTileSeeder

Windows : https://downloads.jmaponline.net/TileSeeder/v1.1.0/windows/MapboxTileSeeder.exe


English version

Mapbox Tile Seeder is a python script external to JMap Server that will create, delete or reseed all or for a selected extend the Mapbox tiles from a project.

The script can call the API endpoints in order to request every possible tile for a project extend.

Mapbox Tile Seeder works on Windows (64), MACOS and Ubuntu (16, 18 et 20) environments.

Step-by-step guide

Input parameters

  • URL of JMap Server REST services.

  • Project Id.

  • The BBOX parameters define the extent of the action to perform on the cache. They are always provided in EPSG:3857.

  • If the projection if the project is EPSG:3857, and if the project initial extent is defined, then this extent will be used as default values if the BBOX parameters are not specified.

Input of Mapbox Tile Seeder

Positional arguments:

  • server host:port

  • project JMap project Id

Optional arguments:

  • -h, --help

show this help message and exit

  • --user

Username (Default='Administrator')

  • --pwd

Password (Default='')

  • --session

Session Id

  • --close

True, close the session. (Default=true)

  • --cache

True, enable caching. (Default=true)

  • --reseed

True, reseed the tiles in the cache. (Default=false)

  • --truncate

True, truncate the tiles in the cache. (Default=false)

  • --xmax

The x max extent (BBOX in EPSG:3857)

  • --xmin

The x min extent (BBOX in EPSG:3857)

  • --ymin

The y max extent (BBOX in EPSG:3857)

  • --ymax

The y min extent (BBOX in EPSG:3857)

  • --min

The min zoom level (>= 0)

  • --max

The max zoom level (<= 21)

  • --json

True, to enable JSON output responses. (Default=false)

  • --output

True, to enable JSON report. (Default=false)

  • --file

The name of the output file with JSON extension (Exemple: output.json)

Processus

This script will :

  1.  Connect to JMap Server with:
     Username and Password (Default username: 'administrator' and password: ' ')
     Or Session Id

  2. Get the project information need it for the process of caching

  3. Calculate the min/max for each zoom level from the initial zoom level
    Or use the extend given as argument.

  4. Start caching,reseeding or deleting  the tiles in JMap Server.

  5. Close the session.

Output

The process cache, delete or reseed tiles in JMap Server.

Optional output:

  • Report file in JSON format.

  • JSON output at the end of the process.

Diagram


Exemples

1. Cache a Project (EPSG:3857) from zoom level 9 to 16 and the project id is 1(User: admin/Password: pass1234).

  • LINUX/MacOS: ./MapboxTileSeeder www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16

  • Windows: MapboxTileSeeder.exe www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16

2. Cache a Project (EPSG:32188) from zoom level 9 to 16 and the project id is 1 (User: admin/Password: pass1234).

  • LINUX/MacOS: ./MapboxTileSeeder www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346

  • Windows: MapboxTileSeeder.exe www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 1234

3. Reseed a Project (EPSG:32188) from zoom level 9 to 16 and the project id is 1 (User: admin/Password: pass1234).

  • LINUX/MacOS: ./MapboxTileSeeder www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346 --reseed true

  • Windows: MapboxTileSeeder.exe www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346 --reseed true

4. Truncate a Project (EPSG:32188) from zoom level 9 to 16 and the project id is 1 (User: admin/Password: pass1234).

  • LINUX/MacOS: ./MapboxTileSeeder www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346 --truncate true

  • Windows: MapboxTileSeeder.exe www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346 --truncate true

5. View a Project (EPSG:32188) caching information only from zoom level 9 to 16 and the project id is 1 (User: admin/Password: pass1234).

  • LINUX/MacOS: ./MapboxTileSeeder www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346 --cache false

  • Windows: MapboxTileSeeder.exe www.exemple.com 1 --user admin --pwd pass1234 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346 --cache false

6. Cache a Project (EPSG:3857) from zoom level 9 to 16 and the project id is 1 (session id: 1234567789).

  • LINUX/MacOS: ./MapboxTileSeeder www.exemple.com 1 --session 1234567789 --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346 

  • Windows: MapboxTileSeeder.exe www.exemple.com 1 --session 1234567789  --min 9 --max 16 --xmin 1234 --xmax 1235 --ymin 12345 --ymax 12346

 

Download the tool

Linux (Ubuntu 20.4) : https://downloads.jmaponline.net/TileSeeder/v1.1.0/ubuntu_20.4_LTS/MapboxTileSeeder

MacOS : https://downloads.jmaponline.net/TileSeeder/v1.1.0/macOS/MapboxTileSeeder

Windows : https://downloads.jmaponline.net/TileSeeder/v1.1.0/windows/MapboxTileSeeder.exe