Skip to content

Instantly share code, notes, and snippets.

-- ZRES
-- Takes a web mercator zoom level and returns the pixel resolution for that
-- scale, assuming 256x256 pixel tiles. Non-integer zoom levels are accepted.
-- For databases with the PostGIS extension enabled.
create or replace function zres(z float)
returns float
language plpgsql immutable
as $func$
begin
#!/bin/sh
# Applies a greyscale image as the alpha channel to another image.
# Black will be transparent, white will be opaque.
# Useful for tilesets, ie: find . -name "*.png" -exec alphafy.sh {} \;
tile=$1
fill_tile=/mnt/white.png
echo "Tile: $tile"
diff --git a/map_defaults.json b/map_defaults.json
index f229912..a80724c 100644
--- a/map_defaults.json
+++ b/map_defaults.json
@@ -1,5 +1,9 @@
{
"controls": {
+ "attribution": {
+ "_type": "OpenLayers.Control.Attribution",
+ "_value": "Mapbox Attribution Test"
@ajashton
ajashton / gist:650407
Created October 28, 2010 01:23
Arch Linux PKGBUILD for boost with ICU support
# Maintainer: kevin <kevin@archlinux.org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# TU: Kritoke <kritoke@gamebox.net>
# Contributor: Luca Roccia <little_rock@users.sourceforge.net>
# Contributor: AJ Ashton <aj.ashton@gmail.com>
pkgbase=boost-icu
pkgname=('boost-icu-libs' 'boost-icu')
pkgver=1.43.0
_boostver=1_43_0
@ajashton
ajashton / gist:650415
Created October 28, 2010 01:27
Diff of my Boost-ICU PKGBUILD with the official Arch PKGBUILD
--- PKGBUILD 2010-10-27 21:25:51.375618429 -0400
+++ ../../extra/boost/PKGBUILD 2010-10-19 00:06:41.000000000 -0400
@@ -3,17 +3,16 @@
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# TU: Kritoke <kritoke@gamebox.net>
# Contributor: Luca Roccia <little_rock@users.sourceforge.net>
-# Contributor: AJ Ashton <aj.ashton@gmail.com>
-pkgbase=boost-icu
-pkgname=('boost-icu-libs' 'boost-icu')
Valid docs
----------
2555 candidates
34 provinces
399 districts
4770 centers
14224 stations
Errors
------
52 Map id 35, 2010_iec_id => agcho_id
#!/bin/bash
set -e -u
# 1. render each layer of each zoom level
# 2. combine each layer of each zoom level to one image in a specified manner
# 3. cut each layer into
#### CONFIGURATION ####
ZMIN=0

Notes

  • Order of symbolizers in stylesheet = order in XML? (We need to define it somehow…)

Example 1 style

.rail[zoom>10][status='active'] {
  line-cap: butt;

line-join: round;

{
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs",
"Stylesheet": [
"style.mss"
],
"Layer": [
{
"id": "world",
"name": "world",
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs",
@grass: #b0c765;
@water: #8ac;
@base: #eee;
Map { background-color: #00d4b8; }
#world {
polygon-fill: #8ac;
polygon-pattern-file: url(../images/dc-paper/noise_15.png);
}