I have 2 road/ line datasets. A & B. A is less detailed than B. I would like any line segment in B that is not in A, to be added to A. But only the lines not in A I do not want to add in overlapping lines.
I'm using QGIS
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
I would probably do the following but this assumes that the majority of features in both layers are identical, otherwise it's not the best solution:
Use the Select by location tool from the Processing Toolbox for Layer B. This should select all features which overlap those in Layer A:
Processing Toolbox > QGIS geoalgorithms > Vector selection tools > Select by location
Open the Attribute Table for Layer B and invert the selection, so now the selected features are those which do not overlap:
From the menubar, copy the selected features from Layer B. Then highlight Layer A and toggle the editing icon. Then paste the features:
Perhaps I'm missing some nuance here, but can you simply select all the items in B that do not touch items in A. In ArcGIS it is a simple 'Select by Location' feature, but in qGIS it looks like you might have to perform a Spatial Query with the option 'Touches.' That will give you all the features from both layers that touch each other. Then you can invert the selection and you have all the features that don't touch each other and copy them into shapefile A.
Many thanks Barrett and Joseph for your very helpful solutions. They worked and I've now managed to merge in the roads from B that were not in A.
Unfortunately I encountered some additional problems along the way. On closer inspection road network A and road network B did not overlay exactly so the overlaps option was not selecting some roads that overlapped for the most part.
To overcome this I used GRASS < Vector < v.buffer.distance
I created quite a large buffer of 40 around all roads in dataset A. I then used these buffers and the select by location feature to select all roads in dataset B that were "within" the dataset A buffers.
I was able invert the selection and had identified all roads in dataset B not in dataset A.