Skip to content

Instantly share code, notes, and snippets.

# REFERENCES
Bolstad, P.V. and Stowe, T. 1994. An evaluation of DEM accuracy: elevation, slope and aspect.
Photogrammetric Engineering and Remote Sensing 60: 1327-1332.
Garbrecht, J. and Starks, P. 1995. Note on the use of USGS level 1 7.5-minute DEM coverages for landscape drainage analyses.
Photogrammetric Engineering and Remote Sensing 61: 519-522.
Giles, P.T. and Franklin, S.E. 1996. Comparison of derivative topographic surfaces of a DEM generated from stereographic SPOT images with field measurements.
Photogrammetric Engineering and Remote Sensing 62: 1165-1171.
@maphew
maphew / classify-ground-export-aboveground.json
Last active January 11, 2020 22:11
A PDAL pipeline that a) classifies into ground/not-ground, b) adds "Height Above Ground" attribute, and c) exports only above ground points. Adapted from https://lists.osgeo.org/pipermail/pdal/2017-July/001367.html
{
"pipeline": [
"Carmacks_01.laz",
{
"type": "filters.assign",
"assignment": "Classification[:]=0"
},
{
"type": "filters.smrf"
},
@maphew
maphew / arcpy_parse_path.py
Created January 17, 2018 21:29
partial helper for reliably deriving workspace path from input Feature Class path
def parse_path(fc_path):
'''Derive workspace from Feature Class's location
Adapted from http://pro.arcgis.com/en/pro-app/tool-reference/modelbuilder-toolbox/parse-path.htm'''
fc = os.path.basename(fc_path)
dir = os.path.dirname(fc_path)
name = os.path.basename(fc_path).rstrip(os.path.splitext(fc_path)[1])
ext = os.path.splitext(fc_path)[1].lstrip(".")
if ext.lower() == 'gdb':
@maphew
maphew / get_timestamp_from_commit_json.py
Created April 9, 2018 05:54
get_timestamp_from_commit_json(), was part of Leo-Editor setup.py troubleshooting
## was part of Leo-Editor setup.py troubleshooting
try:
import semantic_version
except ImportError:
print('*** Warning: failed to import `semantic_version`')
get_timestamp_from_commit_json()
def get_timestamp_from_commit_json(file):
import json
root = os.path.dirname(os.path.realpath(file))
@maphew
maphew / what-cmd-ext.bat
Created May 24, 2018 15:57
Test what version of Command Extensions are available (Windows)
@echo off
:: Test what version of Command Extensions are available
:: http://ss64.org/viewtopic.php?id=1834
if "~x0"=="%~x0" goto NOCMDEXT
if "%%~x0"=="%~x0" goto NOCMDEXT
if CmdExtVersion 2 goto CMDEXTV2
goto CMDEXTV1
:CMDEXTV1
@maphew
maphew / arcmap-save-copy- as-v10-4.ahk
Last active September 4, 2018 17:24
Key sequence for ArcMap 10.6 to save copy of current map as 10.4
#SingleInstance,Force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; key sequence for ArcMap 10.6 to save copy of current map as 10.4
^j:: ; Activate with Ctrl-J
;clipsaved:= ClipboardAll
@maphew
maphew / leo-screenshot.py
Created October 3, 2018 23:29
There is a screenshots plugin, but the following @button script seems more useful
'''
This script must be bound to a keystroke so that it can run without disturbing Leo's present state.
Rev 9cce9a in devel is required to make everything work smoothly when gathering arguments, but this
rev breaks other features. Back to the drawing board.
-- @edreamleo, https://groups.google.com/d/msg/leo-editor/Serzpyzrylg/B63pKXFNCwAJ
'''
@button screen-shot @key=ctrl-1
'''
Create a screenshot of the present Leo outline and
@maphew
maphew / hkcr-filezilla-url.reg
Last active May 18, 2022 01:31
Register FileZilla protocols with Windows
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\FileZilla.Url]
@="FileZilla URL"
"URL Protocol"=""
"EditFlags"=dword:00000002
"BrowserFlags"=dword:00000008
[HKEY_CLASSES_ROOT\FileZilla.Url\DefaultIcon]
@="\"C:\\Program Files\\FileZilla FTP Client\\filezilla.exe\",0"
@maphew
maphew / jeu-de-noe.html
Last active February 7, 2019 13:27
Jeu vidéo de NoéCourtesy of [lovasoa] 15yr old brother - https://news.ycombinator.com/item?id=18866500// source https://jsbin.com/cuqagav
<!doctype html>
<html>
<head>
<meta name="description" content="Courtesy of [lovasoa] 15yr old brother - https://news.ycombinator.com/item?id=18866500">
<meta charset='UTF-8'>
<title>Jeu vidéo de Noé</title>
</head>
<body style="text-align: center">

Leo 5.8.1 beta 1, http://leoeditor.com, is now available on GitHub.

Leo is an IDE, outliner and PIM, as described here.

  ![][22]   ![][10]   ![][11]
![][31]   ![][32]   ![][6]