Reduce points in Point feature from a 30 meter DEM raster

6630
23
Jump to solution
11-09-2015 03:48 PM
ChrisMartin9
New Contributor II

I have created a point feature from a 30 meter DEM raster and I would like to reduce the number of points (decimate) - the number of points are too large to manage. Is there a toolbox for this or can this be done with the select attribute tool. Thanks.

0 Kudos
1 Solution

Accepted Solutions
IanMurray
Frequent Contributor

Another option is to simply resample the raster down to an even lower resolution before converting to points.

View solution in original post

23 Replies
DanPatterson_Retired
MVP Emeritus

probably many options, but you could add a field to the table and calculate a random number for the field , then select the number of features you want.  If you want to do a rondom-y stratified-ish sample, you could calculate add a field and use the field calculation on either the X and/or Y

!shape!.centroid.X % 2     ( I think)  which will calculate a binary value indicating whether the coordinate is even or odd...then query out your choise and save them.  So decide whether you need random, random with a minimum number of samples, points with a minimum spacing etc etc.

Field calculations are here if you need examples.  Calculate Field examples—Help | ArcGIS for Desktop

0 Kudos
DuncanHornby
MVP Notable Contributor

I don't think this is really a Python question, more of a geo-processing problem (python being one solution).

Assuming you have a Shapefile then your row id is "FID". The following Where clause can be used in the Select by Attribute and it will select the first and every tenth row:

"FID" / 10 = round( "FID"/10,0) or "FID" = 1

If your dataset is a geodatabase feature class then substitute FID with ObjectID.

You can then either delete these or invert the selection and delete out the batches of 9 rows. If the second option is what you want it will be quicker to simply export the selected 10th rows.

DanPatterson_Retired
MVP Emeritus

Duncan, I didn't mean to suggest it was a python problem, however, python in the field calculator etc allows for builtin random module access making random number generation easier etc.

0 Kudos
DuncanHornby
MVP Notable Contributor

Dan, I was not thinking your answer was unsuitable more that the original question is located under the python discussion board and that it is seems more suited to the general geo-processing page. If I had the power I would be moving it into that section.

0 Kudos
ChrisMartin9
New Contributor II

Duly noted but I was originally considering applying a Python script to execute this. I couldn't figure out the code to use in 'select by attribute' to delete rows in the table.

Thanks for your help.

0 Kudos
DuncanHornby
MVP Notable Contributor

Chris, If Dan's or my suggestion solves your problem you should tick it as such, shows to others a solution was found and we get lots of lovely points!

0 Kudos
ChrisMartin9
New Contributor II

Duncan,

I'm going to try this. I assume I need to start an edit session in order to delete the records in the attribute table?

0 Kudos
DuncanHornby
MVP Notable Contributor

You can or you can simply use the Delete Features geoprocessing tool! A warning about this tool, if no selection exists then it Deletes EVERYTHING and there is no undo for this tool! So if you are building a model to run this many times it would be sensible to put in a GetCount and use that as a precondition to the Delete Features tool, otherwise you may end up shooting yourself in the foot.

0 Kudos
ScottFraser3
New Contributor III

This was a great help.

  1. "FID" / 10 = round( "FID"/10,0) or "FID" = 1 

I just adjusted the "10" counts until I got the spread I was seeking, which ended up being "6".

Sweet!

0 Kudos