Skip to content

Instantly share code, notes, and snippets.

View thomas-maschler's full-sized avatar

Thomas Maschler thomas-maschler

View GitHub Profile
@thomas-maschler
thomas-maschler / slope.json
Last active August 3, 2018 14:31
Bar graph for slope analysis
{
"$schema": "https://vega.github.io/schema/vega/v4.0.json",
"width": 240,
"height": 75,
"padding": 2,
"title": {
"text": "Slope",
"font": "Fira Sans",
"fontSize": 16,
"offset": 0,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thomas-maschler
thomas-maschler / Install SSL certificate for ArcGIS server.md
Last active April 14, 2017 15:17
Install SSL certificate for ArcGIS server
@thomas-maschler
thomas-maschler / pg_remove_locks.sql
Created March 17, 2017 20:37
Remove locks from Postgres tables
SELECT t.schemaname,
t.relname,
l.locktype,
l.page,
l.virtualtransaction,
l.pid,
l.mode,
l.granted
FROM pg_locks l
JOIN pg_stat_all_tables t ON l.relation = t.relid
@thomas-maschler
thomas-maschler / pg_remove_locks.sql
Created March 17, 2017 20:37
Remove locks from Postgres tables
SELECT t.schemaname,
t.relname,
l.locktype,
l.page,
l.virtualtransaction,
l.pid,
l.mode,
l.granted
FROM pg_locks l
JOIN pg_stat_all_tables t ON l.relation = t.relid
import osmapi
# Connect to OSM
api = osmapi.OsmApi(username="osm-user", password="***")
# Create a new changeset
api.ChangesetCreate({u"comment": u"updating abandoned roads"})
# Read File with way id and highway dates
with open("East_Complex_Attributes.txt", "r") as f:
{
"layer_name": {
"info": {
"en": {
"title": "",
"sub_title": "",
"function": "",
"resolution": "",
"geographic_coverage": "",
"source": "",
@thomas-maschler
thomas-maschler / quart_geom.py
Last active September 19, 2016 14:00
Quarter Geometries
import arcpy
import os
import io
import sys
def quart_geom(geom):
"""
Quarter an arcpy geometry
:param geom: arcpy.geometry
@thomas-maschler
thomas-maschler / get_s3_bucket_content.py
Last active August 30, 2016 14:23
Get S3 bucket content
from boto.s3.connection import S3Connection
conn = S3Connection('AWS_Key','AWS_Secret')
bucket = conn.get_bucket('my_bucket')
for key in bucket.list():
print key.name.encode('utf-8')
import csv
import glob
import os
csv_path = r"D:\temp\fires_tsv\csv\*"
csv_files = glob.glob(csv_path)
tsv_path = r"D:\temp\fires_tsv\tsv"
if not os.path.exists(tsv_path):
os.mkdir(tsv_path)