Select to view content in your preferred language

Taking data from one shapefile to another shapefile

1048
2
11-10-2023 04:13 PM
SM6
by
New Contributor

Hi All, I am trying to join two shapefile such that data (attribute tables value) from one shapefile is merged into another shapefile.  It seems applying Spatial Join resulted in wrong value. 

One of the shapefiles (Shapefile X) have Route Name, Beginning Mile Point and Ending Mile Point.  Another Shapefile (Shapefile Y) has speed limit. Because both of the shapefile are route data, they are located in same area and sometimes route intersect/merge.  

I applied Spatial Join (Operation: one to one and Match Option: intersect) to merge the Speed data. Target feature was Shapefile X and join feature was Shapefile Y. 

 

For Second time  Spatial Join: Operation: one to one and Match Option: Nearest

The result showed that in both cases sometimes it joined incorrect speed limit.  For example, one route joined speed limit data from nearby route which is incorrect. 

Is there any other option to correctly merge this two shapefiles? I want to merge speed data from Shapefile Y to Shapefile X. 

 

0 Kudos
2 Replies
SM6
by
New Contributor

Hi All, I am trying to join two shapefile such that data (attribute tables value) from one shapefile is merged into another shapefile.  It seems applying Spatial Join resulted in wrong value. 

One of the shapefiles (Shapefile X) have Route Name, Beginning Mile Point and Ending Mile Point.  Another Shapefile (Shapefile Y) has speed limit. Because both of the shapefile are route data, they are located in same area and sometimes route intersect/merge.  

I applied Spatial Join (Operation: one to one and Match Option: intersect) to merge the Speed data. Target feature was Shapefile X and join feature was Shapefile Y. 

 

For Second time  Spatial Join: Operation: one to one and Match Option: Nearest

The result showed that in both cases sometimes it joined incorrect speed limit.  For example, one route joined speed limit data from nearby route which is incorrect. 

Is there any other option to correctly merge this two shapefiles? I want to merge speed data from Shapefile Y to Shapefile X. 

 

0 Kudos
MarkBoucher
Honored Contributor

If the routes perfectly intersect each other, you might try using the Analysis Tools>Overlay>Union tool. This would result in a shape file (XY) with all of the combinations of the fields for both shape files (X and Y).  You could simplify this output and use that going forward. Or you could create a speed limit field in X  and you perform a join between X and XY using the ID field of X and the same field in XY. After the join, calculate the  new speed limit field in X to equal the speed limit field in XY then remove the join.

The success of this second approach will depend on how well the speed limits "match" the route segment. If you have more than one speed limit Y for a single segment in X, then keeping the XY layer may be the way to go so your will have segments in the routes with multiple speed limits. Also if the route lines don't perfectly intersect each other, you may get some missing segments.

Hope this makes sense. If you want, let me know which one works (or not).

Best,

Mark