Skip to content

Native support for GeoPackage file format #167

@juliohm

Description

@juliohm

Issue

The GeoPackage file format was developed by OGC a while ago to store "vector" and "raster" data as SQLite containers. It is widely adopted in open datasets like GADM and GeoBR.

GeoIO.jl currently relies on the external GDAL library to load/save .gpkg files:

load

else # fallback to GDAL
data = AG.read(fname; kwargs...)
return AG.getlayer(data, layer - 1)
end

save

else # fallback to GDAL
agwrite(fname, geotable; kwargs...)
end

Given the numerous reports of GDAL build failures (at least one per year for the last 5 years):

we can't rely on it moving forward.

Bounty

We need a new extra/gpkg.jl implementation that handles GeoPackage "vector" tables in native Julia.

The load implementation should consist of SQLite.jl queries that convert

  1. the table of attributes stored in the database into a Tables.jl table
  2. the geometries (with CRS information) into a vector of geometries geoms from Meshes.jl

followed by a geotable = georef(table, geoms) call to combine these two objects into a GeoTable.

The save implementation should do the reverse operation, i.e. it should save

  1. the values(geotable) as a SQLite attribute table
  2. the domain(geotable) as SQLite geometries

in the final GeoPackage file.

A solution that

  1. implements the corresponding OGC GeoPackage specification
  2. can load/save all *.gpkg files from GeoArtifacts.GADM
  3. can load/save all *.gpkg files from GeoArtifacts.GeoBR
  4. adheres to our code style and passes our current tests

will get a /bounty $500.

Tips

  • The GeoPackage guidance document contains useful information, including an implementation guide
  • If you need any assistance, please feel free to ask questions in our Zulip channel

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions