lcfm-shapefiles
Python wrapper around shapefiles used for the LCFM project.
Install
From PyPI:
uv add lcfm-shapefiles
# or: pip install lcfm-shapefiles
From VITO's internal Artifactory (VITO-only):
uv add --index https://artifactory.vgt.vito.be/artifactory/api/pypi/python-packages/simple lcfm-shapefiles
Use
import lcfm_shapefiles import list_filepaths, get_filepath
import geopandas as gpd
# List out all available files; you can index this list to get a path
lcfm_shapefiles.list_filepaths()
# Get path a specific file
fp = lcfm_shapefiles.get_filepath("LCFM_1p_S2-tiles.fgb")
# Import fgb into a geopandas data frame
gdf = gpd.read_file(fp)
Develop
# Build venv
uv sync
# Run tests
uv run pytest
# Format the code
uv run ruff format .
License
The Python source code is licensed under the MIT License - see LICENSE.
The shapefile/grid data shipped in src/lcfm_shapefiles/data/ is licensed under
CC BY-SA 4.0, except two files derived from OpenStreetMap land polygons
(generated by scripts/land_buffer.py), which are ODbL 1.0 licensed - see
LICENSE-DATA for the full breakdown and attribution.
CI/CD
A Jenkins job is configured, that:
- Builds the package
- Runs the tests
- Uploads a 'dev build' package to Artifactory, e.g.
0.2.3.dev20250305+6 - Creates a promotion job.
When the build is successful, you should receive an email with a link to the promotion job. If you don't get this email (e.g., when Jenkins can't infer your email from your commits), you can find the link to the promotion job in the build logs, or here. When you build this promotion job ("Build with Parameters" and then "Build"), it:
- Tags the commit based on the package version
- Uploads the 'tag build' package to Artifactory, e.g.
0.2.3.
This CI/CD uses the general Python pipeline and was created through the Jenkins job builder. Check with the Software Operations team for more details on its configuration or help with build issues.
Steps to to deploy a new or update existing shapefiles
- Add or update shapefiles in
src/lcfm_shapefiles/data. - Update tests accordingly.
- Bump the package version in
pyproject.toml. - Commit and push the changes to
master. - If the build passes, trigger the promotion job.
A new version of the lcfm-shapefiles package should now be on Artifactory.
Use Git LFS storage
We are using the Github Large File Storage about to store fgb files
This works alongside with the principle that big files should not be stored in the repository, and a pointer is stored in their place. The actual files are stored somewhere from LFS and are synchronized/cloned from our master branch in the vm at: /vitodata/vegteam/auxdata/LCFM/shapefiles-lfs
sudo dnf install -y git-lfs
git lfs install
If you need to pull the actual fgb files try:
git lfs pull
MD5 and Shapefile limits
To ensure validity of downloaded assets, multi-part upload limit is set to 5GB aligning with the Cloudferro's suggested max size recommended limit
Auto-Syncing Shapefiles to Terrascope
When triggered, the script /vitodata/vegteam/auxdata/LCFM/scripts/sync-shapefiles-terrascope.sh performs a syncing from the master branch
As Terrascope network is not exposed publicly and github event-hooks can not be used, the trigger is a weekly defined cronjob:
Cronjob
Cronjob is added with:
crontab -e
and then usin VIM editor add:
0 0 * * 0 /vitodata/vegteam/auxdata/LCFM/scripts/sync-shapefiles-terrascope.sh >> /vitodata/vegteam/auxdata/LCFM/logs/cron.log 2>&1
confirm that cronjob is added
crontab -l
Metadata
Release files for lcfm-shapefiles 0.9.34
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lcfm_shapefiles-0.9.34.tar.gz | 1.6 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lcfm_shapefiles-0.9.34-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.6 MB
Release files / lcfm_shapefiles-0.9.34.tar.gz
| Download URL | lcfm_shapefiles-0.9.34.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
58c13215db922989d6ce1c6584e3b13a0c107419aacfd598965069921c537e98
|
|
BLAKE2b-256 checksum How to use checksums |
4b05d46f38b4a32f118524ccffb245f80392788d4680132ce319ff32d05ab345
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.8.24
|
Release files / lcfm_shapefiles-0.9.34-py3-none-any.whl
| Download URL | lcfm_shapefiles-0.9.34-py3-none-any.whl |
|---|---|
| Size | 31.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f27671075ac331cd2677ccd62bacf25e28eaf160b7d7ae7d7e67a4ce7dde1bc6
|
|
BLAKE2b-256 checksum How to use checksums |
c988d1e340d6331d3904186ed571a3a0670d53802647ec82a74fd2bce3cdb04d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.8.24
|