Skip to content

Instantly share code, notes, and snippets.

#######################################################################
###BASH FOR PROCESSING LANDSAT 8 (8-BIT CONVERSION NEEDED AND INCLUDED)
########################################################################
###MAKE SURE IMAGERY ZIP FILE IS IN L8_IMAGERY FOLDER ON DESKTOP
###THIS SPECIFIC COLOR TWEAKING WAS DESIGNED FOR BAIJI IRAQ AND THEREFORE
###WILL BEST FIT DESERT REGIONS!
Folder="Baiji_Jun18"
# https://www.mapbox.com/blog/processing-landsat-8/
task :landsat_2014 => :environment do
dirs = Dir["#{Rails.root.to_s}/db/initial/raster/*"].reject {|q| q =~ /tar\.gz/ }
dirs.each do |dir|
scene_id = dir.split("/")[-1]
[4,3,2].each do |band|
`gdalwarp -t_srs EPSG:3857 #{dir}/#{scene_id}_B#{band}.TIF #{dir}/#{scene_id}_B#{band}-projected.tif`
end
`convert -combine #{dir}/#{scene_id}_B{4,3,2}-projected.tif #{dir}/#{scene_id}_RGB-projected.tif && \
convert -channel B -gamma 0.925 -channel R -gamma 1.03 -channel RGB -sigmoidal-contrast 50x16% #{dir}/#{scene_id}_RGB-projected.tif #{dir}/#{scene_id}_RGB-projected-corrected.tif && \
@mpmckenna8
mpmckenna8 / index.html
Last active August 29, 2015 14:03
Turf.js distance first try w/ d3 map topojson data
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg{
background:#2379d5;
}
.texto{
font-size:13px;
}
@briantjacobs
briantjacobs / structured-wikipedia.md
Last active May 14, 2022 15:36
Structured Wikipedia data resources
@romanz
romanz / fullnode.md
Last active March 20, 2024 19:05
Bitcoin Full Node on AWS Free Tier

Bitcoin Full Node on AWS Free Tier

Provisioning

  • Launch one T2 micro instance, using Ubuntu 14.04 LTS AMI.
  • Open SSH and Bitcoin Protocol TCP ports: 22, 8333.
  • Attach 40GB EBS (General-Purpose SSD) volume for blockchain storage to /dev/sdf.

The pricing should be ~3$ for the first year (assuming 30GB upload per month). See here for more details.

@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

@mapmeld
mapmeld / mapboxgl.md
Last active March 4, 2019 15:12
Getting Started with MapBoxGL

Getting Started

I recently made my first map with MapBox's new WebGL+JavaScript API. There aren't many examples of how to do this yet, even on MapBox's API page, so I'll document my own experience here.

The Van Gogh Map

My map is made of several textures taken from Van Gogh paintings. The long-term goal is to allow a user to select which artworks they want to take textures from, but for now there is just one setting.

Why are we changing maps?

request (49)
underscore (36)
glob (20)
once (19)
lru-cache (15)
optimist (14)
async (14)
minimatch (14)
lodash (13)
node-uuid (13)
L.tileLayer.fancyCanvas = function(url){
var layer = L.tileLayer.canvas({async: true});
layer.setUrl(url);
var dataSource = function(x, y, z, done){
var url = layer.getTileUrl({x: x, y: y, z: z});
d3.xhr(url).responseType('arraybuffer').get(done);
};
layer.data = function(fn){
dataSource = fn;
@klokan
klokan / Dockerfile
Created January 29, 2015 01:13
GDAL in Docker - stable GDAL with JP2KAK, MRSID and ECW: https://registry.hub.docker.com/u/klokantech/gdal/
FROM debian:7
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -qq update \
&& apt-get -qq -y --no-install-recommends install \
autoconf \
automake \
build-essential \
curl \