Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
create or replace function way_to_wkt(way_id int)
returns text
language plpgsql as
$$
declare
nodes bigint[] := (select nodes from planet_osm_ways where id = way_id);
i smallint := 0;
coords text[];
begin
if array_length(nodes, 1) = 0 then
<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.6' upload='false' generator='JOSM'>
<node id='16778' action='modify' visible='true' lat='43.842114107934925' lon='-79.63129648091999' />
<node id='16776' action='modify' visible='true' lat='43.842107987714705' lon='-79.62709612952295' />
<node id='16774' action='modify' visible='true' lat='43.843093335083026' lon='-79.62713007175645' />
<node id='16773' action='modify' visible='true' lat='43.843062734477925' lon='-79.63127950980324' />
<node id='16747' action='modify' visible='true' lat='43.844844058535344' lon='-79.62717580224816' />
<node id='16745' action='modify' visible='true' lat='43.843433292840004' lon='-79.6271458012688' />
<node id='16743' action='modify' visible='true' lat='43.84342031017868' lon='-79.62839984220587' />
<node id='16742' action='modify' visible='true' lat='43.84485704088682' lon='-79.62842384298935' />
|( • ‿ • )|
|( U ‿ U )|
|( U ⁔ U )|
|( ° - ° )|
|( × _ × )|
// eg:
// osmjs -l sparsetable -2 -m -j osmjs_callbacsk_test.js <osm_file>
var called_node, called_way, called_relation, called_multipolygon;
Osmium.Callbacks.init = function() { print('✔ init'); }
Osmium.Callbacks.before_relations = function() { print('✔ before_relations'); }
Osmium.Callbacks.relation = function() {
if (!called_relation) {
@ajashton
ajashton / index.html
Created December 12, 2012 21:24 — forked from tmcw/index.html
<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.7/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
@ajashton
ajashton / index.html
Created November 15, 2012 17:08 — forked from tmcw/README.md
One-way markers demo
<!DOCTYPE html>
<meta charset="utf-8">
<title>SVG Swarm</title>
<style>
svg {
position: absolute;
top: 0;
}
#rail {
::line,
::hatch {
line-color: #666;
}
::line {
line-width: 1;
}
::hatch {
line-width: 4;