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.
Another option is to simply resample the raster down to an even lower resolution before converting to points.
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
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.
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.
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.
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.
That's perfect. How do I resample the raster?
Sent from my iPhone
See this tool help.
ArcGIS Help 10.1
Ian,
It looks like this will work!
Thanks.
Or you could create a new attribute (call it modulo) and populate it with a modulo value using the Object ID and a value of say 10, then select all the records with a modulo value of 0 and and export only those records ( 1/10th of those originall records) to a CSV. That way you could preserve the original point values of the 30 m DEM and not end up with the point values of the resampled surface.
spatial sampling or attribute sampling has already been suggested, apparently, preservation of the original attributes does not appear to be the main criterion, the need for file size reduction by an aggregation is sufficient should that be the over-riding factor
This was a great help.
I just adjusted the "10" counts until I got the spread I was seeking, which ended up being "6".
Sweet!
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.