I have a large set of points and need to determine the individual point with the maximum value for a given attribute within 12 km quadrants and extract these to a separate shp. Currently, I have nothing but the points so the quadrants would need to be generated.

I am relatively new to GIS so my efforts have not shown any progress. How can I accomplish this?

  • 2
    Hi and welcome to GIS:SE. You can check out the tour to familiarize yourself with the site. If you can edit your question and include as much information as possible (for example what you have tried already) it will greatly help in getting good answers. – Gabriel C. Jan 10 at 20:15
  • 1
    Do the 12km quadrants already exist as features, or do you need to generate them? Please edit your question to specify. – Andy Jan 10 at 20:47
  1. Create Fishnet. Use Points at template extent, a cell size and width of 12 km and output polygons.
  2. Intersect Points with fishnet to get a new Point fc including all fishnet attributes
  3. Summary Statistics with max value field as Statistics field with statistics type MAX, and case field fishnet id, to create a table of max Point value per fishnet cell

Or use arcpy on output from 2 above to find and select highest value Point per fishnet id:

import arcpy

points_inter_fishnet_fc = 'bt_riks_Intersect_fishnet' #Change
fishnet_id_field = 'FID_Fishnet_100km' #Change
valuefield = 'BEF' #Change

all_values = [i for i in arcpy.da.SearchCursor(points_inter_fishnet_fc,[fishnet_id_field,'OID@',valuefield])]
all_values.sort(key=lambda x: x[2])
max_per_oid = {j[0]:j[1] for j in all_values}

sql = """{0} IN{1}""".format(
    arcpy.AddFieldDelimiters(points_inter_fishnet_fc, arcpy.Describe(points_inter_fishnet_fc).OIDFieldName)


enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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