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

float as invalid field type in file geodatabase #1472

Open
gzt5142 opened this issue Dec 11, 2024 · 0 comments
Open

float as invalid field type in file geodatabase #1472

gzt5142 opened this issue Dec 11, 2024 · 0 comments

Comments

@gzt5142
Copy link

gzt5142 commented Dec 11, 2024

I don't seem to be able to access columns of type float from file geodatabases. Layers will be ingested, but the offending columns are dropped.

Expected behavior and actual behavior.

Reading a layer from within a file geodatabase:

Expected:

  • Expect all numeric columns to be included in schema.
  • Opening same geodatabase and layer using other GDAL/OGR tools (e.g. QGIS, ogrinfo) correctly read the data.

Actual:

  • Columns which have a data type of float are declared invalid as fiona reads them; they are not included in the schema.

The fiona warning message claims that a data type of (2, 3) is invalid. The way I read https://github.com/Toblerity/Fiona/blob/main/fiona/gdal.pxi#L228, that maps to OFTReal/OFSTFloat32. If I've understood that correctly, fiona is rejecting float32 data types due to there not being a mapping in OGRPropertyGetter for this type.

Steps to reproduce the problem.

  • Create file geodatabase with ArcGIS Pro (sample gdb is attached to this issue)
  • Add feature class with at least one column of type float
  • Open that gdb/layer with fiona

Attached is a simple geodatabase with two feature classes in it. One with a float column and one with a double column. The with_float32 layer does not recognize all columns.

>>> with fiona.open("test.gdb", layer="with_float32") as src:
>>>     print(src.schema)
WARNING:fiona.ogrext:Skipping field value: invalid type (2, 3)
{'properties': {}, 'geometry': 'Point'}

A similar feature class, created with value column of type double:

>>> with fiona.open("test.gdb", layer="with_double") as src:
>>>     print(src.schema)
{'properties': {'value': 'float'}, 'geometry': 'Point'}

Operating system

$ uname -a
Linux ******  #78~20.04.1-Ubuntu SMP Wed Oct 9 15:30:47 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Fiona and GDAL version and provenance

Fiona 1.10.1 installed via PyPi

>>> print(f"fiona version: {fiona.__version__}")
fiona version: 1.10.1

>>> print(f"GDAL release: {fiona.get_gdal_release_name()}")
GDAL release: 3.9.2

test.gdb.zip

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

No branches or pull requests

1 participant