Skip to content

Instantly share code, notes, and snippets.

View connormanning's full-sized avatar

Connor Manning connormanning

View GitHub Profile
@connormanning
connormanning / _readme.md
Last active April 6, 2018 12:41
PDAL GreyhoundWriter Javascript example

Scripting writers.greyhound

These instructions assume that node.js is installed installed natively. PDAL/Entwine/Greyhound pieces are done via Docker.

Index Autzen with Entwine

Assuming ~/entwine is the storage location for Entwine-indexed data:

docker run -it -v ~/entwine:/opt/data connormanning/entwine build \
 -i http://entwine.io/sample-data/autzen.laz \
@connormanning
connormanning / houston.md
Last active January 30, 2021 15:31
Houston LAZ files
@connormanning
connormanning / sample.js
Last active July 21, 2017 18:08
Greyhound density sampler
var Promise = require('bluebird');
var request = require('request-promise');
var argv = require('minimist')(process.argv.slice(2));
if (!argv.r || argv.h) {
console.log('\nGREYHOUND DENSITY SAMPLER');
console.log('--------');
console.log(
'This script queries randomly selected areas of a resource to\n' +
'estimate the density of a dataset. Only queries containing\n' +
@connormanning
connormanning / readme.md
Last active March 30, 2018 06:45
Get Entwine file hierarchy as JSON

First, save the run.cpp file somewhere.

$ docker run -it \
  -v <your-entwine-data-directory>:/opt/data/ \
  -v <wherever-you-put-that-c++-file>:/opt/test/ \
  --entrypoint=bash connormanning/entwine

root@ff99e5b49bf0:/# cd /opt/test/
root@ff99e5b49bf0:/opt/test# g++ -std=c++11 -I /usr/include/jsoncpp/ run.cpp -lentwine -ljsoncpp -o dump
@connormanning
connormanning / normalize.py
Created May 25, 2017 00:53
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
@connormanning
connormanning / move-docker-image-location.md
Created April 12, 2017 20:50
Move docker image location
  1. Create config directory and create a config file
sudo mkdir /etc/systemd/system/docker.service.d/
sudo nano /etc/systemd/system/docker.service.d/custom.conf

Contents of that file should be:

[Service]
ExecStart=
$ time docker run -it --rm connormanning/entwine infer https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998104c.laz -v
Curl config:
timeout: 5s
followRedirect: true
verifyPeer: true
caBundle: (default)
caInfo: (default)
Inferring from: https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998104c.laz
Temp path: tmp
Threads: 4
$ time docker run -it connormanning/entwine infer "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998104c.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998104d.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998113a.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998113b.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998113c.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998113d.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998114a.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998114b.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998114c.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998114d.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998123a.laz" "https://storage.googleapis.com/stratmap10_50cm_be
@connormanning
connormanning / infer.sh
Created April 7, 2017 15:42
Infer bexar
$ time ./kernel/entwine infer "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998104c.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998104d.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998113a.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998113b.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998113c.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998113d.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998114a.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998114b.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998114c.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998114d.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50cm_2998123a.laz" "https://storage.googleapis.com/stratmap10_50cm_bexar/stratmap10-50c
@connormanning
connormanning / point-cloud-bounds.js
Created December 6, 2016 16:58
Greyhound bounds scale/offset
var PointCloudBounds = function(serverInfo) {
var bounds = serverInfo.bounds;
var preScale = serverInfo.scale || [1, 1, 1];
var preOffset = serverInfo.offset || [0, 0, 0];
console.log('From:', serverInfo);
if (!preScale.length) preScale = [preScale, preScale, preScale];
bounds = bounds.map((v, i) => v * preScale[i % 3] + preOffset[i % 3]);