Skip to content

Instantly share code, notes, and snippets.

@bmount
bmount / fgdb_gut_caveats.md
Last active December 20, 2015 07:28
gut_fgdb_caveats

Refers to experimental file geodatabase conversion in gut

  1. Files have to be zipped, which as far as I can tell is the norm for fgdb distribution (.gdb is just a directory)

  2. This converts to kml because handling layers in geojson exceeds my time budget for this (measured in minutes today!), patches and ideas for going straight to json are welcome: https://github.com/bmount/gut I haven't even had time to read the source of the great gdbflee.

  3. Files larger than 100 megabytes should access the underlying api unproxied:

curl -X POST http://conv.sfgeo.org:5984/_fgdb2kml --data-binary @yourfile.gdb.zip

@bmount
bmount / index.html
Last active December 20, 2015 13:09
Manhattan building construction dates as reported by MapPLUTO
<!doctype html>
<meta charset="utf-8">
<style>
rect {
fill: steelblue;
}
.leg {
@bmount
bmount / example.js
Last active December 20, 2015 23:39
interacting with topographic data in browser console
// In console:
script = document.createElement("script")
script.type = 'text/javascript'
script.src = "http://d3js.org/d3.v3.min.js"
document.body.appendChild(script);
img = new Image
img.crossOrigin = "Anonymous";
img.src= "https://a.tiles.mapbox.com/v3/bmount.srtmsf/-122.4575,37.7575,14/500x500.png"
@bmount
bmount / acs_tables.json
Created August 19, 2013 23:33
human readable column name -> description mapping for American Community Survey tables, tract detail dataset
{"dp0150001": "Households with individuals 65 years and over", "dp0090004": "Total races tallied: Asian alone or in combination with one or more other races", "dp0090005": "Total races tallied: Native Hawaiian and Other Pacific Islander alone or in combination with one or more other races", "shape": "Unrepresentable_Domain: Coordinates defining the features.", "dp0090001": "Total races tallied: White alone or in combination with one or more other races", "dp0090002": "Total races tallied: Black or African American alone or in combination with one or more other races", "dp0090003": "Total races tallied: American Indian and Alaska Native alone or in combination with one or more other races", "dp0120006": "Total population: In Households: Child: Own child under 18 years", "dp0010040": "Total Population: Female: Under 5 years", "dp0010041": "Total Population: Female: 5 to 9 years", "dp0010042": "Total Population: Female: 10 to 14 years", "dp0010043": "Total Population: Female: 15 to 19 years", "dp0010044": "Total
function urlTmpl (tmpl, obj) {
return tmpl.replace(/{{([a-zA-Z0-9]+)}}/g, function (s, v) { return obj[v] })
}
/*
> urlTmpl('shit is {{status}} and {{qualifier}}', { status: 'fucked up', qualifier: 'bullshit' })
"shit is fucked up and bullshit"
> urlTmpl('shit is {{status}} and {{qualifier}}', { status: 'fucked up', oops_qualifier: 'bullshit' })
"shit is fucked up and undefined"
@bmount
bmount / cmake_flags_opencv_mac
Created October 1, 2013 02:15
cmake flags for opencv on mac w/ tbb, non-system python, and examples.
cmake -DPYTHON_EXECUTABLE:PATH='/usr/local/bin/python' -DPYTHON_INCLUDE_DIR:PATH='/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/include/python2.7/' -DPYTHON_LIBRARY:PATH='/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib' -DBUILD_EXAMPLES:BOOL="1" -DWITH_TBB:BOOL="1" -G "Unix Makefiles" ..
@bmount
bmount / Python-2.7.3-xcompile.patch
Created October 11, 2013 03:59
Cross compile python 2.7.3 for arm
diff -ur Python-2.7.3.orig/configure Python-2.7.3-Source/configure
--- Python-2.7.3.orig/configure 2012-04-09 19:07:36.000000000 -0400
+++ Python-2.7.3-Source/configure 2012-10-23 14:10:45.305220393 -0400
@@ -13697,7 +13697,7 @@
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
- ac_cv_have_long_long_format=no
+ ac_cv_have_long_long_format="cross -- assuming yes"
else
@bmount
bmount / sf_very_simple.geojson
Created October 17, 2013 06:46
simplified san franciscos
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bmount
bmount / sf_pretty_simple.geojson
Created October 17, 2013 06:48
pretty simplified san francisco
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bmount
bmount / san_francisco_simplified.geojson
Created October 17, 2013 06:53
very but not overly simple San Francisco mainland polygon (.005)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.