Commit 0cb26239 authored by Michael Murtaugh's avatar Michael Murtaugh
Browse files

variable tilesize and bin in makefile, map template

parent 25fb22fa
...@@ -43,37 +43,37 @@ bin/texture: ...@@ -43,37 +43,37 @@ bin/texture:
# contours # contours
%.contours.svg: %.png %.contours.svg: %.png
contours/contours $< > $@ bin/contours $< > $@
%.contours.svg: %.jpg %.contours.svg: %.jpg
contours/contours $< > $@ bin/contours $< > $@
# texture (& lexicality, textline, para, block # texture (& lexicality, textline, para, block
%.texture.svg: %.png %.texture.svg: %.png
texture/build/texture $< $*.texture.svg $*.lexicality.svg $*.textline.svg $*.para.svg $*.block.svg bin/texture $< $*.texture.svg $*.lexicality.svg $*.textline.svg $*.para.svg $*.block.svg
%.texture.svg: %.jpg %.texture.svg: %.jpg
texture/build/texture $< $*.texture.svg $*.lexicality.svg $*.textline.svg $*.para.svg $*.block.svg bin/texture $< $*.texture.svg $*.lexicality.svg $*.textline.svg $*.para.svg $*.block.svg
# channel # channel
%.red.png: %.png %.red.png: %.png
channel/channel $< $*.red.png $*.green.png $*.blue.png bin/channel $< $*.red.png $*.green.png $*.blue.png
%.red.png: %.jpg %.red.png: %.jpg
channel/channel $< $*.red.png $*.green.png $*.blue.png bin/channel $< $*.red.png $*.green.png $*.blue.png
%.green.png: %.png %.green.png: %.png
channel/channel $< $*.red.png $*.green.png $*.blue.png bin/channel $< $*.red.png $*.green.png $*.blue.png
%.green.png: %.jpg %.green.png: %.jpg
channel/channel $< $*.red.png $*.green.png $*.blue.png bin/channel $< $*.red.png $*.green.png $*.blue.png
%.blue.png: %.png %.blue.png: %.png
channel/channel $< $*.red.png $*.green.png $*.blue.png bin/channel $< $*.red.png $*.green.png $*.blue.png
%.blue.png: %.jpg %.blue.png: %.jpg
channel/channel $< $*.red.png $*.green.png $*.blue.png bin/channel $< $*.red.png $*.green.png $*.blue.png
# houghlines # houghlines
# Z3.hough.png <= Z3.png # Z3.hough.png <= Z3.png
# Z3.hough.X0Y0.png <= Z3.hough.png # Z3.hough.X0Y0.png <= Z3.hough.png
%.hough.svg: %.jpg %.hough.svg: %.jpg
houghlines/build/houghlines $< > $@ bin/houghlines $< > $@
%.hough.svg: %.png %.hough.svg: %.png
houghlines/build/houghlines $< > $@ bin/houghlines $< > $@
# gradient: NEEDS WORK # gradient: NEEDS WORK
# %.gradient.png: %.jpg # %.gradient.png: %.jpg
...@@ -88,14 +88,17 @@ bin/texture: ...@@ -88,14 +88,17 @@ bin/texture:
################################ ################################
# VIEWER rules # VIEWER rules
# pyramid rules # pyramid rules
TILESIZE=128
.PRECIOUS: %/Z0.png %/Z1.png %/Z2.png %/Z3.png %/Z4.png %/Z5.png .PRECIOUS: %/Z0.png %/Z1.png %/Z2.png %/Z3.png %/Z4.png %/Z5.png
%/Z0.png: %.png %/Z0.png: %.png
mkdir -p $* mkdir -p $*
python viewer/pyramid.py $< --output "$*/Z{z}.png" python viewer/pyramid.py $< --tilesize $(TILESIZE) --output "$*/Z{z}.png"
%/Z0.png: %.jpg %/Z0.png: %.jpg
mkdir -p $* mkdir -p $*
python viewer/pyramid.py $< --output "$*/Z{z}.png" python viewer/pyramid.py $< --tilesize $(TILESIZE) --output "$*/Z{z}.png"
# SVG to png # SVG to png
%.png: %.svg %.png: %.svg
...@@ -103,19 +106,21 @@ bin/texture: ...@@ -103,19 +106,21 @@ bin/texture:
# tile rule # tile rule
%.X0Y0.png : %.png %.X0Y0.png : %.png
python viewer/tile.py $< --output "$*.X{x}Y{y}.png" python viewer/tile.py $< --tilesize $(TILESIZE) --output "$*.X{x}Y{y}.png"
# make the map # make the map
%.html: %.png %.html: %.png
mkdir -p $* mkdir -p $*
python viewer/makeviewer.py \ python viewer/makeviewer.py \
--tilesize $(TILESIZE) \
--template viewer/map.html \ --template viewer/map.html \
--output $@ $< --output $@ $<
%.html: %.jpg %.html: %.jpg
mkdir -p $* mkdir -p $*
python viewer/makeviewer.py \ python viewer/makeviewer.py \
--tilesize $(TILESIZE) \
--template viewer/map.html \ --template viewer/map.html \
--output $@ $< --output $@ $<
%/error.jpg: %/error.jpg:
convert -size 256x256 canvas:red $@ convert -size $(TILESIZE)x$(TILESIZE) canvas:red $@
...@@ -36,6 +36,7 @@ var map = L.map('map', { ...@@ -36,6 +36,7 @@ var map = L.map('map', {
// originals/2016-11-09/Z0.hough.X0Y0.png // originals/2016-11-09/Z0.hough.X0Y0.png
var pixels = L.tileLayer("{{basename}}/Z{z}.X{x}Y{y}.png", { var pixels = L.tileLayer("{{basename}}/Z{z}.X{x}Y{y}.png", {
continuousWorld: true, continuousWorld: true,
tileSize: {{tilesize}},
errorTileUrl: "error.jpg", errorTileUrl: "error.jpg",
bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]] bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]]
}).addTo(map), }).addTo(map),
...@@ -46,16 +47,19 @@ var pixels = L.tileLayer("{{basename}}/Z{z}.X{x}Y{y}.png", { ...@@ -46,16 +47,19 @@ var pixels = L.tileLayer("{{basename}}/Z{z}.X{x}Y{y}.png", {
var red = L.tileLayer("{{basename}}/Z{z}.red.X{x}Y{y}.png", { var red = L.tileLayer("{{basename}}/Z{z}.red.X{x}Y{y}.png", {
continuousWorld: true, continuousWorld: true,
tileSize: {{tilesize}},
errorTileUrl: "error.jpg", errorTileUrl: "error.jpg",
bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]] bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]]
}); });
var green = L.tileLayer("{{basename}}/Z{z}.green.X{x}Y{y}.png", { var green = L.tileLayer("{{basename}}/Z{z}.green.X{x}Y{y}.png", {
continuousWorld: true, continuousWorld: true,
tileSize: {{tilesize}},
errorTileUrl: "error.jpg", errorTileUrl: "error.jpg",
bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]] bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]]
}); });
var blue = L.tileLayer("{{basename}}/Z{z}.blue.X{x}Y{y}.png", { var blue = L.tileLayer("{{basename}}/Z{z}.blue.X{x}Y{y}.png", {
continuousWorld: true, continuousWorld: true,
tileSize: {{tilesize}},
errorTileUrl: "error.jpg", errorTileUrl: "error.jpg",
bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]] bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]]
}); });
...@@ -63,36 +67,43 @@ var blue = L.tileLayer("{{basename}}/Z{z}.blue.X{x}Y{y}.png", { ...@@ -63,36 +67,43 @@ var blue = L.tileLayer("{{basename}}/Z{z}.blue.X{x}Y{y}.png", {
var contours = L.tileLayer("{{basename}}/Z{z}.contours.X{x}Y{y}.png", { var contours = L.tileLayer("{{basename}}/Z{z}.contours.X{x}Y{y}.png", {
continuousWorld: true, continuousWorld: true,
tileSize: {{tilesize}},
errorTileUrl: "error.jpg", errorTileUrl: "error.jpg",
bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]] bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]]
}), }),
hough = L.tileLayer("{{basename}}/Z{z}.hough.X{x}Y{y}.png", { hough = L.tileLayer("{{basename}}/Z{z}.hough.X{x}Y{y}.png", {
continuousWorld: true, continuousWorld: true,
tileSize: {{tilesize}},
errorTileUrl: "error.jpg", errorTileUrl: "error.jpg",
bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]] bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]]
}), }),
texture = L.tileLayer("{{basename}}/Z{z}.texture.X{x}Y{y}.png", { texture = L.tileLayer("{{basename}}/Z{z}.texture.X{x}Y{y}.png", {
continuousWorld: true, continuousWorld: true,
tileSize: {{tilesize}},
errorTileUrl: "error.jpg", errorTileUrl: "error.jpg",
bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]] bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]]
}), }),
lexicality = L.tileLayer("{{basename}}/Z{z}.lexicality.X{x}Y{y}.png", { lexicality = L.tileLayer("{{basename}}/Z{z}.lexicality.X{x}Y{y}.png", {
continuousWorld: true, continuousWorld: true,
tileSize: {{tilesize}},
errorTileUrl: "error.jpg", errorTileUrl: "error.jpg",
bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]] bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]]
}), }),
textline = L.tileLayer("{{basename}}/Z{z}.textline.X{x}Y{y}.png", { textline = L.tileLayer("{{basename}}/Z{z}.textline.X{x}Y{y}.png", {
continuousWorld: true, continuousWorld: true,
tileSize: {{tilesize}},
errorTileUrl: "error.jpg", errorTileUrl: "error.jpg",
bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]] bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]]
}), }),
para = L.tileLayer("{{basename}}/Z{z}.para.X{x}Y{y}.png", { para = L.tileLayer("{{basename}}/Z{z}.para.X{x}Y{y}.png", {
continuousWorld: true, continuousWorld: true,
tileSize: {{tilesize}},
errorTileUrl: "error.jpg", errorTileUrl: "error.jpg",
bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]] bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]]
}), }),
block = L.tileLayer("{{basename}}/Z{z}.block.X{x}Y{y}.png", { block = L.tileLayer("{{basename}}/Z{z}.block.X{x}Y{y}.png", {
continuousWorld: true, continuousWorld: true,
tileSize: {{tilesize}},
errorTileUrl: "error.jpg", errorTileUrl: "error.jpg",
bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]] bounds: [[bounds.lat+1, 1], [-1, bounds.lng-1]]
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment