Help Model Builder for a research project

965
5
08-12-2021 02:17 PM
SergeJolicoeur
New Contributor II

Hello, I am currently working on a saltmarshes mapping project and each habitat interface is a unique polyline. I want to generate polygons with the information contained in the polylines. On the other hand, the information contained in the polylines is all different and I cannot just check the "keep attributes" during the conversion. The way I thought to find the right information to keep is to select all the lines that touch the polygon and see which habitat comes up most often. This is the one that will be the information to keep.

Because I have like 20 000 lines (and get like 5000 polygons), that needs to be done with a Model Builder. 

In the attached files, I made a sketch to explain my idea to you and a model I made so far (i'm a beginner with model builder and Python).

Thank you so much !

0 Kudos
5 Replies
DavidPike
MVP Frequent Contributor

Can you just do a spatial join instead (using a join merge rule in the field mapping) then use field calculator or something to sort out the most common occurence after?

0 Kudos
SergeJolicoeur
New Contributor II

Hi David, thank you for your answer. I tried with the join merge rule but for a lot of polygons, the maximum of 255 caracters is exceed so it cant aggregate the names of all the polylines that touches the boundaries of one polygone. I would try the merge rule mode but it only works with numbers. That would have been perfect for what I want to do.

0 Kudos
DavidPike
MVP Frequent Contributor

Hi Serge,  I guess you could assign a number to your attribute in a new field then use Mode, but you can just change the maximum field length to whatever you want and that would solve the issue.  Ensure it's a feature class in a file geodatabase and not a shapefile.  

0 Kudos
SergeJolicoeur
New Contributor II

I tried but it still a lot of manual work because I have a lot of unique variable to assign a number to. And it needs to convert the numbers to the attribute after the trick with Mode. But thanks, I'll try to find a way to make it work!

0 Kudos
DavidPike
MVP Frequent Contributor

and changing the field length from 255?

0 Kudos