Skip to content

Instantly share code, notes, and snippets.

@wallclimber21
wallclimber21 / eav.sql
Last active August 29, 2015 14:10 — forked from vwood/eav.sql
-- Entity Attribute Value Model in Postgres
CREATE TABLE public.entity (
id serial NOT NULL,
type varchar(25) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE public.defined_attributes (
key varchar(25) NOT NULL,
COMPRESS = -co "COMPRESS=LZW"
#SRC_PREFIX = "/Volumes/Tom\'s\ Time\ Capsule/topos"
SRC_PREFIX = .
#TOPOS_SRC = $(wildcard $(SRC_PREFIX)/orig/*.tif)
#MASTER_TILES_PNG = $(wildcard $(SRC_PREFIX)/master_tiles/*/*/*.png)
TOPOS_SRC = $(wildcard orig/*.tif)
@wallclimber21
wallclimber21 / gist:197749
Created September 30, 2009 03:49
Patch to gdal2tiles.py so that it creates tiles that follow the Google tiles naming convention
@@ -1094,7 +1111,10 @@
for tx in range(tminx, tmaxx+1):
ti += 1
- tilefilename = os.path.join(self.output, str(tz), str(tx), "%s.%s" % (ty, self.tileext))
+
+ gtx, gty = self.mercator.GoogleTile(tx, ty, tz)
+ tilefilename = os.path.join(self.output, str(tz), str(gtx), "%s.%s" % (gty, self.tileext))
+
if self.options.verbose: