Giter VIP home page Giter VIP logo

fgdb_to_gpkg's Introduction

fgdb_to_gpkg

fgdb_to_gpkg is a Python package that converts all feature classes within an Esri File GeoDatabase to layers within a OGC GeoPackage. This package is designed to be used from the command line or imported as a module.

This package does not have a dependency on ArcPy, which means that you can safely extract feature classes locked inside an Esri File GeoDataBase without needing to worry about any ArcGIS licensing.

Installation

Installing from PyPI

pip install fgdb-to-gpkg

Installing the development version of this package

  1. Clone the repository: git clone https://github.com/philiporlando/fgdb_to_gdb.git
  2. Navigate to the repository directory: cd fgdb_to_gdb
  3. Install the package and its dependencies with poetry: poetry install

Usage

Command Line Usage

To use fgdb_to_gpkg from the command line, simply call the fgdb_to_gpkg command with the path to the input File GeoDatabase and the path to the output GeoPackage:

poetry run python -m fgdb_to_gpkg <input_fgdb_path> <output_gpkg_path>

Module Usage

You can also import fgdb_to_gpkg as a module in Python and use it to convert any Esri File GeoDatabase feature classes to GeoPackage layers programmatically.

Here's an example of how to use fgdb_to_gpkg as a module:

from fgdb_to_gpkg import fgdb_to_gpkg

input_fgdb_path = "/path/to/my_fgdb.gdb"
output_gpkg_path = "/path/to/my_gpkg.gpkg"

fgdb_to_gpkg(input_fgdb_path, output_gpkg_path)

# See help(fgdb_to_gpkg) for more details

Testing

Unit tests can be performed by the developers of this package using the following command:

poetry run pytest tests

Test coverage can be assessed using the following command:

poetry run pytest --cov=fgdb_to_gpkg --cov-report term-missing

Handling the Fiona GDAL compilation error

The unit tests within this package depend on gdal=^3.6.0, but the current version of fiona ships with gdal=3.5.3. The fiona package must be installed using the --no-binary flag to test this package. If this is not configured properly, then you will see the following error:

poetry run pytest tests
# fiona.errors.DriverError: OpenFileGDB driver requires at least GDAL 3.6.0 for mode 'w', Fiona was compiled against: 3.5.3

The poetry.toml file should contain all of the config needed to tell poetry how to handle this issue. However, if poetry install does not resolve the issue, then try the following:

poetry run pip install --force-reinstall fiona --no-binary fiona

Publishing

This package is automatically published to PyPI when a new release is crafted. For a successful publication, maintainers should:

  1. Increment the version number in the pyproject.toml file. Ensure you update it in both the [project] and [project.dependencies] sections.

  2. Adhere to vX.X.X the naming convention for the release name and tag.

fgdb_to_gpkg's People

Contributors

philiporlando avatar dependabot[bot] avatar

Stargazers

Khem So avatar Andrew Gene Brown avatar  avatar Tim Hitchins avatar

Watchers

James Cloos avatar Kostas Georgiou avatar  avatar

Forkers

timhitchins

fgdb_to_gpkg's Issues

Deploy to PyPi?

Finish up packaging this project and learn how to deploy it to PyPi so it can be installed via pip.

Incorporate unit tests

Add unit tests using pytest. Learn more about dev environments and including mock data within the package for testing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.