Skip to content

Instantly share code, notes, and snippets.

View schoenobates's full-sized avatar

Alex Davies-Moore schoenobates

View GitHub Profile
@schoenobates
schoenobates / Poly.java
Created April 22, 2016 12:51
WKT Polygon Regex Validator: Whitespace and First/Last point validation in linear ring... needs to check for more than one two points per linear ring
POLYGON\s*\(\s*(\(\s*(?<X>\-?\d+(:?\.\d+)?)\s+(?<Y>\-?\d+(:?\.\d+)?)(?:\s*,\s*\-?\d+(:?\.\d+)?\s+\-?\d+(:?\.\d+)?)*\s*,\s*\k<X>\s+\k<Y>\s*\))(\s*,\s*\(\s*(?<XH>\-?\d+(:?\.\d+)?)\s+(?<YH>\-?\d+(:?\.\d+)?)(?:\s*,\s*\-?\d+(:?\.\d+)?\s+\-?\d+(:?\.\d+)?)*\s*,\s*\k<XH>\s+\k<YH>\s*\))*\s*\)
@schoenobates
schoenobates / main.go
Created October 5, 2019 11:49
Convert an ASCII DEM File to RAW or PNG for import into other apps (e.g. Unity)
package main
import (
"bufio"
"encoding/binary"
"flag"
"fmt"
"image"
"image/color"
"image/png"