Skip to main content
Question

Getting list of Names that occur the most in each polygon

  • June 27, 2019
  • 5 replies
  • 35 views

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

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • 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
  • Author
  • 14 replies
  • 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

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+44
  • Influencer
  • 3427 replies
  • June 27, 2019

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
  • Author
  • 14 replies
  • June 27, 2019

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+44
  • Influencer
  • 3427 replies
  • June 27, 2019

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