I am trying to use the Spaghetti and Meatballs overlay technique to create a fire history layer from Cal Fire FRAP's fire perimeter data. I am following the technique Dale Honeycutt describes in his ESRI blog post. However, at the spatial join part, instead of doing a one to one join, I am performing a one to many join. This then gives me multiple points with the same "Target FID" value, but different values for Name and Year of Fire. His next blog then goes into detail on how to combine the points with repeating "Target FID" values into one point with a string of values for both the Name and Year of Fire columns. However, that blog seems to no longer exist.
Essentially what I am trying to do is take data that looks like this:
Target_FID Fire_Name Fire_Year
2 Otay 1953
2 Wheeler 1989
2 Thomas 2017
To look like this:
Target_FID Fire_Name Fire_Year
2 Otay_Wheeler_Thomas 1953_1989_2017
Answer
In fact this is a variation of https://gis.stackexchange.com/a/280415/28687, except it requires an additional step and is also answered elsewhere. For completeness sake, I am copying here the Luke's answer:
- Union the shapefile with itself (introduce only one input, which is the feature class/layer that you are processing);
- Convert multipart output to single part;
- Use the spatial join tool by use the ARE_IDENTICAL_TO match option and [Additional step to merge the attributes] by using field mapping option. In your case make sure
Fire_Name
andFire_Year
fields are String field type and set a relatively large field length (based on the length of the string of attributes once concatenated), say 500. Lastly set your mapping Merge Rule to Join and define underscore as the delimiter (see below a snip from https://esriaustraliatechblog.files.wordpress.com/2015/05/spjoin_05.jpg where the delimiter is,|
).
No comments:
Post a Comment