Skip to content

Instantly share code, notes, and snippets.

@connormanning
Created May 25, 2017 00:53
Show Gist options
  • Save connormanning/c912309cf0a3fd61b5fbf7a0b00e1508 to your computer and use it in GitHub Desktop.
Save connormanning/c912309cf0a3fd61b5fbf7a0b00e1508 to your computer and use it in GitHub Desktop.
Normalize colors with PDAL filters.programmable
import numpy as np
def normalize(i, o):
o['Red'] = i['Red'] >> 8;
o['Green'] = i['Green'] >> 8;
o['Blue'] = i['Blue'] >> 8;
return True
{
"pipeline":[
"/opt/data/input.laz",
{
"type":"filters.programmable",
"script":"/opt/data/normalize.py",
"function":"normalize",
"module":"anything"
},
{
"type":"writers.las",
"filename":"/opt/data/output.laz",
"forward": "all"
}
]
}
# Presuming your file is called input.laz
docker run -it -v `pwd`:/opt/data pdal/pdal:1.2 pdal pipeline /opt/data/pipeline.json
# Now your output should be at output.laz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment