Skip to content

Files

Latest commit

08da2cf · Aug 21, 2021

History

History

src

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 21, 2021
Feb 20, 2019
Feb 20, 2019
Aug 21, 2021
Aug 21, 2021

A package to read/write GeoPackage Vector Data.

Getting Started

Use the GeoPackage library is easy as passing in a file path to the GeoPackage class. This class contains the ability to manage, create, and modify spatial and attribute data. It is designed to work with for arcpy and shapely geometries, so no matter what you do or how you want to manage your data, you now can.

from geopackage import GeoPackage

fp = r"./data/geodata.gpkg"
with GeoPackage(fp) as gpkg:
    # List all Tables
    for table in gpkg.tables:
        print(table)

GeoPackages is designed to create a simple approach to data management. The context manager handles all the close and save operations.

Reading Table Data

fp = r"./data/geodata.gpkg"
with GeoPackage(fp) as gpkg:
    # List all Tables
    table = gpkg.get("census")
    for row in table.rows():
        print(row)

When reading information, an optional where clause and field names can be given.

Writing Data

fp = r"./data/geodata.gpkg"
with GeoPackage(fp) as gpkg:
    # List all Tables
    table = gpkg.get("census")
    for row in table.rows():
        print(row)