Getting values from two SHP

747
2
08-28-2021 11:37 AM
Labels (3)
StanislavaV
Occasional Contributor

Hi guys, 

first SHP "ALL" has attributes like this: Each ID has CODE, ALP and NUM

ID          CODE        ALP         NUM

123        0303          AB           23

456         0303         BF            34

789          1234         AC           12

034           1234         FG            1 .............

 

Second one "INTERS" was created from intersection of polygons from first one (like in the picture)

ID1           ID2         SUM

123           456         45,65

789           034          20

 

My intention is to make SHP like this:

ID        CODE        ALP         NUM            SUM   

123      0303          AB           23                 45,65

456         0303         BF           34               45,65

789          1234         AC          12               20.......

 

Basically two polygons are intersecting and creating new shape with attributes which I wanna get together, bcs I dont have access to originally created intersected shape.

So I need to create shape where I get together ID with belonging CODE ALP and NUM but with identifying which SUM belongs to it from the second shape.

I am thinking about Union, but is there any better option?

0 Kudos
2 Replies
DavidPike
MVP Frequent Contributor

Just a table join, first on ID to ID1, then on ID to ID2? Then just clean it up at the end by creating a new field and field calculating the concatenation e.g. str(!ID1!) + str(!ID2)

0 Kudos
StanislavaV
Occasional Contributor

but what if there are attributes like this:

for example ID 123 has more CODEs with ALP and NUM.

ID          CODE        ALP         NUM

123        0303          AB           23

456         0303         BF            34

789          1234         AC           12

123         1203          GF           11

034         1203           AD           12

 

then ID 123 has more polygons in shp INTERS.

ID1           ID2         SUM

123           456         45,65

789           034          20

123            034          5

 

So final SHP:

ID        CODE        ALP         NUM            SUM   

123      0303          AB           23                 45,65

456         0303         BF           34               45,65

123         1203          GF          11                5

034          1203          AD         12                5

789          1234         AC          12               20          

0 Kudos