I am wanting to join a csv with an shp file any ideas on the methods used to complete this.
I've seen a few different ways none of which are working for me?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
One way would be to use a virtual layer with Python:
query = "?query=Select shapefile.*, csv.* from shapefile join csv on shapefile.commonfield = csv.commonfield;" vlayer = QgsVectorLayer( query, , "joined layer", "virtual" ) QgsProject.instance().addMapLayer(vlayer)
shapefile is your shapelayer and csv your CSV-table