You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hard to replicate this, but it seems that if SimpleWriter.add_node fails due to a Python->C++ typecasting error, it will still write an invalid node to the output. The output files seem to contain multiple nodes with id=0 and no tags at the same lines where I encounter casting errors.
so:
try
writer.add_node(oo)
catch
# error message like this:
RuntimeError: Unable to cast Python instance to C++ type (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)
{'GgCO2': '0.6217761361811466', 't': 'other', 'addr:constituency': 'Madevu', 'addr:ward': 'Mtendere Ward 30', 'amenity': 'waste_disposal'}
seems to write an incomplete node to the output file.
This is problematic because the incomplete node has ID=0, and if there are multiple cases this introduces duplicate nodes with id=0.
Hopefully this is an easy fix to simply not write anything to the file in case of an error during the Python->C++ typecasting for tags?
The text was updated successfully, but these errors were encountered:
lonvia
added a commit
to lonvia/pyosmium
that referenced
this issue
Oct 24, 2022
If an exception was caught on the Python side, then the item that
caused the exception would remain in the buffer and be written out
with the next valid item.
Fixesosmcode#212.
Hard to replicate this, but it seems that if SimpleWriter.add_node fails due to a Python->C++ typecasting error, it will still write an invalid node to the output. The output files seem to contain multiple nodes with id=0 and no tags at the same lines where I encounter casting errors.
so:
seems to write an incomplete node to the output file.
This is problematic because the incomplete node has ID=0, and if there are multiple cases this introduces duplicate nodes with id=0.
Hopefully this is an easy fix to simply not write anything to the file in case of an error during the Python->C++ typecasting for tags?
The text was updated successfully, but these errors were encountered: