Skip to content

Empty multipolygon geometry has different encoding after conversion from GPKG to PG #213

Description

@wonder-sk

DB sync was failing on a dataset with some empty multi-polygons when doing doing sanity check after the initial copy from GPKG to PostGIS.

       "old": "R1AAEX5/AAABBgAAAAEAAAABAwAAAAAAAAA="
       "new": "R1AAEX5/AAABBgAAAAAAAAA="

It turns out the original geometry was a multi-polygon with one polygon with zero rings:

01 | 06 00 00 00 | 01 00 00 00 | 01 | 03 00 00 00 | 00 00 00 00
    multipolygon   one child geom      polygon       no rings

And after the import to PostGIS, the geometry was a multi-polygon with no polygons in it:

01 | 06 00 00 00 | 00 00 00 00
    multipolygon   no child geoms

Not sure where/why this conversion happens. A workaround would be to change the representation of empty multi-polygons before doing operations with geodiff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions