Skip to content

Instantly share code, notes, and snippets.

default:
.PHONY: default
cleaned: $(patsubst 3dd/%.3dd,laz/cleaned/%.laz,$(wildcard 3dd/*.3dd))
.PHONY: cleaned
txt/cleaned/%.txt: txt/original/%.txt
mkdir -p $(dir $@)
echo "X,Y,Z,Intensity" > $@
sed 's/, /,/g' $< >> $@
@gadomski
gadomski / Makefile
Last active June 11, 2020 09:09
Slope maps with GMT
XMIN:=-105.70
XMAX:=-105.62
YMIN:=40.37
YMAX:=40.41
OGR2GMT:=ogr2ogr -f GMT -spat $(XMIN) $(YMIN) $(XMAX) $(YMAX) -clipsrc spat_extent
default: build/hidden-valley.png
.PHONY: default
clean:
@gadomski
gadomski / pdal-translate.sh
Created January 13, 2017 15:43
Using a docker image to run `pdal translate` without having to specify volume paths
#!/usr/bin/env sh
set -e
docker_image=gadomski/magic-bucket
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
(lldb) bt
* thread #2: tid = 0x2fd3d7, 0x0000000100136c3b libentwine.dylib`std::__1::__function::__func<entwine::Tiler::insert(std::__1::function<bool (pdal::PointView&, entwine::BBox)> const&, BigUint const&, unsigned long, entwine::BBox const&, bool)::$_2, std::__1::allocator<entwine::Tiler::insert(std::__1::function<bool (pdal::PointView&, entwine::BBox)> const&, BigUint const&, unsigned long, entwine::BBox const&, bool)::$_2>, void ()>::operator()() [inlined] std::__1::__vector_base<char, std::__1::allocator<char> >::~__vector_base() at vector:452, stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x0000000100136c3b libentwine.dylib`std::__1::__function::__func<entwine::Tiler::insert(std::__1::function<bool (pdal::PointView&, entwine::BBox)> const&, BigUint const&, unsigned long, entwine::BBox const&, bool)::$_2, std::__1::allocator<entwine::Tiler::insert(std::__1::function<bool (pdal::PointView&, entwine::BBox)> const&, BigUint const&, unsigned long, entwine::BBox const&, bool)::$_2>, void
@gadomski
gadomski / gist:1962b87c5582595793e3
Created September 4, 2014 14:56
Next PCD PDAL error
[1/41] Building CXX object src/CMakeFiles/pdalcpp.dir/filters/PCLBlock.cpp.o
FAILED: /usr/bin/c++ -DHAVE_PYTHON=1 -Dpdalcpp_EXPORTS -Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Wredundant-decls -Wno-long-long -std=c++11 -g -fPIC -I../include/stubs -Iinclude -I../src/../include -I/usr/local/include -I/usr/include/libxml2 -isystem /usr/include/python2.7 -isystem /usr/local/lib/python2.7/site-packages/numpy/core/include -MMD -MT src/CMakeFiles/pdalcpp.dir/filters/PCLBlock.cpp.o -MF src/CMakeFiles/pdalcpp.dir/filters/PCLBlock.cpp.o.d -o src/CMakeFiles/pdalcpp.dir/filters/PCLBlock.cpp.o -c ../src/filters/PCLBlock.cpp
In file included from ../src/filters/PCLBlock.cpp:35:
../src/../include/pdal/PCLConversions.hpp:194:17: error: no matching constructor for initialization of 'pcl::SetIfFieldExists<typename PointCloud<PointNormal>::PointType, boost::uint32_t>'
pcl::SetIfFieldExists<typename CloudT::PointType, boost::uint32_t> (
@gadomski
gadomski / gist:54424539d6505e06555b
Created September 4, 2014 14:13
Error output for no PCL, with stubs
[1/45] Building CXX object src/CMakeFiles/pdalcpp.dir/filters/PCLBlock.cpp.o
FAILED: /usr/bin/c++ -DHAVE_PYTHON=1 -Dpdalcpp_EXPORTS -Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Wredundant-decls -Wno-long-long -std=c++11 -g -fPIC -I../include/stubs -Iinclude -I../src/../include -I/usr/local/include -I/usr/include/libxml2 -isystem /usr/include/python2.7 -isystem /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -MMD -MT src/CMakeFiles/pdalcpp.dir/filters/PCLBlock.cpp.o -MF src/CMakeFiles/pdalcpp.dir/filters/PCLBlock.cpp.o.d -o src/CMakeFiles/pdalcpp.dir/filters/PCLBlock.cpp.o -c ../src/filters/PCLBlock.cpp
In file included from ../src/filters/PCLBlock.cpp:35:
../src/../include/pdal/PCLConversions.hpp:111:22: error: no member named 'has_color' in namespace 'pcl::traits'
if (pcl::traits::has_color<typename CloudT::PointType>::value)
~~~~~~~~~~~~~^
../src/../include/pdal/PCLConversions.hpp:
<?xml version="1.0" encoding="utf-8"?>
<Pipeline version="1.0">
<Writer type="drivers.pgpointcloud.writer">
<Option name="connection">dbname='lidar' user='postgres' host='localhost' port='5432' password='dasher1'</Option>
<Option name="table">medford</Option>
<Option name="srid">4326</Option>
<Filter type="filters.chipper">
<Option name="capacity">400</Option>
<Filter type="filters.cache">
<Reader type="drivers.las.reader">
### Keybase proof
I hereby claim:
* I am gadomski on github.
* I am gadomski (https://keybase.io/gadomski) on keybase.
* I have a public key whose fingerprint is A963 4783 FF27 4BAA CAC3 7B74 F050 18EE D3F6 F069
To claim this, I am signing this object:
@gadomski
gadomski / selector.xml
Created November 12, 2013 19:32
Selector filter
<Filter type="filters.selector">
<Option name="keep">
<Options>
<Option name="dimension">X</Option>
<Option name="dimension">Y</Option>
<Option name="dimension">Z</Option>
<Option name="dimension">Time</Option>
<Option name="dimension">Intensity</Option>
</Options>
</Option>
@gadomski
gadomski / crop.py
Created October 31, 2013 19:58
Cropping a set of lasfiles to rectangular bounds
#!/usr/bin/env python
import os
import subprocess
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
def path(*a):
return os.path.join(PROJECT_DIR, *a)