Skip to content

Instantly share code, notes, and snippets.

View alpha-beta-soup's full-sized avatar
🌏

Richard Law alpha-beta-soup

🌏
View GitHub Profile
@johnniehard
johnniehard / MBTiles: Pipe GeoJSON from PostGIS to Tippecanoe.md
Last active April 11, 2020 20:49
MBTiles: Pipe GeoJSON from PostGIS to Tippecanoe

I had a large dataset in postgis and wanted to avoid the hassle of first exporting it to a several GB geojson file before tiling it with Tippecanoe.

ogr2ogr -f GeoJSON /dev/stdout \                                                                            
PG:"host=localhost dbname=postgres user=postgres password=thepassword" \
-sql "select * from a, roi where a.geom && roi.geom" \
| docker run -i -v ${PWD}:/data tippecanoe:latest tippecanoe \
--output=/data/yourtiles.mbtiles
@timgentry
timgentry / powerbi_json_to_csv.rb
Created October 18, 2018 12:41
Converts PowerBI JSON payload to CSV
require 'json'
require 'csv'
hash = JSON.parse(File.read('querydata.json'))
CSV.open('data.csv', 'w') do |csv|
hash['results'].each do |result|
data = result['result']['data']
descriptor = data['descriptor']
dsr = data['dsr']
@perrygeo
perrygeo / Dockerfile
Last active February 27, 2023 12:00
Minimal debian image with Python 3.6 and geo python tools
FROM python:3.6-slim-stretch
ADD requirements.txt /tmp/requirements.txt
RUN apt-get update && \
apt-get install -y \
build-essential \
make \
gcc \
locales \
@tkh44
tkh44 / index.js
Created August 25, 2017 19:25
Getting react-leaflet working with SSR (next.js)
import React from 'react'
export default class extends React.Component {
constructor () {
super()
this.state = { components: undefined }
this.markers = new WeakMap()
}
componentDidMount () {
@bubbobne
bubbobne / geometry_geojson.yaml
Last active November 2, 2023 19:08
A #swagger #geojson geometry description
#MIT License
#
#Copyright (c) 2017 Daniele Andreis
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
#
@dweinstein
dweinstein / Dockerfile
Created March 14, 2014 15:37
testProject
FROM ubuntu
MAINTAINER David Weinstein <david@bitjudo.com>
# install our dependencies and nodejs
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get -y install python-software-properties git build-essential
RUN add-apt-repository -y ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get -y install nodejs
@parnelandr
parnelandr / Food.csv
Last active December 30, 2015 21:29
Reusable Bar Chart
Food by Deliciousness
Source: Andrew Parnell
Metadata Notes: Things I think are yummy
Food Rating
Bananas 5
Green Beans 4
Egg Salad Sandwich 7
Ice Cream 10
Vegemite 3.5
@mitchellrj
mitchellrj / strftime_1900.py
Created March 8, 2012 12:42
Python datetime.strftime < 1900 workaround
import datetime
import re
import warnings
def strftime(dt, fmt):
if dt.year < 1900:
# create a copy of this datetime, just in case, then set the year to
# something acceptable, then replace that year in the resulting string
tmp_dt = datetime.datetime(datetime.MAXYEAR, dt.month, dt.day,
dt.hour, dt.minute,
@geographika
geographika / arcobjects_python.py
Created April 17, 2011 11:31
ArcObjects and Python
def AppendPaths(paths):
"""Append all the paths with DLLs to be used by the script to the Python Path"""
import sys
for p in paths:
sys.path.append(p)
def AddReferences(refs):
"""Add references to the required DLLs"""
import clr