I have a feature class with over 5000 points. There are too many to label so I would like to be able to grab the first, the last and every 30th or 50th in between.

  • 1
    What software are you using? I do not see any tags or any information concerning that. – Jamie Mar 19 '13 at 18:12
  • THAT WORKS GREAT!!! I was wrestling with this issue all day. However it uncovered a much harder problem to solve: the polygons I am trying to isolate are not numbered in a pattern that would result in a uniform grid. Figuring out how to force this is goign to be an interesting exercise. – user20513 Jul 27 '13 at 22:26
  • this is not an answer. please restrict comments to the comments sections and either edit the original post or mark answers as complete (select the checkbox). – Brad Nesom Jul 28 '13 at 0:44

If you're using ArcMap, you can use a SQL query to select a subset of features to label, as long as you have the "Define classes of features and label each class differently" method selected (rather than "Label all features the same way").

To display the labels for the first record and every nth one after that, you'll have to create a class with a SQL query like this: MOD("OBJECTID"-1, n) = 0, where n is replaced by the number of features you want to skip, and "OBJECTID" is the name of the OID field of your data. The -1 is what ensures the first record is displayed, since the OID field typically starts numbering at 1, not 0.

I'm not sure how you'd ensure the last record gets labeled in addition to these, though.

Edit: I suppose a hack-y way to include the last record would be to add an OR "OBJECTID" = m to the end of the expression, where you figure out what m should be by selecting "OBJECTID" in the field list and clicking "Get Unique Values", then scrolling to the bottom and seeing what the maximum value is. Obviously, this would have to be done separately for each layer you're trying to label this way.

Screenshot of Labels pane of Layer Properties, with SQL query for displaying every 20th record.

  • 1
    that would assume that your oid is in the order. of the objects straight down the line. – Brad Nesom May 30 '13 at 20:10

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.