Package: copclib
copc-libcopc-lib provides an easy-to-use reader and writer interface forCOPCpoint clouds, with bindings for python and C++.InstallationThe quickest way to get started with copc-lib is with our conda and pip packages.CondaConda includes both the C++ and python bindings:condainstall-cconda-forgecopc-libPipPip provide only python bindings:pipinstallcopclibBuilding from sourceDependenciescopc-lib has the following dependencies:laz-perf>=3.0.0Catch2 v2.x (test suite only)Pybind11 (python bindings only)To install all dependencies:condainstall-cconda-forge"laz-perf>=3.0"Catch2=2.13pybind11C++gitclonehttps://github.com/RockRobotic/copc-lib.gitcdcopc-lib
mkdirbuild&&cdbuild
cmake..
cmake--build.
sudocmake--install.Pythongitclonehttps://github.com/RockRobotic/copc-lib.git
pipinstall./copc-libExample Files & Unit TestsTo build the copc-lib examples and unit tests along with the main library, you must enable them:mkdirbuild&&cdbuild
cmake..-DWITH_TESTS=ON-DWITH_PYTHON=ON
cmake--build.
ctest# All tests should passUsageTheReaderandWriterobjects provide the primary means of interfacing with your COPC files. For more complex use cases, we also provide additional objects such as LAZ Compressors and Decompressors (seeexample/example-writer.cpp).For common use cases, see theexampleandtestfolders for full examples.C++copc-lib is compatible with CMake. Assuming copc-lib and lazperf are installed on the system, you can link with them in yourCMakeLists.txt:find_package(COPCLIBREQUIRED)find_package(LAZPERFREQUIRED)add_executable(funlibfun-main.cpp)target_link_libraries(funlibCOPCLIB::copc-libLAZPERF::lazperf)The primary public interface will be yourFileReaderandFileWriterobjects. Check the headers andexample filesfor documentation.#include<iostream>#include<copc-lib/io/reader.hpp>voidmain(){// Create a reader objectFileReaderreader("autzen-classified.copc.laz");// Get the node metadata from the hierarchyautonode=reader.FindNode(copc.VoxelKey(0,0,0,0));// Fetch the points of a nodeautopoints=reader.GetPoints(node);// Iterate through each pointfor(constauto&point:points)std::cout<<"X: "<<point.X", Y: "<<point.Y<<", Z: "<<point.Z<<std::endl;}PythonExample filesare also provided for python.importcopclibascopc# Create a reader objectreader=copc.FileReader("autzen-classified.copc.laz")# Get the node metadata from the hierarchynode=reader.FindNode(copc.VoxelKey(0,0,0,0))# Fetch the points of a nodepoints=reader.GetPoints(node)# Iterate through each pointforpointinpoints:print(point.x,point.y,point.z)Note that, in python, dimension names for points follow thelaspy naming scheme, with the exception ofscan_angle.Helpful LinksCOPC Speccopc.js- TypeScript library for reading COPC filescopc.js for browser- Webpacked version of copc.js for the browserContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicensePlease seeLICENSE.mdCreditscopc-lib is created and maintained byChris Lee,Leo Stanislasand other members ofRockRobotic.TheCOPC file formatis created and maintained by HOBU Inc.
Some code has been adopted fromPDALandlazperf, both of which are maintained by HOBU Inc.