[pgpointcloud] resampling

Paul Ramsey pramsey at cleverelephant.ca
Tue Nov 26 15:28:19 PST 2013


Marian,  

There's nothing in the database at the moment that explicitly addresses the problem of re-sampling. One possibility might be to explode the points and then filter them randomly out of the patch.

Something like

WITH points AS (
SELECT pc_explode(pa) AS pt, int4(100*random()) AS rand
FROM mytable
)
SELECT pt  
FROM points
WHERE rand = 50;

to get every 1 point out of every 100.

You'll still end up scanning all the patches and points, but at least you'll only send 1% of them to your viewer client.

P  

--  
Paul Ramsey
http://cleverelephant.ca
http://postgis.net


On Friday, November 22, 2013 at 5:46 AM, Marian Peña wrote:

>  
> Hi all,
>  
> I am currently working with pointcloud in order to plot multibeam data (very dense). I have my database in postgis and call it from a java jar (based on the NASA worldwind jar) that implements sql calls.  
>  
> First of all, I do PC_Explode the patches before plotting as I am not sure how to use the pcpatches in java, but this would probably speed the loading. My sql code to get points from the database with the 4th dimension between -60 and -40 is:
>  
> SELECT ST_SetSRID(ST_MakePoint(pc_get(points.point,'x'),pc_get(points.point,'y'),pc_get(points.point,'z'),pc_get(points.point,'m')),4326)
> FROM (
> SELECT pc_explode(PC_FilterBetween(pa, 'm', -60, -40)) AS point
> FROM database as rps
> ) as points
>  
>  
> And the java jar plots this with:
>  
> final Point pt = (Point)geom.getGeometry();
> final MarkerAttributes attr = new BasicMarkerAttributes(plotcolors(pt.m), BasicMarkerShape.SPHERE, 1d, 2, 2);
>  
>  
> The point cloud is very dense, and moving the figure around is very slow at close zoom level. I thought that resampling would help but I have no idea how to do that (though I would like to keep the resolution as much as possible).  
>  
> Any help is welcomed!  
> Marian
>  
> Ps: I am quite new in sql/postgis/java as you can notice!
>  
>  
>  
> _______________________________________________
> pgpointcloud mailing list
> pgpointcloud at lists.osgeo.org (mailto:pgpointcloud at lists.osgeo.org)
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/pgpointcloud





More information about the pgpointcloud mailing list