1

I need to add a spatial csv-file with a specific path (folder and file name) in QGIS3x using a python script. I have tried: PyQGIS import csv- QGIS 3.4

uri = "file:///C:/users/heubacha/Test.csv?type=csv&delimiter=;&detectTypes=yes&xField=X_Wert_Pos&yField=Y_Wert_Pos&crs=epsg:25832&spatialIndex=no&subsetIndex=no&watchFile=no"
mem_layer = QgsVectorLayer(uri, 'Test', 'delimited text')
QgsProject.instance().addMapLayer(mem_layer)

no luck with that...warning: invalid data provider delimited text.

Trouble loading non-spatial data via CSV using Python for standalone script was not getting me anywhere either, because I need to add the path as a string somewhere in the coding, and that's not described there.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jul 15, 2019 at 16:17
1
  • 3
    'delimited text' is not correct,you need write 'delimitedtext' Commented Jul 15, 2019 at 16:22

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.