This Python package provides utilities for handling GeoPackage (GPKG) files, including compression, decompression, file retrieval, merging, and splitting.
Ensure you have Python 3.x installed. Install dependencies using pip:
pip install py7zr geopandas pandas
- py7zr: For compressing and decompressing files using the .7z format.
- geopandas: For reading, writing GeoPackage files, and performing spatial operations.
- pandas: For handling data structures and data analysis in Python.
Retrieve files with a specific extension from a directory and its subdirectories:
from geopackage_utils import get_files
file_list = get_files("/directory/path", file_extension=".gpkg")
Split a large GeoPackage file into smaller parts:
from geopackage_utils import split_files
split_files("/large/gpkg/file.gpkg", number_of_division=4)
Compress files in a directory to .7z format:
from geopackage_utils import compress_files
compress_files("/path/to/files")
Decompress .7z files into a specified directory:
from geopackage_utils import decompress_files
decompress_files("/path/to/compressed/file.7z", "/output/path")
Merge multiple .gpkg files into a single GeoPackage file:
from geopackage_utils import merge_files
merge_files("/directory/with/gpkg/files", "/output/merged.gpkg")
This project is licensed under the GNU General Public License v3.0 (GNU GPLv3).