Skip to content

penguineo/geopkg-size-reducer

Repository files navigation

GeoPackage Reducer

This Python package provides utilities for handling GeoPackage (GPKG) files, including compression, decompression, file retrieval, merging, and splitting.

Table of Contents

Installation

Ensure you have Python 3.x installed. Install dependencies using pip:

pip install py7zr geopandas pandas

Dependencies

  • 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.

Usage

File Retrieval

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")

Splitting GeoPackage Files

Split a large GeoPackage file into smaller parts:

from geopackage_utils import split_files

split_files("/large/gpkg/file.gpkg", number_of_division=4)

Compression

Compress files in a directory to .7z format:

from geopackage_utils import compress_files

compress_files("/path/to/files")

Decompression

Decompress .7z files into a specified directory:

from geopackage_utils import decompress_files

decompress_files("/path/to/compressed/file.7z", "/output/path")

Merging GeoPackage Files

Merge multiple .gpkg files into a single GeoPackage file:

from geopackage_utils import merge_files

merge_files("/directory/with/gpkg/files", "/output/merged.gpkg")

License

This project is licensed under the GNU General Public License v3.0 (GNU GPLv3).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages