Question

Getting list of Names that occur the most in each polygon


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

Userlevel 1
Badge +21

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

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

Userlevel 1
Badge +21

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

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?

Userlevel 1
Badge +21

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

 

Reply