-
Notifications
You must be signed in to change notification settings - Fork 217
Open
Description
This has the same underlying issue as my comment in #1469 but is probably more straightforward to understand. This setup below works, Bnode has a value larger than an int32.
import logging
logging.basicConfig(
level=logging.DEBUG, # capture debug and above
format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
)
logger = logging.getLogger(__name__)
import fiona
schema={'properties': {'Anode': 'int64', 'Bnode': 'int64'}, 'geometry': 'LineString'}
crs = "EPSG:4326"
coordinates = [(115.638812, -32.62857), (115.637933, -32.631091)]
records = [fiona.Feature(geometry=fiona.Geometry(coordinates=coordinates, type='LineString'), id='23998',
properties=fiona.Properties(Anode=25194, Bnode=2519425196))]
with fiona.open(
"test_links.gpkg",
"w",
driver='GPKG',
crs=crs,
schema=schema,
) as f:
print(records)but if the schema for Anode is updated to be an int32, writing bnode will result in an overflow error
schema={'properties': {'Anode': 'int32', 'Bnode': 'int64'}, 'geometry': 'LineString'}
with fiona.open(
"test_links.gpkg",
"w",
driver='GPKG',
crs=crs,
schema=schema,
) as f:
print(records)This seems to work on fiona 1.9.6 and up to ea24f55 and is broken
from b6e62cc.
I think this case can be solved by defining the property_setter_cache in ogrext.pyx to cache on both the input type and the schema type, rather than doing anything around determining the int width.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels