Skip to content

Instantly share code, notes, and snippets.

View sgillies's full-sized avatar

Sean Gillies sgillies

View GitHub Profile
@sgillies
sgillies / credits.json
Created October 10, 2012 16:10
Shapely Service Credit API
{"credits": 1000}
@sgillies
sgillies / mare-adriaticum.html
Created October 13, 2012 18:47
Mapping the Mare Adriaticum
<!DOCTYPE html>
<html>
<head>
<title>Leaflet Quick Start Guide Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4/leaflet.css" />
<!--[if lte IE 8]>
@sgillies
sgillies / mare-adriaticum-connections.json
Created October 13, 2012 20:40
Pining down the Mare Adriaticum
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sgillies
sgillies / allasplode.py
Created October 29, 2012 18:50
GeoJSON demo of recursive geometry demolition.
# allasplode.py: Explode all geometries of all features in a collection into a cloud of points.
#
# GeoJSON geometry objects all have a 'coordinates' object which is multidimensional array of
# numbers. The uniformity of these objects is a good thing: it lets us go at them with recursive
# methods and helps us write less code.
#
# Input data file from http://poezn.github.com/us-history-maps/.
def explode(coords):
"""Explode a GeoJSON geometry's coordinates object and yield coordinate tuples.
@sgillies
sgillies / awmc-names.csv
Created January 29, 2013 17:27
Test of using gists to send data to the Pleiades bulk overlay system
pid nameAttested nameLanguage timePeriods creators
550618 KANH grc ACH L. Hagemann
540599 ΑΓΡΙΝΙΟΝ grc CHR L. Hagemann
540599 Ἀγρίνιον grc CHR L. Hagemann
540679 ΑΘΗΝΑ grc CH L. Hagemann
540680 ΑΘΗΝΑ grc ACHR L. Hagemann
599541 ΑΘΗΝΑ grc CHR L. Hagemann
599540 ΑΘΗΝΑ grc C L. Hagemann
540679 Ἀθηνᾶ grc CH L. Hagemann
540680 Ἀθηνᾶ grc ACHR L. Hagemann
"pid","title","initialProvenance","id","featureTypes","geometry","paaid","avgrating","description","creators"
255955,"AWMC Location 156602","http://awmc.unc.edu/api/omnia/156602","AWMC Location","station","{""type"":""Point"",""coordinates"":[-6.175160000000687,36.630329999999958]}","http://pleiades.stoa.org/features/metadata/awmc-aegean-locations",1,"Updated geometry from the Barrington Atlas","rmhorne"
403927,"AWMC Location 156673","http://awmc.unc.edu/api/omnia/156673","AWMC Location","aqueduct","{""type"":""Point"",""coordinates"":[10.41346897110054,43.750713838301749]}","http://pleiades.stoa.org/features/metadata/awmc-aegean-locations",1,"Updated geometry from the Barrington Atlas","rmhorne"
422988,"AWMC Location 156710","http://awmc.unc.edu/api/omnia/156710","AWMC Location","river","{""type"":""Point"",""coordinates"":[12.478849999999511,41.67297999999937]}","http://pleiades.stoa.org/features/metadata/awmc-aegean-locations",1,"Updated geometry from the Barrington Atlas","rmhorne"
246576,"AWMC Location 1
@sgillies
sgillies / geojson-is-spectacularly-wrong.rst
Last active December 12, 2015 08:39
Candidate talks for http://foss4g-na.org/call-for-presentations/. Comments and forks welcome. I'm also open to co-presenting.

GeoJSON is Spectacularly Wrong

Sean Gillies http://sgillies.net

This work is licensed under the Creative Commons Attribution 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

@sgillies
sgillies / Digging into GANE data.ipynb
Last active December 13, 2015 18:38
Digging into GANE data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# 15 statement in this Fiona script, 12 after I move the prop_type function to Fiona.
# Compare to 31 statements for the ogr.py script at
# http://pcjericks.github.io/py-gdalogr-cookbook/layers.html#create-a-new-shapefile-and-add-data.
# The difference is that Fiona's schema and feature definition are declarative (using dict
# literals and comprehensions, not imperative (CreateField, SetField, etc) and that Fiona
# is designed to allow concise code.
from csv import DictReader
import fiona
from fiona.crs import from_epsg
@sgillies
sgillies / atom2json.py
Last active December 19, 2015 14:59
Syriac Places.
import feedparser
import json
import requests
feed = feedparser.parse('http://srophe.github.io/srp-places-app/full-atom.xml')
def feature(entry):
return {
'type': 'Feature',
'id': entry.id,