py-gdalogr-cookbook
py-gdalogr-cookbook copied to clipboard
Save centroids of input Layer to an output Layer
So I found a little typo that took me quite a while to fix regarding this recipe for getting centroids for features in an input layer, as seen in this chapter of the documentation.
By inserting the inFeature = None
line, the connection with the current inFeature is effectively terminated thus resulting in the annulment of all attribute values insrted in the outLayer for that feature.
I thus removed that line and it solved the problem.
It was a good opportunity to solidify the contents learnt up until that point nonetheless.