SouthForkResearch / pyGNAT

Geomorphic Network and Analysis Toolbox, redesigned using FOSS python libraries.
MIT License
2 stars 0 forks source link

NULL values cause error when writing MultiDiGraph to shapefile #36

Closed jesselangdon closed 7 years ago

jesselangdon commented 7 years ago

Empty attribute values are converted into a special NULL value called QPyNullVariant when importing a shapefile as a QgsVectorLayer. When the QgsVectorLayer is converted into a MultiDiGraph, the NULL values are retained in the attribute dictionary. Then, when writing the graph back out to a shapefile, OGR returns an error, because it doesn't know what to do with NULL values, and expects None instead.

jesselangdon commented 7 years ago

See discussion at Nathan Woodrow's blog.

jesselangdon commented 7 years ago

NULL values are now converted into 'None' values when importing a shapefile to a multidigraph. See commit #https://github.com/SouthForkResearch/pyGNAT/commit/d66162c7aab4b59b0afc1c60aea24bc5d5f10ae3