Skip to content

Instantly share code, notes, and snippets.

View psd's full-sized avatar

Paul Downey psd

View GitHub Profile
@psd
psd / heatmap.svg
Last active January 13, 2020 11:48
SVG graphs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@psd
psd / heatmap.svg
Created January 13, 2020 11:40
SVG graphs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@psd
psd / q.py
Created October 24, 2019 06:11
wikidata local authorities
#!/usr/bin/env python3
from SPARQLWrapper import SPARQLWrapper, JSON, CSV, TSV
import csv
q = """
SELECT DISTINCT ?wikidata ?itemLabel ?gss ?toid ?website ?osm
WHERE
{
VALUES ?q {
@psd
psd / query.py
Created October 23, 2019 06:13
Development Corporations
from SPARQLWrapper import SPARQLWrapper, JSON, CSV
import csv
q="""
SELECT ?uri ?name ?gss ?foi
WHERE {
?uri ?p <http://opendatacommunities.org/def/local-government/DevelopmentCorporation> .
?uri <http://www.w3.org/2000/01/rdf-schema#label> ?name .
?uri <http://publishmydata.com/def/ontology/foi/code> ?gss .
?uri <http://publishmydata.com/def/ontology/foi/code> ?foi
title date
This week at Digital Land
2019-10-04

Team

We've a and preparing for testing Compulsory Purchase Orders in a usability lab, and a number of policy events and papers. Matt ran a much needed planning session, and we updated our roadmap, which we aim to make public, soon.

@psd
psd / .gitignore
Last active July 2, 2019 10:33
Parse planet XLS into CSV
var
cpos.csv
@psd
psd / fieldnames.txt
Last active June 18, 2019 16:39
Brownfield sites fieldnames
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 June 4, 2018 09:57
Grab GML from a WFS server
#!/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 April 12, 2018 18:09
Get Land Registry Inspire polygons as an image from their WMS service
#!/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]
@psd
psd / split.sh
Created December 27, 2017 16:12
#!/bin/bash
awk -F' ' \
-v artist="Underworld" \
-v album="Everything Everything" \
'BEGIN {
total=0;
n=0;
}
{