Closed jtmiclat closed 1 year ago
First off i want to say thank you for a super cool library!
I was wondering if pyogrio can pass optional driver arguments when using read_dataframe .
read_dataframe
For example, we have a geojson named test.geojson
{ "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 2.000000001, 49.000000001 ] }, "properties": { "a_property": "foo", "some_object": { "a_property": 1, "another_property": 2 } } } ] }
Ideally reading it with the option FLATTEN_NESTED_ATTRIBUTES="YES" would return
FLATTEN_NESTED_ATTRIBUTES="YES"
+------------------------------------------------------------------------------------------------+ | a_property | some_object_a_property | some_object_another_property | geometry | +------------------------------------------------------------------------------------------------+ | foo | 1 | 2 | POINT (2.00000 49.00000)| +------------------------------------------------------------------------------------------------+
but when running it gives the following error
In [1]: pyogrio.read_dataframe("test.geojson", FLATTEN_NESTED_ATTRIBUTES="YES") ----> 1 pyogrio.read_dataframe("test.geojson", FLATTEN_NESTED_ATTRIBUTES="YES") TypeError: read_dataframe() got an unexpected keyword argument 'FLATTEN_NESTED_ATTRIBUTES'
Interestingly enough write_dataframe already supports optional drivers https://github.com/geopandas/pyogrio/blob/a0b658509f191dece282d6b198099505e9510349/pyogrio/raw.py#L314-L328
write_dataframe
Yes, we should support driver and layer options where appropriate, just like for writing. Thanks for the suggestion!
First off i want to say thank you for a super cool library!
I was wondering if pyogrio can pass optional driver arguments when using
read_dataframe
.For example, we have a geojson named test.geojson
Ideally reading it with the option
FLATTEN_NESTED_ATTRIBUTES="YES"
would returnbut when running it gives the following error
Interestingly enough
write_dataframe
already supports optional drivers https://github.com/geopandas/pyogrio/blob/a0b658509f191dece282d6b198099505e9510349/pyogrio/raw.py#L314-L328