Skip to content

Instantly share code, notes, and snippets.

Michal Migurski migurski

Block or report user

Report or block migurski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@migurski
migurski / merge-geojsons.py
Created Sep 21, 2012
Merge multiple GeoJSON files into one
View merge-geojsons.py
from json import load, JSONEncoder
from optparse import OptionParser
from re import compile
float_pat = compile(r'^-?\d+\.\d+(e-?\d+)?$')
charfloat_pat = compile(r'^[\[,\,]-?\d+\.\d+(e-?\d+)?$')
parser = OptionParser(usage="""%prog [options]
Group multiple GeoJSON files into one output file.
View Landsat 8 gdal processing
#! /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:
@migurski
migurski / Mercator.ipynb
Last active Jan 8, 2019
Mercator Projection with GDAL
View Mercator.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@migurski
migurski / gray-scott.py
Created Sep 9, 2012
Adaptation of Nicolas P. Rougier’s Gray-Scott implementation with the Glumpy dependencies removed
View gray-scott.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright INRIA
# Contributors: Nicolas P. Rougier (Nicolas.Rougier@inria.fr)
#
# DANA is a computing framework for the simulation of distributed,
# asynchronous, numerical and adaptive models.
#
# This software is governed by the CeCILL license under French law and abiding
@migurski
migurski / VA.geojson
Created Nov 1, 2018
Sample Virginia PlanScore model tiles
View VA.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@migurski
migurski / 13-2333-3172.geojson
Created Nov 1, 2018
Sample Virginia PlanScore model tile 13/2333/3172
View 13-2333-3172.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@migurski
migurski / 10-285-394.geojson
Created Nov 1, 2018
Sample Virginia PlanScore model tile 10/285/394
View 10-285-394.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@migurski
migurski / RemoteGeoJSON.py
Created Dec 14, 2012
Sample datasource for remote tiled data in Mapnik.
View RemoteGeoJSON.py
''' Sample datasource for remote tiled data in Mapnik.
See also https://github.com/mapnik/mapnik/wiki/Python-Plugin
Use in Mapnik:
<Datasource>
<Parameter name="type">python</Parameter>
<Parameter name="factory">RemoteGeoJSON:Datasource</Parameter>
@migurski
migurski / brooklynt.sql
Last active Jul 26, 2018
Use Brooklyn Integers directly in Postgres
View brooklynt.sql
--
-- Table of available integers with a boolean column for when they're used up.
--
DROP TABLE IF EXISTS brooklyn_integers;
CREATE TABLE brooklyn_integers (used BOOLEAN DEFAULT false NOT NULL, value BIGINT NOT NULL);
CREATE INDEX brooklyn_integers_used ON brooklyn_integers (used);
CREATE UNIQUE INDEX brooklyn_integers_value ON brooklyn_integers (value);
--
-- Request a single unused integer and mark it used.
@migurski
migurski / polygonize.py
Created Apr 25, 2012
Polygonize a bag of lines
View polygonize.py
from sys import argv
from shapely.ops import polygonize
from shapely.geometry import asShape, LineString
import json
if __name__ == '__main__':
input = argv[1]
input = json.load(open(input))
You can’t perform that action at this time.