Skip to content

Instantly share code, notes, and snippets.

View m-richards's full-sized avatar

Matt Richards m-richards

View GitHub Profile
import fiona
from pyproj import CRS
schema={'properties': {'Anode': 'int32', 'Bnode': 'int32', 'LinkID': 'float', }, 'geometry': 'LineString'}
crs = "EPSG:4326"
coordinates = [(115.638812, -32.62857), (115.637933, -32.631091)]
records = [fiona.Feature(geometry=fiona.Geometry(coordinates=coordinates, type='LineString'), id='23998',
@m-richards
m-richards / subprocess_tee.py
Last active February 9, 2025 04:16
Subprocess run with tee like behaviour.
"""Drop in replacement for subprocess.run(..., text/universal_newlines=True) with tee-like behaviour.
Inspired by https://github.com/pycontribs/subprocess-tee, but that doesn't work from an
asyncio event loop.
This is pretty quick and dirty AI soup, but seems to work
"""
import logging
import shlex
@m-richards
m-richards / startup.py
Created January 13, 2021 07:28
Open QGIS console on launch
# Place in %APPDATA%\QGIS\QGIS3\
#https://gis.stackexchange.com/questions/132695/how-to-show-python-console-at-qgis-program-start
import qgis
qgis.utils.iface.actionShowPythonDialog().trigger()