Skip to content

Instantly share code, notes, and snippets.

@mojodna
mojodna / SDTonerMapSource.h
Created Feb 21, 2014
Toner map provider for the Mapbox SDK.
View SDTonerMapSource.h
//
// SDTonerMapSource.h
// Toner Maps
//
#import <MapBox.h>
#import <UIKit/UIKit.h>
@interface SDTonerMapSource : RMAbstractWebMapSource
@mojodna
mojodna / hstore.style
Created Apr 12, 2014
osm2pgsql style for hstore data
View hstore.style
way way_area real
way z_order integer
# These tags can be long but are useless for rendering.
# This indicates that we shouldn't store them.
# List from <http://lists.osm.org/pipermail/dev/2012-June/025046.html>
# OsmType Tag DataType Flags
node,way 3dshapes:* text delete
node,way AND_nosr_r text delete
node,way b5m:* text delete
@mojodna
mojodna / tilelive-minimal.js
Created Jul 30, 2014
A minimal tilelive source.
View tilelive-minimal.js
"use strict";
/**
* Note:
*
* setImmediate(callback, null, {});
*
* is shorthand for:
*
* setImmediate(function() {
View README.md
View label-scaling.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map[]>
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" buffer-size="128">
<Parameters>
<Parameter name="bounds">-120.0146,27.6057,-104.6118,36.0313</Parameter>
<Parameter name="center">-113.4888,32.38,6</Parameter>
</Parameters>
@mojodna
mojodna / Dockerfile
Created Nov 30, 2014
Minimalist awscli image w/ aws-cfn-bootstrap installed. Available from http://quay.io/mojodna/awscli
View Dockerfile
FROM debian
ENV DEBIAN_FRONTEND noninteractive
RUN \
apt-get update && \
apt-get install --no-install-recommends -y python-pip groff-base && \
apt-get clean && \
pip install awscli
@mojodna
mojodna / generate_hillshades.js
Created Dec 4, 2014
Parallelize hillshade generation using PostGIS. Much worse than generating hillshades from GeoTIFF inputs.
View generate_hillshades.js
#!/usr/bin/env node
"use strict";
var os = require("os");
var async = require("async"),
env = require("require-env"),
pg = require("pg"),
ProgressBar = require("progress");
@mojodna
mojodna / print.js
Created Feb 23, 2015
Calculate zoom / bounds for target image size
View print.js
"use strict";
var assert = require("assert");
var merc = new (require("sphericalmercator"))();
var BASE_PPI = 72, // native ppi
BASE_ZOOM = 22; // sufficiently large zoom level to use pixels at
var getView = function(options) {
@mojodna
mojodna / queue_srtm.js
Created Apr 25, 2015
Vapor clock feeder
View queue_srtm.js
#!/usr/bin/env node
/* eslint-disable no-sync */
"use strict";
var assert = require("assert"),
fs = require("fs"),
path = require("path"),
util = require("util");
var env = require("require-env"),
View osm.xml
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://tile.openstreetmap.org/${z}/${x}/${y}.png</ServerUrl>
</Service>
<DataWindow>
<UpperLeftX>-20037508.34</UpperLeftX>
<UpperLeftY>20037508.34</UpperLeftY>
<LowerRightX>20037508.34</LowerRightX>
<LowerRightY>-20037508.34</LowerRightY>
<TileLevel>18</TileLevel>
You can’t perform that action at this time.