I've got a point layer with three values such as high, age etc. and polygon layer with many forest area. What I want to do is to select the 100 maximum (highest) points in every polygon.

I can't do it normally because I've got something like 10,000,000 points and over 10,000 polygons.

I'm using ArcGIS 10.2.2. for Desktop Standard, QGIS 2.8.6 and global mapper. I'm looking for an answer not in every software. I need just a solution. It could be even in different software such as Access. I already have in point layer column with polygons ID. But it is just too many of them.

  • 1
    So you want to select all the points in a polygon, then sort by height and select the 100 largest, for each polygon?
    – Ian Turton
    Feb 16, 2016 at 10:55
  • That's right. Do you know how to do that?
    – Losbaltica
    Feb 16, 2016 at 11:09
  • no, I was just clarifying
    – Ian Turton
    Feb 16, 2016 at 11:17
  • Right now this is three questions (one for each software package). Please edit the question to choose one GIS package. If you want an ArcGIS solution please specify the exact version in use.
    – Vince
    Feb 16, 2016 at 12:34
  • 1
    If you already have polygon ID on points, you're just a join away from being ready for statistics. Why did you stop doing this "normally"?
    – Vince
    Feb 16, 2016 at 12:45

1 Answer 1


A python/arcpy script would be the route I would suggest for this process. The general code statement flow would go something like this:

  1. Use Add Field method to add top100 field name to point layer
  2. Use Make Feature layer method on point layer and polygon layer
  3. Use arcpy da search cursor on point layer
  4. Within cursor loop use Select Layer by Attribute on current polygon row (e.g. current id value)
  5. Next, use Select Layer by Location to select all points that intersect selected polygon feature
  6. Add the selected feature values to a dictionary of key value pairs (key = unique point id field value in table, and value = height field value) sort the representation of the dict by height value and do a slice on it to keep the top 100
  7. Next, nest arcpy da update cursor (within search cursor) to do if conditional evaluation against the key values. If id key == point id value then populate pointRow = "point id = {} yes".format(pointRowValue) into the top100 field
  8. Continue looping...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.