Skip to content

Instantly share code, notes, and snippets.

@d3netxer
d3netxer / MapGive 2014 Daily Changesets
Last active August 29, 2015 14:14
MapGive 2014 Daily Changesets
title
@d3netxer
d3netxer / MapGive 2014 Daily Users
Created January 27, 2015 14:20
MapGive 2014 Daily Users
title
@d3netxer
d3netxer / MapGive 2014 Cumulative Changesets
Created January 27, 2015 14:24
MapGive 2014 Cumulative Changesets
title
@d3netxer
d3netxer / embedded gist
Last active August 29, 2015 14:14
embedded gist
title
@d3netxer
d3netxer / embedded gist 2
Created January 27, 2015 21:15
embedded gist 2
title
//return an array of objects according to key, value, or key and value matching
function getObjects(obj, key, val) {
var objects = [];
for (var i in obj) {
if (!obj.hasOwnProperty(i)) continue;
if (typeof obj[i] == 'object') {
objects = objects.concat(getObjects(obj[i], key, val));
} else
//if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not)
if (i == key && obj[i] == val || i == key && val == '') { //
@d3netxer
d3netxer / test_form.html
Created February 14, 2015 12:19
test_form.html
{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
{% load staticfiles %}
<html>
<head>
<style>
#map_canvas {
width: 500px;
height: 400px;
@d3netxer
d3netxer / piura_extent
Created January 6, 2016 19:33
This is the bounding box used for extracting the OSM basemap used in Piura, Peru
left lower right upper
-80.707 -5.259 -80.559 -5.136
/*
This just gets all toilets and drinking water points from March 1st 2010
*/
[date:"2010-03-01T06:55:00Z"];
(
node["amenity"="toilets"]({{bbox}});
node["amenity"="drinking_water"]({{bbox}});
);
out body;
>;
@d3netxer
d3netxer / diff-overpass-query.txt
Created February 27, 2016 23:17
difference Overpass-turbo ql query
/*
This is an example Overpass query that is used to find the differences in all buildings, highways, and POIs between two points in time within the bounding box
*/
[diff:"2016-02-01T15:00:00Z","2016-02-26T15:00:00Z"];
(
// get all buildings
way[building]({{bbox}});
// get all roads
way[highway]({{bbox}});
// get important POIs