Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional param to wrap flatgeobuf geometries in GeometryCollection #213

Merged
merged 8 commits into from
Feb 21, 2024

Conversation

spwoodcock
Copy link
Member

@spwoodcock spwoodcock commented Feb 20, 2024

Fixes #210

@kshitijrajsharma

Includes:

  • By default all flatgeobuf files are generated with SPATIAL_INDEX=YES.
  • Optional param fgb_wrap_geoms can be passed to /snapshot/.
    • If set, this will wrap all geometries within a flatgeobuf file with a GeometryCollection object. This standardises the geometry type, allowing for import into PostGIS.
    • However, each geometry will be nested, so I did not set this as default (as it's generally not advised to unnecessarily nest geoms).
  • I also updated a couple of links in the documentation to the installation pages.
  • The unit test action was also failing, as no value is set for ALLOW_BIND_ZIP_FILTER and it defaults to ''.
    • I originally changed ALLOW_BIND_ZIP_FILTER: ${{ secrets.ALLOW_BIND_ZIP_FILTER || false }} with a default in Unit-Test.yml, but it didn't fix it so I removed.
    • I can only assume that the secret ALLOW_BIND_ZIP_FILTER is actually set to '', which I can't change as I have no access to repo settings.

Note: I didn't have time to set up the raw-data-api backend for testing, so hence have not tested this PR!

@kshitijrajsharma
Copy link
Member

I am not sure how much geometrycollection will be of help for FMTM , I am merging it anyway as it is enabled through optional parameter , I will probably have second look on it later on

@kshitijrajsharma kshitijrajsharma merged commit 77c1359 into hotosm:develop Feb 21, 2024
3 of 5 checks passed
@spwoodcock spwoodcock deleted the fix/flatgeobuf-geomcol branch February 21, 2024 08:06
@spwoodcock
Copy link
Member Author

Once all geoms are wrapped in GeometryCollection the flatgeobuf can be imported into Postgis. Otherwise import fails.

It's easy to extract the geoms from the GeometryCollection wrapper and then convert to GeoJSON 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] flatgeobuf files generated with unknown geometry
2 participants