Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Is there a way to source a shapefile to a layer file in QGIS much like how you do this in the properties of an ArcGIS layer? (i.e. Go to layer properties, source tab and then just depress the 'Set Dat Source' button)

I've been all over the layer properties in QGIS and I don't see this anywhere...

Thanks, Mike

EDIT: I've received comments explaining that you cannot do this with shapefiles, but if I were to change the name of a shapefile and then open a pre-existing project file which contains this shapefile as a layer, I will get the 'Handle Bad Layers' dialogue, which allows me to navigate and re-source the layer to any shapefile I want to. I find it odd that you can resource in that scenario, but you cannot do it manually through the layer properties dialogue box.

share|improve this question

2 Answers 2

Currently this isn't possible, but there is a ticket for it. You can however change the datasource in the .qgs (project file) and reopen the project.

<projectlayers layercount="1">
    <maplayer minimumScale="-4.65661e-10" maximumScale="1e+08" minLabelScale="0" maxLabelScale="1e+08" geometry="Point" type="vector" hasScaleBasedVisibilityFlag="0" scaleBasedLabelVisibilityFlag="0">

Change the <datasource> line

share|improve this answer
Can you link to the ticket so others will know if/when it is complete? –  RyanDalton Jun 3 '13 at 23:12
Always good when you say there is one then can't find the thing :) –  Nathan W Jun 3 '13 at 23:17
Thanks,I looked at doing it this way, but the problem I have is that my users are not GIS people, they just need the project to view some data. I wanted to set up a project file and set all the symbology and labeling and then just havethem re-source the data layer for different sites. This method is beyond her skill set. I'm thinking I might be able to write a script that allows her to use a plugin to update the layers. –  Mike Jun 4 '13 at 15:34
What about a DOS batch that simply copies one of the different shapefiles to a dummy one that is referenced in the project file, then start the project file. I don't know what happens if layer CRS or extents are different. –  AndreJ Jun 5 '13 at 17:12

If you work with shapefiles, no (due to the specific characteristics of the format). If you use PostGIS or SpatiaLite layers, a single vector layer (geometry_columns table) can be connected to multiple attributes tables, and inverse (with foreign keys or Views).

It is implemented natively in GRASS GIS, multiple tables for one vector layer and changing data source (v.to.db

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.