Preparing S-57 data using enc processor Python module: Difference between revisions
No edit summary |
(→) |
||
| Line 33: | Line 33: | ||
|- | |- | ||
| --outputtype | | --outputtype | ||
|<code>product</code> to create a fully compatible product with styling and data. <code>files</code> to create data files only. | |<code>product</code> to create a fully compatible product with styling and data. <code>files</code> to create data files only. Default is <code>product</code> | ||
|- | |- | ||
| --debug | | --debug | ||
| Line 40: | Line 40: | ||
== Examples == | == Examples == | ||
=== Executable === | |||
Display help:<syntaxhighlight lang="powershell"> | |||
enc_processor.exe --help | |||
</syntaxhighlight>Convert a directory tree of S-57 files to a fully compatible product which can be read directly by any Maria-based application:<syntaxhighlight lang="powershell"> | |||
enc_processor.exe c:\work\enc\enc_root\ c:\work\enc\output | |||
</syntaxhighlight> | |||
=== Python module === | |||
Display help: | Display help: | ||
python -m enc_processor --help | python -m enc_processor --help | ||
Convert a directory tree of S-57 files to MBTiles, with detailed log messages: | Convert a directory tree of S-57 files to MBTiles, with detailed log messages: | ||
python -m enc_processor c:\work\enc\enc_root\ c:\work\enc\mbtiles\ --debug | python -m enc_processor c:\work\enc\enc_root\ c:\work\enc\mbtiles\ --outputtype files --debug | ||
[[Category:Preparing data]] | [[Category:Preparing data]] | ||
Revision as of 12:51, 21 November 2025
S-57 source data can be converted to MBTiles using the Python module enc_processor. The output is split into one MBTiles dataset for each scaleband. Some layers are given custom fields to facilitate rendering in MARIA GDK. Zoom level configuration in the output is defined to work with the existing product NorwayNauticalENCVector.
Processing all scalebands for Norway typically takes 7-9 hours on a fast computer and SSD.
scalebands = {
1 : {'name':'Overview', 'minzoom':3, 'maxzoom':12},
2 : {'name':'General', 'minzoom':10, 'maxzoom':13},
3 : {'name':'Coastal', 'minzoom':10, 'maxzoom':13},
4 : {'name':'Approach', 'minzoom':13, 'maxzoom':16},
5 : {'name':'Harbor', 'minzoom':14, 'maxzoom':17},
6 : {'name':'Berthing', 'minzoom':14, 'maxzoom':17},
}
Dependencies
When this tool is distributed as a bundle with enc_processor.exe, the executable can be run on Windows with not external dependencies.
When distributed as a Python wheel, it depends on the following non-standard Python packages:
- GDAL
- protobuf
Arguments
| Argument | Description |
|---|---|
| input | Input folder containing S-57 "000" files. Folders are searched recursively. |
| output | Output folder where MBTiles will be built |
| --outputtype | product to create a fully compatible product with styling and data. files to create data files only. Default is product
|
| --debug | Write debug log messages |
Examples
Executable
Display help:
enc_processor.exe --help
Convert a directory tree of S-57 files to a fully compatible product which can be read directly by any Maria-based application:
enc_processor.exe c:\work\enc\enc_root\ c:\work\enc\output
Python module
Display help:
python -m enc_processor --help
Convert a directory tree of S-57 files to MBTiles, with detailed log messages:
python -m enc_processor c:\work\enc\enc_root\ c:\work\enc\mbtiles\ --outputtype files --debug