52North/IlwisCore

newFeature(Geometry g) from not-yet-loaded-binary FeatureCoverage

pokulo opened this issue · 4 comments

There is not yet a guard, that checks if the binary data of a FeatureCoverage is loaded before creating a new Feature. If using Python code like this:

fc = FeatureCoverage(url) #file containing many features but only meta data is loaded
fc.newFeature(geometry) #from now on fc contains only 1 feature instead of many+1

the binary data will never be loaded, because there is the new Feature in the _datagrid already.

It's not easy to guard this in the current method FeatureCoverage::newFeature because the same method is used during FeatureConnector::loadBinaryData, this way calling loadBinaryData() again will cause a deadlock!

unfortunately this causes a crash of the application! because of undefined behaviour. Could not find out where exactly the crash came from. The debugger crashed always on different positions...

also before storing binary data of the AttributeTable, there is no check if binary was loaded. Results in empty tables, because the FeatureIterator, who checks loaded status, is invoked after storing the table...

solved in c70ddbb