Skip to main content
Question

Getting list of Names that occur the most in each polygon


Forum|alt.badge.img

Basically I have a linear featureclass and a polygon featureclass that overlap in areas. Every line has a Name attribute. I'm trying to determine the best way to find all lines in a polygon and list the Name that occurs the most. I used a LineOnAreaOverlay along with StatisticsCalculator but I'm not getting the correct results. Any ideas to a better approach? thx

 

5 replies

ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • June 27, 2019

I would use a spatial relator to find lines that intersect polygons, build a list with the names inside this transformer then a listhistogrammer to find the most common value. This leaves all your original geometries untouched


Forum|alt.badge.img
ebygomm wrote:

I would use a spatial relator to find lines that intersect polygons, build a list with the names inside this transformer then a listhistogrammer to find the most common value. This leaves all your original geometries untouched

Thanks egomm, so in setting up the spatialrelator would the polygons be the supplier and lines the requestor or vice versa? spatial predicates to test would then be the "Name" column of my lines I guess? well i guessed wrong, error. hmm


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • June 27, 2019
jvickrey656 wrote:

Thanks egomm, so in setting up the spatialrelator would the polygons be the supplier and lines the requestor or vice versa? spatial predicates to test would then be the "Name" column of my lines I guess? well i guessed wrong, error. hmm

The polygons would be the requestor and the lines the supplier. The test would be requestor intersects supplier


Forum|alt.badge.img
ebygomm wrote:

The polygons would be the requestor and the lines the supplier. The test would be requestor intersects supplier

Thanks, this is getting closer but my guess is it's using the line length instead of tallying the amount of times a line occurs. thoughts?


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • June 27, 2019
jvickrey656 wrote:

Thanks, this is getting closer but my guess is it's using the line length instead of tallying the amount of times a line occurs. thoughts?

If you inspect the outcome of the list histogrammer you should find a further list, which by default starts with _histogram. This list contains the number of times a value occurs and the value. It's this value you'll need to extract

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings