Skip to content

Instantly share code, notes, and snippets.

Paul Downey psd

Block or report user

Report or block psd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@psd
psd / .gitignore
Last active Jul 2, 2019
Parse planet XLS into CSV
View .gitignore
var
cpos.csv
@psd
psd / fieldnames.txt
Last active Jun 18, 2019
Brownfield sites fieldnames
View fieldnames.txt
CoordinateReferenceSystem 2 Co-ordinate Reference System
CoordinateReferenceSystem 2 COORDINATE REFERENCE SYSTEM
CoordinateReferenceSystem 4 COORDINATEREFERENCESYSTEM
CoordinateReferenceSystem 7 Coordinate Reference System
Deliverable 5 DELIVERABLE
DevelopmentDescription 1 Developmentdescription
DevelopmentDescription 1 DEVELOPMENT DESCRIPTION
DevelopmentDescription 4 DEVELOPMENTDESCRIPTION
DevelopmentDescription 9 Development Description
FirstAddedDate 1 FirstAddeddate
@psd
psd / wfs.py
Created Jun 4, 2018
Grab GML from a WFS server
View wfs.py
#!/usr/bin/env python3
"""
https://geopython.github.io/OWSLib/
"""
from owslib.wfs import WebFeatureService
url='http://inspire.misoportal.com/geoserver/mid_sussex_district_council_msdc_3830_tpo_point/wfs?service=wfs&version=2.0.0&request=GetCapabilities'
url='http://environment.data.gov.uk/ds/wfs?INTERFACE=ENVIRONMENTWFS--7a955570-d465-11e4-a37c-f0def148f590'
@psd
psd / wms.py
Created Apr 12, 2018
Get Land Registry Inspire polygons as an image from their WMS service
View wms.py
#!/usr/bin/env python3
from owslib.wms import WebMapService
wms = WebMapService('http://inspire.landregistry.gov.uk/inspire/ows?Service=WMS&Request=Getcapabilities', version='1.1.1')
print(wms.identification.type)
layers = list(wms.contents)
layer=layers[0]
View split.sh
#!/bin/bash
awk -F' ' \
-v artist="Underworld" \
-v album="Everything Everything" \
'BEGIN {
total=0;
n=0;
}
{
View portfolio-form.json
{
"type": "object",
"required": [
"name",
"shoesizeLeft"
],
"properties": {
"name": {
"title": "Name",
"description": "Gimme yea name lad",
View portfolio-form.json
{
"type": "object",
"required": [
"name",
"shoesizeLeft"
],
"properties": {
"name": {
"title": "Name",
"description": "Gimme yea name lad",
@psd
psd / README.md
Last active Nov 11, 2017
Form explorer data for the MoJ
View README.md
View gist:1d4cc608f543901795f7f4436ef6182a
import io
import csv
import requests
class Records:
"Minimal register client"
records = {}
url = 'https://%s.register.gov.uk/records.tsv?page-size=5000'
View count-attachments.sh
#!/bin/bash
# 10 /government/uploads/system/uploads/attachment_data/file/98864/thumbnail_emr-2010-11.pdf.png GET 200 origin,2
find daily -type d -name '20??????' |
while read dir
do
date=$(echo "$dir" | sed -e 's/^.*\(20[0-9]*\).*$/\1/')
zcat $dir/count_cdn-govuk.log-20*.csv.gz |
sed -e 's/^[0-9][0-9] //' \
You can’t perform that action at this time.