[Liblas-devel] How to use a cached reader (c++)

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

[Liblas-devel] How to use a cached reader (c++)

Helimap Postmaster
Hello!

I am currently developing an application which would benefit from using a buffer when reading a las file.

The C++ API has a CreateCached method in the ReaderFactory, but I can't seem to discover which is the intended way to use it, there's no reference anywhere on the documentation, and actually no other method calls it.

Is it as simple as

liblas::ReaderFactory readerFactory;
boost::uint32_t cache_size = 1000;
liblas::Reader reader(lasFStream, cache_size);



Cheers

Pol


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

Re: [Liblas-devel] How to use a cached reader (c++)

Howard Butler-3

> On Mar 14, 2016, at 9:54 AM, Helimap Postmaster <[hidden email]> wrote:
>
> Hello!
>
> I am currently developing an application which would benefit from using a buffer when reading a las file.
>
> The C++ API has a CreateCached method in the ReaderFactory, but I can't seem to discover which is the intended way to use it, there's no reference anywhere on the documentation, and actually no other method calls it.
>
> Is it as simple as
>
> liblas::ReaderFactory readerFactory;
> boost::uint32_t cache_size = 1000;
> liblas::Reader reader(lasFStream, cache_size);

Pol,

I would suggest if you are starting fresh with including LAS reading into your software that you start with either PDAL http://pdal.io or LASlib https://github.com/LAStools/LAStools/tree/master/LASlib

For LAS files, PDAL is going to allow you to read in a one-at-a-time streamed fashion or as a giant single buffer. It of course also supports LASzip and many other point cloud format types.

Thanks,

Howard

PS libLAS is now in "maintenance mode" and should only be used by projects that have historically used it in the past. If you are doing new things, you should use PDAL or look to other things like LASlib
_______________________________________________
Liblas-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/liblas-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Liblas-devel] How to use a cached reader (c++)

Helimap Postmaster
Good morning Howard,

This is precious information. I was unaware on liblas being under revision, I'm glad you told me. I'll follow up the pointers you gave, they look promising.

Thank you again,

Pol

On Mon, Mar 14, 2016 at 8:29 PM, Howard Butler <[hidden email]> wrote:

> On Mar 14, 2016, at 9:54 AM, Helimap Postmaster <[hidden email]> wrote:
>
> Hello!
>
> I am currently developing an application which would benefit from using a buffer when reading a las file.
>
> The C++ API has a CreateCached method in the ReaderFactory, but I can't seem to discover which is the intended way to use it, there's no reference anywhere on the documentation, and actually no other method calls it.
>
> Is it as simple as
>
> liblas::ReaderFactory readerFactory;
> boost::uint32_t cache_size = 1000;
> liblas::Reader reader(lasFStream, cache_size);

Pol,

I would suggest if you are starting fresh with including LAS reading into your software that you start with either PDAL http://pdal.io or LASlib https://github.com/LAStools/LAStools/tree/master/LASlib

For LAS files, PDAL is going to allow you to read in a one-at-a-time streamed fashion or as a giant single buffer. It of course also supports LASzip and many other point cloud format types.

Thanks,

Howard

PS libLAS is now in "maintenance mode" and should only be used by projects that have historically used it in the past. If you are doing new things, you should use PDAL or look to other things like LASlib


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

Re: [Liblas-devel] How to use a cached reader (c++)

Helimap Postmaster
Hello Howard,

I have a couple questions for you, regarding the pdal library. It reminds me of ITK.

For now I won't use the pipeline-style, given that it would take a while to refactor the ulterior processing. I will most definitely consider it, thought.

At the moment I am looking for a read into a std::vector with either the full las cloud or a buffered read of chunk_size size. Reading point by point is very inefficient, more so on network drives. Looks like cached liblas does that, but doesn't make the vector accessible. It is convenient for me to have chunks or the full cloud given that afterwards I do the processing for each point in a openmp for. Of course chunks is better, given that occasionally the clouds won't fit in memory.

Getting to pdal, there isn't much documentation on the pdal c++ API, is there? (e.g. http://www.pdal.io/api/cpp/reader.html ) What methods does the reader class provide? Are they thread-safe? You state pdal is not parallelized, but can I use the reader in parallel? Does it buffer, and can I have access to the buffer?

Cheers,

Pol



On Tue, Mar 15, 2016 at 9:24 AM, Helimap Postmaster <[hidden email]> wrote:
Good morning Howard,

This is precious information. I was unaware on liblas being under revision, I'm glad you told me. I'll follow up the pointers you gave, they look promising.

Thank you again,

Pol

On Mon, Mar 14, 2016 at 8:29 PM, Howard Butler <[hidden email]> wrote:

> On Mar 14, 2016, at 9:54 AM, Helimap Postmaster <[hidden email]> wrote:
>
> Hello!
>
> I am currently developing an application which would benefit from using a buffer when reading a las file.
>
> The C++ API has a CreateCached method in the ReaderFactory, but I can't seem to discover which is the intended way to use it, there's no reference anywhere on the documentation, and actually no other method calls it.
>
> Is it as simple as
>
> liblas::ReaderFactory readerFactory;
> boost::uint32_t cache_size = 1000;
> liblas::Reader reader(lasFStream, cache_size);

