Skip to content

Instantly share code, notes, and snippets.

View david-murr's full-sized avatar

David Murr david-murr

View GitHub Profile
@mwkorver
mwkorver / mapserver.user-data
Last active August 24, 2016 14:36
EC2 user data script to deploy MapServer container mounting USDA NAIP data (about 100TB) in aws-naip bucket.
#cloud-boothook
#!/bin/bash
set -x
# This EC2 user-data file will run a Mapserver docker container.
# Still working on getting it to reboot properly. See this link for more info on user-data scripts
# http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#user-data-shell-scripts
# Because this setup uses data stored in an S3 bucket located in the standard region, it needs to be run in us-east-1 (Virginia Region).
# It mounts S3 data by using danilop/yas3fs. USDA CONUS NAIP data, Mapfile and shapefile indexes are made available to Mapserver in this way.
# Just running this instance will give you access to all of the NAIP data via the EC2 instance's filesystem.
# One caveat is that the combination of mapfile and UTM projected geotifs only supports WMS requests near native 1m/pixel resolution or level 17,
@perrygeo
perrygeo / .geotiff_headers.md
Last active June 2, 2020 16:21
Parsing geotiff headers

Optimized determination of Geotiff bounds

This is functional but is merely a workaround until we get vsis3 - you can try out preliminary vsis3 support with GDAL 2.1 and rasterio 0.32a1

Goal: Based on the GeoTiff and TIFF specs, manually parse out tags to allow for the most IO-efficient reading of georeferencing information.

It works almost the same as rio info --bounds but gives a json array, and it's fast

$ time rio info --bounds R4C1.tif

153.984375 24.2578125 154.072265625 24.345703125

@nickpeihl
nickpeihl / README.md
Last active April 5, 2017 16:24
NDVI With ArcGIS Image Services and Geojson.io
  1. Go here: http://geojson.io/#map=18/34.12668/-84.11506

  2. Open the browser developer console - ctrl + shift + k on Firefox or ctrl + shift + i on Chrome.

  3. Type the following into the browser console: window.api.map.addLayer(L.tileLayer('http://tileify-ags.herokuapp.com/tiles/{z}/{x}/{y}?url=https%3A%2F%2Fgis.apfo.usda.gov%2Farcgis%2Frest%2Fservices%2FNAIP%2FGeorgia_2015_1m%2FImageServer&renderingRule=%7B%20%20%20%22rasterFunction%22%20%3A%20%22NDVI%22%2C%20%20%20%22rasterFunctionArguments%22%20%3A%20%7B%20%20%20%20%20%22VisibleBandID%22%20%3A%202%2C%20%20%20%20%20%22InfraredBandID%22%20%3A%203%20%20%20%7D%2C%20%20%20%22variableName%22%20%3A%20%22Raster%22%20%7D'));

  4. Try replacing the ArcGIS Image Service URL with a different URL from here. Be sure to encode the URL correctly. For help encoding go here

[More info on ArcGIS Image Service Raster