I am working with PostgreSQL and PostGIS and handling a very large geom dataset. My goal is to subsample the data similarly to PCD (point cloud) subsampling, selecting representative points every 10 meters while keeping actual values.
I have considered:
ST_ClusterDBSCAN() → Scans the entire dataset, which is inefficient for my case. ST_SnapToGrid(geom, 10) → Does not select representative points but adjusts them to a grid. To achieve my goal, I wanted to use ST_Resample(), but I found that it only works with raster data and not geom.
Why does ST_Resample() work only with raster and not with geom? Is there an equivalent function or method for resampling geom data at fixed intervals (e.g., 10m) while preserving real values?
ST_ClusterDBSCANindeed a powerful tool for the general case - for points only, creating a grid throughST_SnapToGridcan work just as well.ST_ClusterDBSCANto cluster your points and extract their centroids - their location depends on the actual distribution of your points; 2) useST_SnapToGridto griddify your points - the resulting points will be regularly distributed in grid cells. Do you have a preference? Note that in both cases, your point coordinates need to be referenced in a suitable projection for your AOI that uses meter as unit!