Skip to content

Instantly share code, notes, and snippets.

@oeon
oeon / gist:2984150
Created June 24, 2012 17:49
nik2img.py error
nik2img.py ~/mapnik-stylesheets/osm.xml ~/Desktop/test2.png -b -13451764 4205643 -13450743 4206551
/usr/local/lib/python2.7/site-packages/mapnik2/__init__.py:27: DeprecationWarning: mapnik2 module has been deprecated,
please use 'import mapnik'
warnings.warn(msg, DeprecationWarning)
Traceback (most recent call last):
File "/usr/local/share/python/nik2img.py", line 5, in <module>
pkg_resources.run_script('nik2img==0.8.0', 'nik2img.py')
File "/usr/local/lib/python2.7/site-packages/pkg_resources.py", line 499, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/local/lib/python2.7/site-packages/pkg_resources.py", line 1239, in run_script
@oeon
oeon / gist:3035057
Last active April 11, 2016 21:45
buildings in SLO County since, Overpass query, Wget Windows
wget -O bldgs_since_july2012.osm http://www.overpass-api.de/api/xapi?way[building=*][bbox=-121.34792,34.89752,-119.47262,35.79522][@newer=2012-07-01T00:00:00Z][@meta]
@oeon
oeon / overpass_windows_guide.md
Last active October 6, 2015 18:28
using cURL or Wget in Windows to download from OSM Overpass API

###This guide will give you the tools and show you how to download from the OpenStreetMap Overpass API on Windows. These steps were documented while setting up a Windows 7 64-bit machine.###

cURL and Wget are similar utilities to help you download things from the Command Prompt, either one will work - I think cURL might be easier to setup, but depending on your IT restrictions, etc. one or the other might work. You DO NOT need to do both steps A and B, one or the other. But if one method fails, try the other!

@oeon
oeon / gist:3040136
Created July 3, 2012 14:39 — forked from zhm/gist:2005091
gdal configure
./configure \
--with-local=yes \
--prefix=/usr/local/gdal191 \
--with-threads \
--with-libtool \
--with-libtiff=internal \
--with-geotiff=internal \
--with-pcraster=internal \
--with-pcidsk=internal \
--with-bsb \
@oeon
oeon / gist:3100839
Created July 12, 2012 20:43
To download all filenames in a file (e.g. slo-naip.txt)
for i in `cat slo-naip.txt`; do wget http://atlas.ca.gov/casil/imageryBaseMapsLandCover/imagery/naip/naip_2009/usda_file_archive/$i; done
@oeon
oeon / gist:3100844
Created July 12, 2012 20:43
To move all files with '_11_' in their filename to child-folder 'reproj11to10' and replace '_11_' with '_10_'
for f in *_11_*; do mv "$f" ./reproj11to10/"${f/_11_/_10_}"; done
@oeon
oeon / gist:3101727
Created July 12, 2012 23:09
trim rasters from ogrinfo extent
#!/bin/bash
FILES=$(ls *.shp);
for FILE in $FILES
cat list.txt | while read CMD;
do
gdal_translate -projwin ${CMD} -of GTiff ${FILE} ./out/${FILE}
done
@oeon
oeon / gist:3102024
Created July 13, 2012 00:25
cmds.txt
gdal_translate -projwin -13302785.635986 4163877.309471 -13288869.959473 4146903.661950 -of Gtiff q34119h4.tif ./out/q34119h4.tif
gdal_translate -projwin -13316701.191659 4163877.700109 -13302785.494631 4146903.990611 -of Gtiff q34119h5.tif ./out/q34119h5.tif
gdal_translate -projwin -13330616.704686 4163877.897787 -13316701.075446 4146904.089703 -of Gtiff q34119h6.tif ./out/q34119h6.tif
gdal_translate -projwin -13344532.132744 4163878.046962 -13330616.686824 4146904.390049 -of Gtiff q34119h7.tif ./out/q34119h7.tif
gdal_translate -projwin -13400194.366653 4163878.002708 -13386278.711280 4146904.265636 -of Gtiff q34120h3.tif ./out/q34120h3.tif
gdal_translate -projwin -13414109.994240 4163878.152445 -13400194.309761 4146904.201157 -of Gtiff q34120h4.tif ./out/q34120h4.tif
gdal_translate -projwin -13428025.508028 4163878.152445 -13414109.956973 4146904.201157 -of Gtiff q34120h5.tif ./out/q34120h5.tif
gdal_translate -projwin -13441941.024982 4163878.959014 -13428025.433026 4146904.067557 -of Gtiff q34120h6.tif ./o
@oeon
oeon / tilemapresource.xml
Created July 15, 2012 19:52
tilemapresource.xml for slo_usgs mosaic.vrt
<?xml version="1.0" encoding="utf-8"?>
<TileMap version="1.0.0" tilemapservice="http://tms.osgeo.org/1.0.0">
<Title>mos2rgba.vrt</Title>
<Abstract></Abstract>
<SRS>EPSG:900913</SRS>
<BoundingBox minx="34.87497870982493" miny="-121.37605128402282" maxx="35.87498049818777" maxy="-119.37594688316540"/>
<Origin x="34.87497870982493" y="-121.37605128402282"/>
<TileFormat width="256" height="256" mime-type="image/png" extension="png"/>
<TileSets profile="mercator">
<TileSet href="14" units-per-pixel="9.55462853393555" order="14"/>
@oeon
oeon / gist:3153797
Created July 20, 2012 23:11
What do short-term, near-term fire behavior mean?
  • Short-Term Fire Behavior: 1-3 days. Right here, right now. A 'snapshot in time' as weather and wind conditions do not change for the length of the simulation period in the model.
  • Near-Term Fire Behavior: 1-5 days (or the availability of forecast weather). The weather conditions change throughout the simulation duration of the model.
  • FSPro: used when intelligence is desired beyond immediate, known, high-confidence forecasts. Commonly used when planning for incidents 7 + days into the future, as confidence in forecasts decreases with time. Many weather scenarios are simulated throughout the simulation duration of the model.

via https://wfdss.usgs.gov/wfdss/WFDSS_FAQ_Analysis.shtml