1

I am using QGIS 2.18

I have two shapefiles containing bus stops

the first file(old_stops) has 144 stops, the second (new_stops) has 5.

There are 3 stops in the new_stops file that are practically the same as 3 of the ones in old_stops- so only 2 new stops have to be added. So if I combine them, I should get 146 stops.

However, being a point shapefile, and because data was collected by different users, the 3 stops in old_files lie just a few meters away from the corresponding one in new_stops, and also have slightly different names

Because of this, a union results into 149 stops.

Now because it is a question of just a few stops, I can delete stops manually. However, I want to know if there is an automated process to do this for posterity.

To summarise: I am looking for an operation that can combine two layers,whilst setting a tolerance level of a few meters. That way, if a pair of features from each layer lie within the tolerance, it will choose the features of one of the shapefiles(which can be specified)

The easiest way I can think of(for large data) is: 1.creating a buffer layer around the old stops, 2. then select by location of all the stops in new_stops that lie within/overlap/touch the buffer layer, 3 deleting those selected features in new_stops 4. union of the modified with the old_stops

Is there an easier way?

1

You could use Extract by location tool, which is in Processing toolbox | QGIS geoalgorithms | Vector selection tools.

The setting would be:

  • Layer to select from: your new_stops
  • Additional layer (intersection layer): your old_stops
  • Geometric predicate: disjoint
  • Precision: your tolerance

This will output a new layer Extracted (location) with new_stops which is away from your old_stops (minimum distance as set as precision).

Then, you can merge Extracted (location) with the old_stops layer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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