Skip to content

Instantly share code, notes, and snippets.

View frankrowe's full-sized avatar

Frank Rowe frankrowe

View GitHub Profile
@frankrowe
frankrowe / shp2gj.py
Last active November 1, 2022 17:54
PyShp, shp to geojson in python
import shapefile
# read the shapefile
reader = shapefile.Reader("my.shp")
fields = reader.fields[1:]
field_names = [field[0] for field in fields]
buffer = []
for sr in reader.shapeRecords():
atr = dict(zip(field_names, sr.record))
geom = sr.shape.__geo_interface__
buffer.append(dict(type="Feature", \
<table cellpadding="0" cellspacing="0" class="Table2__table-scroller Table2__table" aria-describedby="descr"><caption class="Table2__table__caption"><div><span>Final Standings</span></div></caption><colgroup span="9" class="Table2__colgroup"><col class="Table2__col"><col class="Table2__col"><col class="Table2__col"><col class="Table2__col"><col class="Table2__col"><col class="Table2__col"><col class="Table2__col"><col class="Table2__col"><col class="Table2__col"></colgroup><thead class="Table2__thead"><tr class="Table2__header-row Table2__tr Table2__even"><th title="" class="Table2__th"><div title="Ranking" class="jsx-2810852873 table--cell rank tar header sortable"><span>RK</span></div></th><th title="" class="Table2__th"><div title="Team" class="jsx-2810852873 table--cell team__column header"><span>Team</span></div></th><th title="Record" class="Table2__th"><div title="Record" class="jsx-2810852873 table--cell header sortable"><span>REC</span></div></th><th title="" class="Table2__th"><div title="Points For
{
"tilejson": "2.1.0",
"name": "lines",
"tiles": [
"http://localhost:8080/geoserver/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=tiger:3Atiger_roads&STYLE=&TILEMATRIX=EPSG:4326:{z}&TILEMATRIXSET=EPSG:900913&FORMAT=application/x-protobuf;type=mapbox-vector&TILECOL={x}&TILEROW={y}"
]
}
#!/bin/bash
#
# Install Postgres 9.1, PostGIS 2.0 and pgRouting on a clean Ubuntu 12.04 install (32 bit)
# updated to PostGIS 2.0.1
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
{
"version": 8,
"sources": {
"osm": {
"type": "vector",
"tiles": ["https://chopper.boundlessgeo.io/tiles/{z}/{x}/{y}"]
}
},
"layers": [
{
// This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/).
var colorbrewer = {YlGn: {
3: ["#f7fcb9","#addd8e","#31a354"],
4: ["#ffffcc","#c2e699","#78c679","#238443"],
5: ["#ffffcc","#c2e699","#78c679","#31a354","#006837"],
6: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],
7: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
8: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
9: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]
},YlGnBu: {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt”
# Shamelessly copied from https://github.com/gf3/dotfiles
# Screenshot: http://i.imgur.com/s0Blh.png
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then
export TERM=xterm-256color
fi
@frankrowe
frankrowe / pie_serv.js
Last active December 27, 2015 18:49 — forked from mattbaker/README
var http = require('http'),
url = require('url'),
jsdom = require('jsdom'),
child_proc = require('child_process'),
w = 400,
h = 400,
scripts = ["file://"+__dirname+"/d3.min.js",
"file://"+__dirname+"/d3.layout.min.js",
"file://"+__dirname+"/pie.js"],
htmlStub = '<!DOCTYPE html><div id="pie" style="width:'+w+'px;height:'+h+'px;"></div>';