Select to view content in your preferred language

decrease density of points

2283
6
02-19-2014 10:32 AM
JustinWhisenant
Emerging Contributor
If I have a point feature class with about 1 million points that are spread one meter apart each, how can I EVENLY reduce the density of these points by about an order of magnitude?

I tried selecting every 10th record, but this did not evenly select the points spatially.  Some areas were denser with points than others despite the total number of points selected being correct. 

This is how I selected every 10th point :

arcpy.SelectLayerByAttribute_management("PointsFC","NEW_SELECTION","""MOD( "pointid",10) = 0""")


Can sombody tell me a method to do this spatially rather than just using the sequential pointid field?  Thanks.
Tags (2)
0 Kudos
6 Replies
JoshuaChisholm
Frequent Contributor
Are your original points evenly spatially distributed?

You could randomly take a subset of points, but that wouldn't be evenly distributed.

Alternatively, you could convert your points to a grid (something like point to raster) and then convert the raster back to points (raster to point). You would have to play with the cell size to make sure you got the right number of raster cells (which would be converted back to points). This method would mean you have a new set of points.

Let me know if that is at all sufficient.
0 Kudos
JustinWhisenant
Emerging Contributor
Are your original points evenly spatially distributed?

You could randomly take a subset of points, but that wouldn't be evenly distributed.

Alternatively, you could convert your points to a grid (something like point to raster) and then convert the raster back to points (raster to point). You would have to play with the cell size to make sure you got the right number of raster cells (which would be converted back to points). This method would mean you have a new set of points.

Let me know if that is at all sufficient.




These points originally came from a DEM that gets reprojected before being converted to points.  I could change the output cell size when projecting (Is bilinear best for this?).  I was, however, hoping to find a way to select a subset of points based on an even spatial distribution.
0 Kudos
JoshuaChisholm
Frequent Contributor
Ok, this might be a little sloppy, but you could take the resulting points FC (from the raster to point tool) and use the near tool on it. Then each of your points (on a perfect grid) would find the nearest point form your original points.

You would then have to join the points from the grid (with appended nearest point information) to the original points (NEAR_FID to FID). Make sure you only keep matching records (join_type="KEEP_COMMON") or you'll end up right where you started.

Let me know if that made any sense.
0 Kudos
JustinWhisenant
Emerging Contributor
Oh man, I like that.  Unfortunately, I have Desktop Standard not Advanced, so I cannot use the Near tool.  I cannot believe this is not part of the Spatial Analyst extension.  How much money does it take esri?
0 Kudos
NeilAyres
MVP Alum
You might consider just calculating a new centre X & Y for your new cell size like :
CentX = int(X / NewCellSize) * NewCellSize + NewCellSize / 2

ditto for the Y. Then you could summarise your data across these new XY's. Get the average of all the input points or something.
Good luck,
Neil
0 Kudos
JoshuaChisholm
Frequent Contributor
Justin,
There are free and open source alternatives to ESRI's near tool (see this forum). I've played around a bit with open source before. It takes a long time to learn to use to the environment and figure out the tools.
Good luck either way!
0 Kudos