Convert the output of karttapullautin into web mercator tiles
Project description
karttapullautin2tiles
Convert the output of karttapullautin into web mercator tiles.
karttapullautin is a command-line tool that converts LIDAR
data into orienteering maps. Karttapullautin tool generates one png image per LIDAR tile. karttapullautin2tiles (k2t)
addresses the task of merging these tiles and generating a x/y/z web mercator tile directory that is compatible
with many map viewers.
Usage
After a successful karttapullautin run, you typically end up with a out directory containing *.png and
corresponding *.pgw files, e.g.
576_5265.laz_depr.pgw
576_5265.laz_depr.png
576_5265.laz.pgw
576_5265.laz.png
576_5266.laz_depr.pgw
576_5266.laz_depr.png
576_5266.laz.pgw
576_5266.laz.png
Given such a directory, you can generate a web tile directory using
k2t list-tiles --zoom 12 karttapullautin/out | k2t make-tiles karttapullautin/out karttapullautin/tiles
The tool is separated into list-tiles and make-tiles, because it quite naturally allows for parallelization
across multiple processes, or even machines. For instance, you can use GNU parallel to distribute the task
across multiple processes:
k2t list-tiles --zoom 12 karttapullautin/out | \
parallel --pipe -j 6 --block 1 k2t make-tiles karttapullautin/out karttapullautin/tiles
Command reference
The commands allow a certain degree of customization, e.g. specifying the projection used by the LIDAR files (default assumes EPSG:25832)
and the zoom levels you want to generate.
k2t list-tiles
Usage: k2t list-tiles [ARGS] [OPTIONS]
List the tiles that are covered by the karttapullautin output directory at the given zoom
level.
The main purpose of this command is to generate a list of tiles that can be passed (possibly
in chunks) to the make-tiles command.
╭─ Parameters ──────────────────────────────────────────────────────────────────────────────╮
│ * DIR --dir Input directory (karttapullautin output dir) [required] │
│ --proj EPSG string of the projection used [default: EPSG:25832] │
│ --pattern Search pattern for the pgw files [default: *depr*.pgw] │
│ --zoom Zoom level to generate tiles for. When running make-tiles, all │
│ karttapullautin png files for this tile need to fit in memory. [default: │
│ 12] │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
k2t make-tiles
Usage: k2t make-tiles [ARGS] [OPTIONS]
Create a web mercator tiles from karttapullautin output, given a list of tile coordinates.
The list of tiles is typically generated by the list-tiles command. You can split it in
chunks and pass it to multiple instances of make-tiles, e.g. to parallelize (see examples).
The format of the tile list is one json record per row, of the format {"x": 2162, "y": 1432,
"z": 12}. The list of tiles defines the lowest zoom level for which tiles will be generated.
All "child" tiles up to max_zoom will also be generated.
Note that all images required for a tile at min_zoom need to fit in memory. If you have
memory issues, consider setting a higher zoom level.
╭─ Parameters ──────────────────────────────────────────────────────────────────────────────╮
│ * IN-DIR --in-dir Input directory containing karttapullautin output files │
│ [required] │
│ * OUT-DIR --out-dir Output directory for tiles (z/x/y folder structure) [required] │
│ TILE-LIST --tile-list File with tiles to process. If not provided as file, will be │
│ read from stdin. This file is typically generated by k2t │
│ list-tiles. The file must contain one json string per row of │
│ the format {"x": 2162, "y": 1432, "z": 12} │
│ --proj EPSG string of the projection used by input images [default: │
│ EPSG:25832] │
│ --pattern Search pattern for pgw files in the input directory [default: │
│ *depr*.pgw] │
│ --max-zoom Maximum zoom level to generate tiles for [default: 17] │
│ --include-viewer If enabled, include a HTML file to preview the generated tiles │
│ --no-include-viewer [default: True] │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
Installation
You need to have Python 3.10 or newer installed on your system. If you don't have Python installed, we recommend installing uv.
There are several alternative options to install karttapullautin2tiles:
- Install the latest release of
karttapullautin2tilesfrom PyPI:
uv tool install karttapullautin2tiles
# or using pip
pip install karttapullautin2tiles
- Run
k2twithout installation using uv:
uvx --from karttapullautin2tiles k2t
- Install the latest development version:
pip install git+https://github.com/grst/karttapullautin2tiles.git@main
Release notes
See the changelog.
Contact
Please use the issue tracker.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file karttapullautin2tiles-0.1.1.tar.gz.
File metadata
- Download URL: karttapullautin2tiles-0.1.1.tar.gz
- Upload date:
- Size: 3.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d633d2b8bcef4d3d4bb6e0111952a411cb2c08e976b4a116f235b285325fcbb4
|
|
| MD5 |
3ff6293ef65c6cc9da3958c9587ed5a8
|
|
| BLAKE2b-256 |
ca0f9c80e172d3b7178950c2ff649861b80c45608963d5c296407543fe1ddcf0
|
Provenance
The following attestation bundles were made for karttapullautin2tiles-0.1.1.tar.gz:
Publisher:
release.yaml on grst/karttapullautin2tiles
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
karttapullautin2tiles-0.1.1.tar.gz -
Subject digest:
d633d2b8bcef4d3d4bb6e0111952a411cb2c08e976b4a116f235b285325fcbb4 - Sigstore transparency entry: 238781672
- Sigstore integration time:
-
Permalink:
grst/karttapullautin2tiles@366dfc6bb62a33af6190acb0e41b65fba8f1901a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/grst
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@366dfc6bb62a33af6190acb0e41b65fba8f1901a -
Trigger Event:
release
-
Statement type:
File details
Details for the file karttapullautin2tiles-0.1.1-py3-none-any.whl.
File metadata
- Download URL: karttapullautin2tiles-0.1.1-py3-none-any.whl
- Upload date:
- Size: 35.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49227cb5664fb49e30a77b1f8c838b1f7a3997638c78d31d051d913fffbf91e9
|
|
| MD5 |
00cade5d06a4a4933a8c96ca87078d10
|
|
| BLAKE2b-256 |
7bc7a7656711b880420f3814eb641c57ef0ce3969a2a02c0a8a59420e05e6746
|
Provenance
The following attestation bundles were made for karttapullautin2tiles-0.1.1-py3-none-any.whl:
Publisher:
release.yaml on grst/karttapullautin2tiles
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
karttapullautin2tiles-0.1.1-py3-none-any.whl -
Subject digest:
49227cb5664fb49e30a77b1f8c838b1f7a3997638c78d31d051d913fffbf91e9 - Sigstore transparency entry: 238781674
- Sigstore integration time:
-
Permalink:
grst/karttapullautin2tiles@366dfc6bb62a33af6190acb0e41b65fba8f1901a -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/grst
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@366dfc6bb62a33af6190acb0e41b65fba8f1901a -
Trigger Event:
release
-
Statement type: