Closed huard closed 4 years ago
It should be relatively trivial to detect if pydata
is a sequence and use the first element as an archetype. Would this address the issue? I don't have a good sense for the context.
I don't know. I just noticed that some properties with list crashed this function, but I don't know what role it plays exactly.
So I'm fetching geometries from a WFS server and load them as shapely objects (geom
) with crs
and properties
. I then pass those geometries as a list of dict to OcgOperations.
For the moment I just replaced the properties whose values are a list by a string with an error message. Any improvement over this makeshift solution is going to be welcome.
Got it. I'll take a look and get back to you. Thanks for the additional info.
@huard: Since fiona
properties are always scalars and from_records
expects this, I can think of a few options:
','.join(<list property>)
to convert the list to a string. This would then cleanly get converted to a field and be pretty obvious as to how it is used if the bounding box is later needed.Which do you think works best for your case?
No strong opinion, I'm happy with the first and simplest option.
Okay, pushed a fix to master. Let me know how it goes. A warning is just issued for a list/tuple in properties.
@huard, I realized I needed to mention that the property is skipped in addition to emitting a warning! Oops.
Looking good. Thanks !
Sometimes in the properties field of a geometry, there is a bbox field with a list of values. Lists are not supported by
get_fiona_type_from_pydata
.