Skip to content

Instantly share code, notes, and snippets.

@gadomski
Last active January 31, 2017 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gadomski/c921e5bffc888f0c5f44ca07d4932de4 to your computer and use it in GitHub Desktop.
Save gadomski/c921e5bffc888f0c5f44ca07d4932de4 to your computer and use it in GitHub Desktop.
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' $< >> $@
laz/cleaned/%.laz: txt/cleaned/%.txt
mkdir -p $(dir $@)
pdal translate $< $@ -f range --filters.range.limits='X![0:0],Y![0:0],Z![0:0]' -f programmable --filters.programmable.script=scripts/scale_intensity.py --filters.programmable.module=scale_intensity --filters.programmable.function=scale_intensity
.PRECIOUS: laz/cleaned/%.laz
def scale_intensity(input, output):
intensity = input["Intensity"]
intensity = intensity * 65536
output["Intensity"] = intensity
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment