bcgov / FIT_opendatadownloader

Monitor open data, report when changes are detected
Apache License 2.0
0 stars 0 forks source link

file geodatabase does not support mixed geometry types per layer #15

Closed smnorris closed 2 months ago

smnorris commented 2 months ago

Options:

Seems simplest to promote to all rows to multipart any time a multipart feature is present.

>>> import json
>>> import fit_changedetector as fcd

>>> with open("sources/STRD/campbell_river.json", "r") as f:
>>>     config = json.load(f)
>>> source = fcd.parse_config(config)
>>> df = fcd.download(source[0])
>>> df.geometry.geom_type.unique()
array(['Polygon', 'MultiPolygon'], dtype=object)
>>> df.to_file("test.geojson")
>>> df.to_file("test.gdb", driver="OpenFileGDB")
Traceback (most recent call last):
  File "pyogrio/_io.pyx", line 2183, in pyogrio._io.create_ogr_dataset_layer
  File "pyogrio/_err.pyx", line 183, in pyogrio._err.exc_wrap_pointer
pyogrio._err.CPLE_NotSupportedError: Unsupported geometry type