-
Notifications
You must be signed in to change notification settings - Fork 208
Open
Description
Expected behavior and actual behavior.
Hi all, in the current version of fiona rather than upcasting integers to floats. Worse it appears to drop the field in output types (like GeoJSON). In previous versions of fiona it would upcast integers automatically to floating point numbers.
I think it's related to #1376
Steps to reproduce the problem.
Simple example with the WARNING logs on
>>> import fiona
>>> fiona.__version__
'1.10.1'
>>> import logging
>>> logging.basicConfig(level=logging.WARNING)
>>> schema = {'geometry': 'Point', 'properties': {'a': 'float', 'b': 'int'}}
>>> with fiona.open("test_fiona110.geojson", mode="w", schema=schema) as col:
... col.writerecords([{'id': '0', 'type': 'Feature', 'properties': {'a': 1, 'b': 1}, 'geometry': {'type': 'Point', 'coordinates': (0.0, 0.0)}}])
...
WARNING:fiona.ogrext:Skipping field because of invalid value: key='a', value=1
>>> with open("test_fiona110.geojson") as f:
... print(f.read())
...
{
"type": "FeatureCollection",
"name": "test_fiona110",
"features": [
{ "type": "Feature", "properties": { "b": 1 }, "geometry": { "type": "Point", "coordinates": [ 0.0, 0.0 ] } }
]
}
Operating system
For example: Debian linux
> lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux trixie/sid
Release: n/a
Codename: trixie
Fiona and GDAL version and provenance
- fiona version: 1.10.1 (installed via apt-get)
- Python 3.12.7 (installed via apt-get)
- gdal version: GDAL 3.9.3, released 2024/10/07 (installed via apt-get)
Metadata
Metadata
Assignees
Labels
No labels