I have a 2017 database for a road network. It has RUTM Coordinates, and other attributes. I have a 2018 database for the same road network. Due to the nature of GPS, the RUTM coordinates in the new database are offset with variance. So the same road doesn't line up on the new database. I want to take important attributes from the old database, and put it on the new database for the corresponding road segments. So I want to combine these databases into one database with the 2018 coordinates, but with some 2017 attributes.

How do I do this?

They share a few attributes, but they do not consistently line up with each other across databases.

  • Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works. Thanks. – PolyGeo May 29 '19 at 9:07
  • It's not clear from your question whether there is a primary key or id that all the datasets share. If there is, use an attribute join on the common field to join the fields you want from each dataset. I imagine there would at least be a route id field that is common. Without a common field, your only option is spatial joins, which you will need to check for errors, especially at start/ends of routes. You would need a search distance if using spatial joins. In QGIS, you do this by buffering your datasets by your search distance (1m?) and using the tool 'Join attributes by location'. – jbalk May 29 '19 at 20:26

There are several methods for transferring attributes from one layer to another. However, they all depend on the two layers having something in common. Given that your data does not share attributes or geometry, there will be a degree of error in every method. You will have to manually fix these errors.

Try each of these methods. Combine the best results from each method, then manually correct any missing or erroneous attributes.

  1. Nearest Neighbor Join: Joins each road segment in the 2018 layer to the closest road segment in the 2017 layer.

    • If the coordinates don't vary too much, this should be the best method.
    • Download the NNJoin plugin, and run it from the yellow and red button on the Vector toolbar.

    enter image description here

  2. Table join: Joins the two layers based on a unique, common attribute.

    • Use the Processing tool Join attributes by field value.
    • Since your layers "share a few attributes, but do not consistently line up with each other," do a join for each partially shared attribute.
    • Combine the results, and remove any duplicates.

    enter image description here

  3. Spatial join with a buffer: Make a buffer of one of the road layers. Do a spatial join (using the Processing tool Join attributes by location) between the buffer and the other road layer, using "within" as the geometry predicate.

    • The success of this method depends on choosing the correct buffer size. Choose a buffer size large enough that the buffer of one road segment will completely contain the corresponding road segment in the other layer.

    enter image description here

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.