Skip to content

Instantly share code, notes, and snippets.

View mwtoews's full-sized avatar

Mike Taves mwtoews

View GitHub Profile
@mwtoews
mwtoews / digital_root.py
Last active April 9, 2024 02:56
digital root
import re
good = {1, 4, 7}
bad = {3, 6, 9}
neutral = {2, 8, 5}
re_digits = re.compile(r"([\d\:\.\,]+)")
re_digit = re.compile(r"\d")
# -*- coding: utf-8 -*-
import os
import re
re_fn = re.compile(r'(.+?\.)(f|for|f90|fpp)$')
# sdir = '/home/mwtoews/src/GWM-2005/src'
sdir = '.'
fn_lines = {}
opening C:\Program Files\GDAL\gdal-data\cubewerx_extra.wkt
opening C:\Program Files\GDAL\gdal-data\ecw_cs.wkt
opening C:\Program Files\GDAL\gdal-data\epsg.wkt
including: C:\Program Files\GDAL\gdal-data\esri_extra.wkt
opening C:\Program Files\GDAL\gdal-data\esri_extra.wkt
including: C:\Program Files\GDAL\gdal-data\cubewerx_extra.wkt
opening C:\Program Files\GDAL\gdal-data\cubewerx_extra.wkt
opening C:\Program Files\GDAL\gdal-data\esri_extra.wkt
opening C:\Program Files\GDAL\gdal-data\esri_StatePlane_extra.wkt
opening C:\Program Files\GDAL\gdal-data\esri_Wisconsin_extra.wkt
opening /amp/gw/sw/share/gdal/cubewerx_extra.wkt
opening /amp/gw/sw/share/gdal/ecw_cs.wkt
opening /amp/gw/sw/share/gdal/epsg.wkt
including: /amp/gw/sw/share/gdal/esri_extra.wkt
opening /amp/gw/sw/share/gdal/esri_extra.wkt
including: /amp/gw/sw/share/gdal/cubewerx_extra.wkt
opening /amp/gw/sw/share/gdal/cubewerx_extra.wkt
opening /amp/gw/sw/share/gdal/esri_extra.wkt
opening /amp/gw/sw/share/gdal/esri_StatePlane_extra.wkt
opening /amp/gw/sw/share/gdal/esri_Wisconsin_extra.wkt
@mwtoews
mwtoews / osr_roundtrips.py
Last active August 29, 2015 14:17
OSR roundtrips
#!/usr/bin/env python
import os
import difflib
import subprocess
from osgeo import gdal
from osgeo import osr
from glob import glob
gdal.UseExceptions()
osr.UseExceptions()
@mwtoews
mwtoews / ST_RedistributeVertices.sql
Created March 10, 2015 20:25
ST_RedistributeVertices
CREATE OR REPLACE FUNCTION ST_RedistributeVertices(
geom geometry,
distance double precision,
null_for_small boolean DEFAULT false)
RETURNS geometry AS $body$
DECLARE
perimeter numeric;
num_vert integer;