Skip to content

Instantly share code, notes, and snippets.

Avatar

Jesse Crocker JesseCrocker

View GitHub Profile
@JesseCrocker
JesseCrocker / buildContours.sh
Created May 7, 2014
Script for processing NED 1/3 arc second DEMs into contour lines
View buildContours.sh
#!/bin/bash
FEET=true
DELETE_CONVERTED=true
DROP_INTERMEDIATE_TABLE=true
CLIP=true
DB=gis
USER=jesse
HOST=localhost
@JesseCrocker
JesseCrocker / raster_extent.py
Last active Aug 29, 2015
Generate a GeoJSON file representing the extent of a set of rasters
View raster_extent.py
#!/usr/bin/env python
from osgeo import gdal, ogr, osr
import sys
import logging
from optparse import OptionParser
import os
import json
gdal.UseExceptions()
View extent.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JesseCrocker
JesseCrocker / mbtile-info.py
Created May 14, 2014
Print debugging info for an MBTiles files
View mbtile-info.py
#!/usr/bin/env python
from math import *
from optparse import OptionParser
import sqlite3 as sqlite
import os
# The following code is from http://svn.openstreetmap.org/applications/routing/pyroute/tilenames.py
def numTiles(z):
return(pow(2,z))
@JesseCrocker
JesseCrocker / gdal-VRTAddComplexSourceComponent.diff
Created Jun 27, 2014
patch to add VRTAddComplexSourceComponent function Gdal c api, to mirror functionality of c++ api.
View gdal-VRTAddComplexSourceComponent.diff
diff -u gdal-1.9.2/frmts/vrt/gdal_vrt.h gdal-modified/frmts/vrt/gdal_vrt.h
--- gdal-1.9.2/frmts/vrt/gdal_vrt.h 2012-10-08 17:58:25.000000000 -0700
+++ gdal-modified/frmts/vrt/gdal_vrt.h 2013-04-08 21:02:07.000000000 -0700
@@ -95,6 +95,12 @@
int, int, int, int,
int, int, int, int,
double, double, double );
+CPLErr CPL_DLL CPL_STDCALL VRTAddComplexSourceComponent( VRTSourcedRasterBandH,
+ GDALRasterBandH,
+ int, int, int, int,
@JesseCrocker
JesseCrocker / tile_cacher.py
Last active Aug 29, 2015
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 / convert-image-urls-to-data.py
Created Jul 9, 2014
Convert external images in an html to data URIs
View convert-image-urls-to-data.py
#!/usr/bin/env python
import os
import re
from bs4 import BeautifulSoup
import urllib2
from urlparse import urljoin
from optparse import OptionParser
import logging
def url_can_be_converted_to_data(tag):
@JesseCrocker
JesseCrocker / tessera.conf
Created Jul 17, 2014
supervisord conf for tessera
View tessera.conf
[program:tessera]
command=node node_modules/tessera/bin/tessera.js -p 8080 -c tessera.json
directory=/home/ubuntu/
user=ubuntu
autostart=True
autorestart=True
redirect_stderr=True
stdout_logfile_maxbytes=10485760
stdout_logfile_backups=3
@JesseCrocker
JesseCrocker / load_acoe_charts.sh
Last active Aug 29, 2015
Load US electronic navigation charts, for use in tile rendering
View load_acoe_charts.sh
#!/bin/sh
HOST=localhost
USER=jesse
DATABASE=enc
wget http://inland.agc.army.mil/enc/echarts/catalog/iencu37productscatalog.xml
grep mode=0660 iencu37productscatalog.xml | sed s/\<location\>// | sed s/\<\\/location\>// | sed s/\&amp\;/\\\&/ | xargs wget wget --trust-server-names --user-agent="Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1"
for i in *.zip; do unzip $i; done
View boto_upload.py
#!/usr/bin/env python
import os
from multiprocessing.pool import ThreadPool
from boto.s3.connection import S3Connection
import logging
def upload(tup, dryrun=False):
(key, filename, bucket) = tup
key = bucket.new_key(key)
You can’t perform that action at this time.