Pol,

I would suggest if you are starting fresh with including LAS reading into your software that you start with either PDAL http://pdal.io or LASlib https://github.com/LAStools/LAStools/tree/master/LASlib

For LAS files, PDAL is going to allow you to read in a one-at-a-time streamed fashion or as a giant single buffer. It of course also supports LASzip and many other point cloud format types.

Thanks,

Howard

PS libLAS is now in "maintenance mode" and should only be used by projects that have historically used it in the past. If you are doing new things, you should use PDAL or look to other things like LASlib



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

Re: [Liblas-devel] How to use a cached reader (c++)

Helimap Postmaster
follow-up:

I see you use std::set as a container, which makes perfect sense on the kind of data. Unfortunatelly std::set doesn't play well with openmp. Did I miss another stl container pdal can use?

The library is very clever, and I like the style and design. It's a pity we might not be able to use it after all.

Cheers,

Pol

On Tue, Mar 15, 2016 at 11:34 AM, Helimap Postmaster <[hidden email]> wrote:
Hello Howard,

I have a couple questions for you, regarding the pdal library. It reminds me of ITK.

For now I won't use the pipeline-style, given that it would take a while to refactor the ulterior processing. I will most definitely consider it, thought.

At the moment I am looking for a read into a std::vector with either the full las cloud or a buffered read of chunk_size size. Reading point by point is very inefficient, more so on network drives. Looks like cached liblas does that, but doesn't make the vector accessible. It is convenient for me to have chunks or the full cloud given that afterwards I do the processing for each point in a openmp for. Of course chunks is better, given that occasionally the clouds won't fit in memory.

Getting to pdal, there isn't much documentation on the pdal c++ API, is there? (e.g. http://www.pdal.io/api/cpp/reader.html ) What methods does the reader class provide? Are they thread-safe? You state pdal is not parallelized, but can I use the reader in parallel? Does it buffer, and can I have access to the buffer?

Cheers,

Pol



On Tue, Mar 15, 2016 at 9:24 AM, Helimap Postmaster <[hidden email]> wrote:
Good morning Howard,

This is precious information. I was unaware on liblas being under revision, I'm glad you told me. I'll follow up the pointers you gave, they look promising.

Thank you again,

Pol

On Mon, Mar 14, 2016 at 8:29 PM, Howard Butler <[hidden email]> wrote:

> On Mar 14, 2016, at 9:54 AM, Helimap Postmaster <[hidden email]> wrote:
>
> Hello!
>
> I am currently developing an application which would benefit from using a buffer when reading a las file.
>
> The C++ API has a CreateCached method in the ReaderFactory, but I can't seem to discover which is the intended way to use it, there's no reference anywhere on the documentation, and actually no other method calls it.
>
> Is it as simple as
>
> liblas::ReaderFactory readerFactory;
> boost::uint32_t cache_size = 1000;
> liblas::Reader reader(lasFStream, cache_size);

Pol,

I would suggest if you are starting fresh with including LAS reading into your software that you start with either PDAL http://pdal.io or LASlib https://github.com/LAStools/LAStools/tree/master/LASlib

For LAS files, PDAL is going to allow you to read in a one-at-a-time streamed fashion or as a giant single buffer. It of course also supports LASzip and many other point cloud format types.

Thanks,

Howard

PS libLAS is now in "maintenance mode" and should only be used by projects that have historically used it in the past. If you are doing new things, you should use PDAL or look to other things like LASlib




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

Re: [Liblas-devel] How to use a cached reader (c++)

Howard Butler-3
In reply to this post by Helimap Postmaster

> On Mar 15, 2016, at 5:34 AM, Helimap Postmaster <[hidden email]> wrote:
>
> Getting to pdal, there isn't much documentation on the pdal c++ API, is there? (e.g. http://www.pdal.io/api/cpp/reader.html ) What methods does the reader class provide? Are they thread-safe? You state pdal is not parallelized, but can I use the reader in parallel? Does it buffer, and can I have access to the buffer?

Yes, the docs are a bit thin. Your best resource for documentation is actually the test suite in ./test/unit and of course the headers themselves.

I was not sure what you wanted. By default PDAL will *read everything* for a file and then go on and process it. It sounds like you actually want this. Access to the raw buffer itself is guarded, but you can implement your own PointTable class that implements the buffer however you want.

> I see you use std::set as a container, which makes perfect sense on the kind of data. Unfortunatelly std::set doesn't play well with openmp. Did I miss another stl container pdal can use?

I'm not quite sure what you mean here. You're going to have to provide more detail.

Let's please take this discussion to the PDAL list http://www.pdal.io/community.html
_______________________________________________
Liblas-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/liblas-devel
Loading...