C API for PDAL now on GitHub

Simverge developed an application programming interface (API) in the C programming language for the Point Data Abstraction Library (PDAL) and published it under the BSD 3-Clause license at GitHub. PDAL is a library for point cloud data processing and analysis written in C++. The API exposes PDAL's JSON pipeline functionality just like the Python and Java bindings. Take a look at the unit tests for examples on how to use the API. A pdal-c package is also available for vcpkg and a conda-forge package is on its way. I hope that this library serves as a useful interface for other language bindings. Please submit an issue or pull request at GitHub if you have any suggestions! ...
Read More

How to use protobuf with zlib compression in C++

It's been a while since my last post, where I explained how to build protobuf with zlib support. In this post I'll explain how you can use zlib-based streams in C++ to serialize and deserialize protobuf messages. We'll use a small Mona Lisa bitmap for this example, since its uncompressed format will compress well with zlib's default Deflate lossless compression algorithm. Take a look at Simverge/howto-protobuf-zlib in GitHub for a more complete implementation of this example. Define a Protobuf Message Schema First, let's create a file called blob.proto that defines a simple Protobuf message to store an arbitrary blob of data along with a string identifying its source: [crayon-6825a6207bd5f047280803/] Compile blob.proto with the Protobuf compiler (protoc) using the instructions from the official Protobuf C++ tutorial. For example, the following command will generate the blob.pb.cc C++ source file and the blob.pb.h C++ header file in the same directory as blob.proto: [crayon-6825a6207bd70258501628/] You can instead use the FindProtobuf module if you are building with CMake, for example: [crayon-6825a6207bd73798535573/] Once blob.proto is...
Read More
How to build protobuf with zlib

How to build protobuf with zlib

I recently worked on a task to deliver protobuf messages through Keryx. I needed to cache these messages in memory and on disk and discovered that the messages were uncompressed. I was glad to find that the protobuf C++ API provides zlib-based compression, since this is a good enough way to quickly reduce storage size and delivery time. Protobuf provides the GzipOutputStream and GzipInputStream classes in the google::protobuf::io namespace. These classes are defined in google/protobuf/io/gzip_stream.h. However, a few linker errors revealed zlib support was not enabled in my initial protobuf build. Windows is the main development environment and target for Keryx, so this guide will explain how to enable zlib compression for protobuf 3.5.1 built from source using Visual Studio 2015. The process for building with Visual Studio 2017 should be similar. A simpler approach is to install protobuf with zlib support using vcpkg: [crayon-6825a6207c95c463486447/] You can learn more about vcpkg at GitHub. This guide will instead explain how to manually clone and build...
Read More