Skip to content

Instantly share code, notes, and snippets.

@YKCzoli
YKCzoli / shapefileConversion.md
Last active December 3, 2023 03:37
Step through of converting shapefile to geojson with qgis.

Converting shapefiles to geojson

####Assumptions

Get the data

We will use the Electoral District and Polling Division shapefiles found on the Elections Ontario site:

@YKCzoli
YKCzoli / Lidar_walkthrough.md
Last active November 15, 2023 18:35
Lidar_walkthrough

Processing LiDAR to extract building heights

Walk through

Detailed walk through of building extraction using postgis

First lets pull a data layer from of openstreetmap. You can do this any which way you’d like, as there are a variety of methods for pulling openstreetmap data from their database. Check the [wiki] (http://wiki.openstreetmap.org/wiki/Downloading_data) for a comprehensive list. My favourite method thus far is pulling the data straight into QGIS using the open layers plugin. For those who may want to explore this method, check [this tutorial] (http://www.qgistutorials.com/en/docs/downloading_osm_data.html). For building extraction you only need building footprints, and include the building tags. Not all polygons are of type building in OSM, so we can download all the polygons, and then filter the layer for only polygons tagged as buildings.

LiDAR data was pulled from USGS via the Earth Explorer site. [Here] (http://earthobservatory.nasa.gov/blogs/ele

@YKCzoli
YKCzoli / topShortStories.md
Last active October 7, 2018 16:14
Short Stories that have filled me with awe
Title Author Link
Chicken Hill Joy Williams link
The Balloon Donald Barthelme link
The President Donald Barthelme link
Game Donald Barthelme link
The Party Donald Barthelme link
The School Donald Barthelme link
The Great Hug Donald Barthelme link

Process

tl;dr

This is the scrappy technical overview of processing the Southern Ontario 1954 imagery. I assume you are familiar with gdal, bash scripting, raster imagery. If you are trying to process similar data and something is unclear, feel free to reach out to me with questions.

I first found the data here:

https://mdl.library.utoronto.ca/air-photos/1954

@YKCzoli
YKCzoli / ndvi.py
Created January 25, 2016 22:50 — forked from celoyd/ndvi.py
#!/usr/bin/env python
# ndvi.py red.tif nir.tif output-ndvi.tif
# Calculate NDVI (see Wikipedia). Assumes atmospheric correction.
# (Although I use it without all the time for quick experiments.)
import numpy as np
from sys import argv
from osgeo import gdal, gdalconst
@YKCzoli
YKCzoli / Elevation.md
Last active August 29, 2015 14:25
Elevation data sources (LiDAR, terrain, etc).
#!/bin/bash
echo "Enter bands in descending order, (ie 4 3 2)"
read B1 B2 B3
echo "Enter the resulting filename"
read outputname
@YKCzoli
YKCzoli / MexicoFlood
Last active August 29, 2015 14:07
Mexico flood waters script
#!/bin/bash
echo "Enter bands (ie 4 3 2)"
read B1 B2 B3
echo "Enter the resulting filename"
read outputname
@YKCzoli
YKCzoli / mex-post.md
Last active August 29, 2015 14:07 — forked from dmccarey/mex-post.md

Giving context to open spending data

Historic satellite imagery and flood response

Yesterday the government of Mexico launched datos.gob.mx to open up government data across all ministries. We [built a mapping tool](blog post) for ministries to quickly build rich maps from data on the site. The tool also makes it to combine government data with other open datasets. This provides context and meaning to complex government data.

The first dataset that we mapped was all 2013 funds for disaster response and reconstruction. The map plots thousands of reconstruction projects across 45 natural disasters, including Hurricane Manual and Ingrid which affected two-thirds of Mexico, killing 192 people and causing $75 billion pesos in damage.

This is an incredibily rich and complex dataset. But this data alone is not particularly helpful. We need to better understand the context to understand why government invested funds the w

@YKCzoli
YKCzoli / LAStoolsWine.md
Created September 21, 2014 22:03
LAStools Via Wine

Running LAStools on your Mac

If you want to use LAStools on OS X you will have to do some prep. This is a brief introduction to get you up and running with LAStools on a Mac in the Terminal.

You may have heard that you should use wine to run LAStools on OS X. Depending on your experience this might sound intuitive, or like utter jibberish. For those who empathize with the latter, let's walk through this.

Homebrew

homebrew