[pdal] write an in-memory array of points to a writer ... using Python bindings

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[pdal] write an in-memory array of points to a writer ... using Python bindings

mrosen
Can we use the Python Bindings to create a LAS file from values we hold in Memory?  In my case, I'm using the HDF Python library to read a .h5 file and need to convert the results to LAS.

In the Writing with PDAL documentation, Bradley Chambers shows how to do this in C++ ... but it looks like we're missing some machinery to do it via Python.

In the test for the Python Bindings, we see how to write the output from a filter to an array ... but not the other way around.

msr

_______________________________________________
pdal mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pdal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pdal] write an in-memory array of points to a writer ... using Python bindings

Adam Steer
Hi Michael

might LASpy help?

http://laspy.readthedocs.io/en/latest/tut_part_1.html

I also need to cross this bridge sometime really soon - and I’m also interested in a PDAL answer, if one exists.

Regards

Adam


> On 20 Apr 2017, at 9:29 am, Michael Rosen <[hidden email]> wrote:
>
> Can we use the Python Bindings to create a LAS file from values we hold in Memory?  In my case, I'm using the HDF Python library to read a .h5 file and need to convert the results to LAS.
>
> In the Writing with PDAL documentation, Bradley Chambers shows how to do this in C++ ... but it looks like we're missing some machinery to do it via Python.
>
> In the test for the Python Bindings, we see how to write the output from a filter to an array ... but not the other way around.
>
> msr
> _______________________________________________
> pdal mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/pdal

_______________________________________________
pdal mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pdal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pdal] write an in-memory array of points to a writer ... using Python bindings

Howard Butler-3
In reply to this post by mrosen

On Apr 19, 2017, at 6:29 PM, Michael Rosen <[hidden email]> wrote:

Can we use the Python Bindings to create a LAS file from values we hold in Memory?  In my case, I'm using the HDF Python library to read a .h5 file and need to convert the results to LAS.

In the Writing with PDAL documentation, Bradley Chambers shows how to do this in C++ ... but it looks like we're missing some machinery to do it via Python.

In the test for the Python Bindings, we see how to write the output from a filter to an array ... but not the other way around.

Not at this time, but it's been on my queue for Python stuff. I filed a ticket at https://github.com/PDAL/PDAL/issues/1573 on the topic.

Part of the reason it isn't done yet is I haven't been sure how it would work. There's a few challenges

- We aren't going to do IPC, so the only way it could be used is in Python extension scenarios https://pypi.python.org/pypi/pdal . 
- PDAL has explicitly named dimensions https://www.pdal.io/dimensions.html and Numpy has array names. The user is going to have to map their arrays to known PDAL names or things will be quite mushy, especially when translating to other formats.
- Unsure what to do about multiple arrays at once, but I presume we'll just disallow it for starters
- Metadata, SRS, and  construction and assignment 

None of this is too difficult, but there's still a significant effort required to complete it.

Howard

_______________________________________________
pdal mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pdal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pdal] write an in-memory array of points to a writer ... using Python bindings

mrosen
Thanks for the explanation. One  alternative might be to add an HDF reader / writer.   Thoughts on the feasibility of this?  Thoughts on using the official HDF library vs leveraging the implementation in GDAL (which I assume is different) ?
On Thu, Apr 20, 2017 at 7:52 AM Howard Butler <[hidden email]> wrote:

On Apr 19, 2017, at 6:29 PM, Michael Rosen <[hidden email]> wrote:

Can we use the Python Bindings to create a LAS file from values we hold in Memory?  In my case, I'm using the HDF Python library to read a .h5 file and need to convert the results to LAS.

In the Writing with PDAL documentation, Bradley Chambers shows how to do this in C++ ... but it looks like we're missing some machinery to do it via Python.

In the test for the Python Bindings, we see how to write the output from a filter to an array ... but not the other way around.

Not at this time, but it's been on my queue for Python stuff. I filed a ticket at https://github.com/PDAL/PDAL/issues/1573 on the topic.

Part of the reason it isn't done yet is I haven't been sure how it would work. There's a few challenges

- We aren't going to do IPC, so the only way it could be used is in Python extension scenarios https://pypi.python.org/pypi/pdal . 
- PDAL has explicitly named dimensions https://www.pdal.io/dimensions.html and Numpy has array names. The user is going to have to map their arrays to known PDAL names or things will be quite mushy, especially when translating to other formats.
- Unsure what to do about multiple arrays at once, but I presume we'll just disallow it for starters
- Metadata, SRS, and  construction and assignment 

None of this is too difficult, but there's still a significant effort required to complete it.

Howard

_______________________________________________
pdal mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pdal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pdal] write an in-memory array of points to a writer ... using Python bindings

Howard Butler-3
The readers.icebridge driver is already using HDF5. The problem is every HDF5 file is potentially a different layout/schema, and coming up with a way to define those things might be tough.

 
On Apr 20, 2017, at 10:59 AM, Michael Rosen <[hidden email]> wrote:

Thanks for the explanation. One  alternative might be to add an HDF reader / writer.   Thoughts on the feasibility of this?  Thoughts on using the official HDF library vs leveraging the implementation in GDAL (which I assume is different) ?
On Thu, Apr 20, 2017 at 7:52 AM Howard Butler <[hidden email]> wrote:

On Apr 19, 2017, at 6:29 PM, Michael Rosen <[hidden email]> wrote:

Can we use the Python Bindings to create a LAS file from values we hold in Memory?  In my case, I'm using the HDF Python library to read a .h5 file and need to convert the results to LAS.

In the Writing with PDAL documentation, Bradley Chambers shows how to do this in C++ ... but it looks like we're missing some machinery to do it via Python.

In the test for the Python Bindings, we see how to write the output from a filter to an array ... but not the other way around.

Not at this time, but it's been on my queue for Python stuff. I filed a ticket at https://github.com/PDAL/PDAL/issues/1573 on the topic.

Part of the reason it isn't done yet is I haven't been sure how it would work. There's a few challenges

- We aren't going to do IPC, so the only way it could be used is in Python extension scenarios https://pypi.python.org/pypi/pdal . 
- PDAL has explicitly named dimensions https://www.pdal.io/dimensions.html and Numpy has array names. The user is going to have to map their arrays to known PDAL names or things will be quite mushy, especially when translating to other formats.
- Unsure what to do about multiple arrays at once, but I presume we'll just disallow it for starters
- Metadata, SRS, and  construction and assignment 

None of this is too difficult, but there's still a significant effort required to complete it.

Howard


_______________________________________________
pdal mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pdal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [pdal] write an in-memory array of points to a writer ... using Python bindings

Adam Steer
I've wondered if it would be too onerous to supply a mapping document for generic HDF5/NetCDF4 io - for example:

pdal translate in.hdf5 out.laz —hdf5-dimension-to-pdal-dimension-map=‘hdf5map.json’

pdal translate in.laz out.hdf5 —hdf5-dimension-to-pdal-dimension-map=‘hdf5map.json’

since netCDF4 is a specific way of writing a HDF5 file, using an appropriate map-of-dimensions and naming the result ‘out.nc’ might work.

would it need to tackle internal chunking? maybe. And likley more things I have not considered.

_______________________________________________
pdal mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/pdal
Loading...