This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const key = 'cuisine'; | |
fetch(`https://taginfo.openstreetmap.org/api/4/key/overview?key=${key}`) | |
.then(x => x.json()) | |
.then(d => Math.ceil(d.data.counts[0].values / 999)) | |
.then(numPages => Array.from({length: numPages}, (_, i) => i + 1)) | |
.then(pages => Promise.all(pages | |
.map(i => `https://taginfo.openstreetmap.org/api/4/key/values?key=${key}&page=${i}&rp=999&sortname=count_all&sortorder=desc`) | |
.map(p => fetch(p).then(x => x.json()))) | |
.then(data => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<link type="text/css" rel="stylesheet" href="stylesheet.css"/> | |
<title>Convert GeoJSON</title> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script src="poly.js"></script> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Example: Overpass-API with Leaflet.js</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" /> | |
<style> | |
body { | |
padding: 0; |
-
download the source data
wget http://fred.dev.openstreetmap.org/density/tiles.13 wget http://fred.dev.openstreetmap.org/density/tiles.16
-
convert to simple, gnuplot-readable text format
sed 's/\([0-9]*\) z=\([0-9]*\) x=\([0-9]*\) y=\([0-9]*\)/\3 \4 \1/' < tiles.13 > tiles.13.txt sed 's/\([0-9]*\) z=\([0-9]*\) x=\([0-9]*\) y=\([0-9]*\)/\3 \4 \1/' < tiles.16 > tiles.16.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var url = require('url'); | |
var redis = require('redis'); | |
var base62 = require('base62'); | |
var db = redis.createClient("/var/run/redis/redis-server.sock"); | |
http.createServer(function (req, res) { | |
if (req.method == "OPTIONS") { | |
res.writeHead(200, { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
font-family: 'Rubik'; | |
font-style: normal; | |
font-weight: 400; | |
src: | |
local('Rubik'), | |
local('Rubik-Regular'), | |
url('./rubik-v4-latin-regular.woff2') format('woff2'), | |
url('./rubik-v4-latin-regular.woff') format('woff'); | |
} |
- install node/npm, curl
- compile and install tippecanoe (version 1.8.1 works, not sure about newer releases)
- download
run.sh
from cruncher repo andchmod +x
it - replace osmqatiles-planet url with the extract you want
- adjust paths in
run.sh
(and mkdir the respective working directories) - comment out
hotprojects.sh
(would fail because it requires valid AWS credentials to upload stuff into a hardcoded bucket). - comment out the
forever restart …
lines (requires a tile-serving script to be already running) - execute
run.sh
-> … -> two.mbtiles
files in results directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>st-flurnamen Preview</title> | |
<link rel="stylesheet" type="text/css" href="https://api.mapbox.com/mapbox-gl-js/v0.35.1/mapbox-gl.css" /> | |
<script src="https://api.mapbox.com/mapbox-gl-js/v0.35.1/mapbox-gl.js"></script> | |
<style> | |
body { margin:0; padding:0; background-color:black; } |
NewerOlder