I am trying to load a series of csv files as vectors in PyQGIS. I run this code to try to get the first one:
uri='file://D:/Saved Stuff/gulags/1.40.csv?delimiter=;&yField=y&xField=x'layer = QgsVectorLayer(uri, '1.40', 'delimitedtext')layer.isValid()FalseObviously (?) it won't load when I run QgsMapLayerRegistry.instance().addMapLayer(layer). When I add the csv manually to a map it loads fine. Here is what that looks like
name;y;x;total
AMURSKII ZhELEZNODOROZhNYI ITL;51.375889;128.134147;84053
BELOMORO-BALTIISKII ITL;62.912774;34.456850;78918
BIRSKII ITL;48.999752;132.461997;11634
Can anyone help me with this?
أكثر...
uri='file://D:/Saved Stuff/gulags/1.40.csv?delimiter=;&yField=y&xField=x'layer = QgsVectorLayer(uri, '1.40', 'delimitedtext')layer.isValid()FalseObviously (?) it won't load when I run QgsMapLayerRegistry.instance().addMapLayer(layer). When I add the csv manually to a map it loads fine. Here is what that looks like
name;y;x;total
AMURSKII ZhELEZNODOROZhNYI ITL;51.375889;128.134147;84053
BELOMORO-BALTIISKII ITL;62.912774;34.456850;78918
BIRSKII ITL;48.999752;132.461997;11634
Can anyone help me with this?
أكثر...