Skip to content

Instantly share code, notes, and snippets.

View maning's full-sized avatar

Maning Sambale maning

View GitHub Profile
@maning
maning / tiler.py
Created July 8, 2018 15:19 — forked from daniel-j-h/tiler.py
Tiles GeoTIFF for zoom level
#!/usr/bin/env python3
'''
pip install tqdm numpy pillow mercantile 'rasterio==1.0b1' 'rio-tiler==1.0a7'
'''
import os
import argparse
@maning
maning / ogrcat
Created June 12, 2017 09:05 — forked from perrygeo/ogrcat
ogrcat: make line-delimited geojson features to stdout from any ogr vector datasource
#!/bin/bash
#
# ogrcat
# produces line-delimited geojson features
# Like `fio cat` but uses ogr2ogr under the hood
ECHO_FEATURES=""
ogr2ogr -f GeoJSON /vsistdout/ "$@" | while read line
#! /bin/bash -ex
# Convert Landsat 8 GeoTIFF images into RGB pan-sharpened JPEGs.
#
# Requirements:
# * gdal http://www.mapbox.com/tilemill/docs/guides/gdal/
# * Dan Stahlke's https://github.com/gina-alaska/dans-gdal-scripts
# * convert (image-magick)
#
# Reference info:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maning
maning / Updating NYC building footprints.md
Last active August 12, 2016 03:41 — forked from planemad/Updating NYC building footprints.md
Refreshing NYC building footprints

NYC had an import of over 1 million building footprints and 900,000 addresses in 2014 from the New York City Department of Information Technology and Telecommunications (DoITT). The DoITT GIS releases an updated shapefile of the footprints every quarter, and the latest version can be accessed here: Building footprints | Address points

Open datasets like these are a great opportunity to explore how OSM can be used as a bridge between authoritative information and that crowdsourced by citizens. Two years after the import, it is interesting to see how the OSM data compares with the latest official footprints. The interesting questions to ask is:

  • What has improved in the DoITT footprints that can be updated in OSM?
  • What has
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Mabuhay!

Welcome to the Open Source for Geography developers training.

This week we will learn about the basic building blocks for web based gis systems and desktop analysis tools. We will cover topics such as Git/Github, Postgis, GeoServer, Tilemill, GeoNode, QGIS and Inasafe. During the training, there will be tutorials on each of the tools and will work together on a prototype for a web based flood impact analysis tool.

This gist will be both our agenda and minutes document. It contains links to the training materials as well as the description of each activity.

#!/usr/bin/perl
# Create index.html with a list of all files.
# Written by Ilya Zverev, licensed WTFPL.
use strict;
use POSIX qw(strftime);
use HTML::Template;
use File::Basename;
use Getopt::Long;
@maning
maning / wfs2postgis.sh
Created September 27, 2012 01:28 — forked from walkermatt/wfs2postgis.sh
WFS to PostGIS
# Example of downloading all data from a GeoServer WFS server
# and loading it into a PostGIS database. Use with caution
# as you could put a lot of load on someone's server if they
# host a lot of data which might make them sad.
# In response to: http://underdark.wordpress.com/2012/09/26/wfs-to-postgis-in-3-steps/
BASEURL="http://data.wien.gv.at/daten/geoserver/ows?service=WFS&version=1.1.0"
for LAYERNAME in `wget -qO- $BASEURL"&request=GetCapabilities" | xpath -q -e "//FeatureType/Name/text()"` ; do
PARTS=(${LAYERNAME//:/ })
@maning
maning / export.py
Created January 12, 2012 01:54 — forked from rosskarchner/export.py
extract tiles from an mbtiles file
import sqlite3, os
conn = sqlite3.connect('Mills1860.mbtiles')
results=conn.execute('select * from tiles').fetchall()
for result in results:
zoom, column, row, png= result
try:
os.makedirs('%s/%s/' % (zoom, row))