Skip to content

Instantly share code, notes, and snippets.

Avatar

Jesse Crocker JesseCrocker

View GitHub Profile
@JesseCrocker
JesseCrocker / aws.conf
Created Feb 15, 2016
How to install AWS CloudWatch Logs Agent to send logs from a docker container to AWS Cloudwatch, without using a linked container for logging.
View aws.conf
[plugins]
cwlogs = cwlogs
[default]
region = ap-southeast-2
@JesseCrocker
JesseCrocker / build-gdal-combined-lib.sh
Last active Dec 7, 2020
Scripts for building Gdal into a static library for iOS, build-gdal-combined-lib.sh will build a single lib with armv7 armv7s arm64 and simulator slices
View build-gdal-combined-lib.sh
#!/bin/bash
PREFIX=`pwd`/install/
rm -rf $PREFIX
mkdir $PREFIX
LOG=./log
rm -rf $LOG
mkdir $LOG
if [ -e ${PREFIX} ]
then
@JesseCrocker
JesseCrocker / setup_tilestache.sh
Last active Nov 26, 2020
Setup Tile Stache Mapnik and postgis2.0 on ubuntu 12.04, you probably don't want to run this as a script, use it as instructions.
View setup_tilestache.sh
#!/bin/bash
#setup tilestache on ubuntu 12.04
#install some basic system software
sudo apt-get -q -y install emacs23-nox
sudo apt-get -q -y install nginx git-core python-pip python-dev python-flup
sudo apt-get -q -y install libjpeg8 libjpeg62-dev libfreetype6 libfreetype6-dev
sudo pip install -U werkzeug
sudo pip install -U simplejson
sudo pip install -U modestmaps
@JesseCrocker
JesseCrocker / tile_cacher.py
Last active Nov 11, 2020
Script for request map tiles based on a BBOX, for seeding caches.
View tile_cacher.py
#!/usr/bin/env python
#
# Make requests to a tile server to seed the cache
# Created by Jesse Crocker, 6/30/2014
#
# This file is public-domain
#-------------------------------------------------------
from math import *
from optparse import OptionParser
@JesseCrocker
JesseCrocker / get-dems.sh
Last active Jul 23, 2020
Download all SRTM30 dems, convert to HGT
View get-dems.sh
#!/bin/bash
function gdal_pixel_count() {
if [ -z "$1" ]; then
echo "Missing arguments. Syntax:"
echo " gdal_extent <input_raster>"
return
fi
EXTENT=$(gdalinfo $1 |\
grep "Size is" |\
@JesseCrocker
JesseCrocker / collage.py
Last active Jun 16, 2020
Create a collage of images, filling all space without cropping. Implements algorithm presented in https://www.crispymtn.com/stories/the-algorithm-for-a-perfectly-balanced-photo-gallery
View collage.py
#!/usr/bin/env python
from operator import itemgetter
from optparse import OptionParser
import logging
from PIL import Image
from math import ceil, floor
import sys
"""
View valhalla diary.md

Ultimate Goal: valhalla running on AWS ECS, behind a load balancer, in multiple regions, with auto scaling, with data updating once a week.

Diary

First goal: Build with docker, then cut tiles from a small extract and get server to run locally.

jesse:projects/ $ mkdir ~/valhalla-data
jesse:projects/ $ cd ~/valhalla-data
jesse:projects/ $ wget http://download.geofabrik.de/north-america/us/california-latest.osm.pbf
[output abbreviated]
jesse:projects/ $ cd ~/projects
@JesseCrocker
JesseCrocker / states.py
Created Nov 18, 2015
python list of US states
View states.py
['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming']
@JesseCrocker
JesseCrocker / TBActiveMarker.h
Created Sep 18, 2015
Example for how to create an animated marker with WhirlyGlobe/Maply
View TBActiveMarker.h
//
// TBActiveMarker.h
// TrailTracker
//
// Created by Jesse Crocker on 2/10/14.
//
//
#import "WhirlyGlobeComponent.h"
@JesseCrocker
JesseCrocker / convert-geopdf.py
Last active Aug 13, 2019
A quick script for converting US Topo geoPDF maps to tiff. Based on code from Even Rouault at http://lists.osgeo.org/pipermail/gdal-dev/2013-January/035269.html
View convert-geopdf.py
#!/usr/bin/env python
#based on http://lists.osgeo.org/pipermail/gdal-dev/2013-January/035269.html
from osgeo import gdal, osr
import os
import sys
from optparse import OptionParser
import tempfile
from shapely import wkt
from shapely.geometry import mapping
from fiona import collection, crs