Skip to content

Conversation

elifsu-simula
Copy link
Collaborator

@elifsu-simula elifsu-simula commented May 19, 2025

Description

Added support for GeoPackage data format, both to UI and to Python API, using the library geopackage-js.

I added a test for Python API but didn't add a UI test. I also did not add support for exporting GeoPackage layers to QGIS. If asked, I can do these either in this PR or another PR.

Checklist

  • PR has a descriptive title and content.
  • PR description contains references to any issues the PR resolves, e.g. Resolves #XXX.
  • PR has one of the labels: documentation, bug, enhancement, feature, maintenance
  • Checks are passing.
    Failing lint checks can be resolved with:
    • pre-commit run --all-files
    • jlpm run lint

📚 Documentation preview: https://jupytergis--709.org.readthedocs.build/en/709/
💡 JupyterLite preview: https://jupytergis--709.org.readthedocs.build/en/709/lite

Copy link
Contributor

Binder 👈 Launch a Binder on branch elifsu-simula/jupytergis/add_geopackage_data_format

@elifsu-simula elifsu-simula marked this pull request as draft May 19, 2025 11:22
# Conflicts:
#	packages/base/src/constants.ts
#	packages/base/src/toolbar/widget.tsx
#	python/jupytergis_lab/jupytergis_lab/notebook/objects/__init__.py
#	yarn.lock
@elifsu-simula elifsu-simula added the enhancement New feature or request label May 19, 2025
Copy link
Contributor

github-actions bot commented May 19, 2025

Integration tests report: appsharing.space

@elifsu-simula elifsu-simula marked this pull request as ready for review May 19, 2025 13:11
@martinRenou martinRenou moved this from Todo to In Progress in JupyterGIS Prioritization Jun 2, 2025

const tables = gpkg.getFeatureTables();
const features: GeoJSON.Feature[] = [];
for (const tableName of tables) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, the user should get a chance to choose which table(s) they want to load. Maybe that could be a future PR though :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users are now able to choose which tables to load

for (const tableName of tables) {
const dao = gpkg.getFeatureDao(tableName);
const bbox = dao.getBoundingBox();
const iter = gpkg.queryForGeoJSONFeaturesInTable(tableName, bbox);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how I feel about converting the data to GeoJSON. Have you looked in to https://github.com/richard-thomas/ol-load-geopackage ? (I'm not sure how it works under the hood, maybe it loads from GeoJSON too 😆 )

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we are using the library you suggested for vector layers, but for raster layers we're still using ngageoint

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made the webpack config path relative in package.json as described in the link you provided, however I'm not sure if that was what you suggested.

@elifsu-simula elifsu-simula marked this pull request as draft June 14, 2025 00:17
@Gauss-Taylor-Euler
Copy link
Contributor

Hi , I am looking into this pr now , before I start , have you some local change that are not on the current pr ?

@Gauss-Taylor-Euler
Copy link
Contributor

For instance solving current merge conflict etc.

@elifsu-simula
Copy link
Collaborator Author

@Gauss-Taylor-Euler It’s still WIP😊

@Gauss-Taylor-Euler
Copy link
Contributor

Ok I see no problem, what are the thing left to do , except for merge conflict ?

@elifsu-simula
Copy link
Collaborator Author

It only works for vector layers, I will add support for raster layers as well

@Gauss-Taylor-Euler
Copy link
Contributor

Ok I see , thank you.

@elifsu-simula elifsu-simula marked this pull request as ready for review July 21, 2025 13:16
@elifsu-simula
Copy link
Collaborator Author

elifsu-simula commented Jul 21, 2025

Some notes;

  • I tested two GeoPackage raster sources, AuroraCO, and St. Louis. It works well for St. Louis, however the app crashes when I try to load AuroraCO. I could not figure out why.
  • The library ol-load-geopackage does not support curved geometry types (like WKB8). So if the gpkg data has WKB8 as well as other supported geometries, none of them will be loaded. I think this can be fixed in a separate PR by either filtering the supported geometries, or flattening the curved ones. (fixed in d62ac7a)
  • I also had problems with the AuroraCO's vector layer, due to the unsupported data projection. Again this can be fixed by filtering only valid data projections or converting them to a supported projection. (fixed in 8522e1d)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants