1

I have a QGIS project with some vector layers backed by shapefiles. One of these layers contains all the roads, and I would like to "improve" it:

  • It is organized in a way that each vector feature goes between consecutive intersections, but I would like to join every same-name segment into one continuous feature;
  • The road network is incomplete (data is quite old), so I would like to add my own segments to it;
  • Occasionally there might be changed roads (unpaved roads that were "straightened" before being paved), that I would like to replace in the original vector layer.

I am not sure what workflow should I follow so that I take most advantage from the original layer, without modifying it, but being able to edit it - both automatically when convenient, or manually when necessary.

Some strategies I thought about:

  • Creating a new layer and copying the data, selectively, to another layer, from which I could remove or edit old data, and add new entities;
  • Creating a copy of that layer right away, losing reference with the original one, and editing it exclusively, much like a repository fork, "making it my own".

I ask because I am quite new to GIS in general and QGIS in special, and I am not aware of the good practices yet, so I am afraid of following the wrong approach and spending a lot of work that I would eventually have to discard and start over.

1
  • Definitely not a good idea to edit the original file. If you make a mistake, you'll need the original layer as a backup.
    – csk
    Commented May 17, 2018 at 19:10

1 Answer 1

2

This is an opinion-based question, so here's my suggestion. Other approaches may be just as valid.

Start by creating a copy of the original file.

Do this by right clicking on the layer name > save as. Give the new file a name that indicates that it's been updated, eg OriginalFileName_Updated5-17-2018.shp

(Be sure not to choose the option Duplicate, as this creates a new layer using the same source file. Any edits made to a duplicated layer change the original source file.)

The advantage of copying the original file is that the original attribute table fields are preserved. If you created a new layer, you would have to manually create each field. If you copy a feature from the original layer into the new one, all of its attributes will travel with it.


Add any new road segments and make changes to existing road segments.

  • Use the Add Feature tool to add new segments
  • Use the Vertex Editor tool to edit existing road segments (may be called the Node Tool, depending on your version of QGIS)
  • Or, replace existing road segments by selecting and deleting the original segment (using Delete Selected button), then adding a new feature. enter image description here

Be sure to save your edits.


Dissolve all roads with the same name.

Quality control: Make sure all the roads with the same name have exactly the same name. Remove any inconsistencies in capitalization, spelling, punctuation and abbreviation.

Run the Dissolve tool (Vector menu > geoprocessing tools > dissolve)

Uncheck the option to Dissolve all. Select the name field.

By default this tool creates a temporary layer. You could choose a file path if you want it the output to be saved, but I prefer to create a temporary file. Sometimes you choose the wrong setting and have to run the tool more than once, and then you end up with lots of extra files cluttering up your computer.


Last, but definitely not least:

If you're satisfied with the results of the dissolve, save the temporary layer, eg as OriginalFileName_Updated5-17-2018_Dissolved.shp.

Your Answer

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

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