You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i couldn't find documentation so far. My problem is that i have a dataset that can be converted to a pointcloud. I do the conversion as follows:
deftoPointCloud(sweeps: Seq[Tuple3[Coordinate, Double, Seq[XZ]]]):PointCloud= {
// the Double in the tuple3 is the azimuth.valpoints= sweeps.map(gs => projectSweep(gs._3, gs._2, gs._1)).
reduce((a,b) =>DenseMatrix.horzcat(a,b))
varv=new util.HashMap[String, SizedDimType]()
v +="X"->SizedDimType(DimType.X, java.lang.Double.BYTES, 0)
v +="Y"->SizedDimType(DimType.Y, java.lang.Double.BYTES, java.lang.Double.BYTES)
v +="Z"->SizedDimType(DimType.Z, java.lang.Double.BYTES, 2*java.lang.Double.BYTES)
valbos=ByteBuffer.allocate(points.cols * points.rows * java.lang.Double.BYTES).order(ByteOrder.nativeOrder());
valios= bos.asDoubleBuffer();
ios.put(points.copy.data)
returnnewPointCloud(bos.array(), v)
}
i verified and the pointcloud seems to be okay (i can get points out of it). I'd like to create a PDAL pipeline now using this pointcloud so that i can reproject/persist/... it.
Hey @kervel, so what is your question? How to use PDAL Pipeline, or how to transform points already loaded into memory?
If the first question, than you can do the following:
valpc:PipelineConstructor=LasRead("/path/to/las") ~CropFilter() ~SmthElse() ~LasWrite("/path/to/new/las")
valpipeline= pc.toPipeline
pipeline.execute()
pipeline.getMetadata() // gets some metadatavalpvi= pipeline.getPointViews() // these are PDAL PointViews, views to get the actual pointcloudsvalpc= pv.getPointCloud(0, Array(DimType.X, DimType.Y)) // this one will create a PointCloud object with the point 0 and x & y dims
pipeline.dispose()
In the example above we'll push the Pipeline to PDAL, it would process it, and return already transformed points.
yes. i was hoping to use pdal to rasterize a pointcloud that i constructed using spark scala code (i have seen TinToDem also in geotrellis but for that i wouldn't even have to construct a pointcloud).
all the existing pdal examples start by loading an existing pointcloud from disk, and hence never face this problem...
yea, so PDAL Pipeline interface only allows to perform transformations on read. So it is a sort of an IO interface in this case that allows to do transofmrations with pointclouds right after reading them from file.
PDAL does not expose an interface to provide some pointclouds represented as some in memory buffer as an input for PDAL Pipeline.
For your purposes for sure it is better to use TinToDem from geotrellis-pointcloud, it uses a nice delaunay triangulation implementation to perform it, so it may work.
I'm happy to help you with it! (if you would decide to touch geotrellis-pointcloud)
Activity
pomadchin commentedon Oct 25, 2019
Hey @kervel, so what is your question? How to use PDAL Pipeline, or how to transform points already loaded into memory?
If the first question, than you can do the following:
In the example above we'll push the Pipeline to PDAL, it would process it, and return already transformed points.
If you want to do smth else with your pointclouds I would be happy to help you to start with https://github.com/geotrellis/geotrellis-pointcloud which exposes PDAL capabilities on Spark.
pomadchin commentedon Oct 25, 2019
Ah, or you want to create a pointcloud object and to return back to PDAL to process it?
kervel commentedon Oct 25, 2019
yes. i was hoping to use pdal to rasterize a pointcloud that i constructed using spark scala code (i have seen TinToDem also in geotrellis but for that i wouldn't even have to construct a pointcloud).
all the existing pdal examples start by loading an existing pointcloud from disk, and hence never face this problem...
pomadchin commentedon Oct 25, 2019
yea, so PDAL Pipeline interface only allows to perform transformations on read. So it is a sort of an IO interface in this case that allows to do transofmrations with pointclouds right after reading them from file.
PDAL does not expose an interface to provide some pointclouds represented as some in memory buffer as an input for PDAL Pipeline.
For your purposes for sure it is better to use TinToDem from geotrellis-pointcloud, it uses a nice delaunay triangulation implementation to perform it, so it may work.
I'm happy to help you with it! (if you would decide to touch geotrellis-pointcloud)
abellgithub commentedon Oct 26, 2019
See https://pdal.io/stages/readers.memoryview.html
pomadchin commentedon Oct 26, 2019
Nice! Thanks for the pointer @abellgithub, I need to look into it.
pomadchin commentedon Oct 28, 2019
This probably would be done in terms of a 2.0 release.
[-]pipeline from scala-constructed pointcloud[/-][+]Pipeline from scala-constructed pointcloud[/+]