This file contains hidden or 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
| #!/usr/bin/env coffee | |
| { createServer } = require "net" | |
| irc = require "irc" | |
| NICK = "munin-spline" | |
| PIPE = "./pipe.sock" | |
| channels = ["#spline"] |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8" ?> | |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <meta name="generator" content="Docutils 0.7: http://docutils.sourceforge.net/" /> | |
| <title>Downtime</title> | |
| <style type="text/css"> | |
| /* |
This file contains hidden or 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
| SELECT | |
| ST_ConvexHull(ST_Collect(planet_osm_point.way)) AS convexHull, | |
| ST_Centroid(ST_ConvexHull(ST_Collect(planet_osm_point.way))) AS centroid | |
| FROM | |
| planet_osm_polygon, | |
| planet_osm_point |
This file contains hidden or 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
| SELECT | |
| planet_osm_point.name, | |
| ST_Distance( | |
| Geography(ST_Transform(planet_osm_point.way,4326)), | |
| Geography(ST_Transform(ST_Centroid(planet_osm_polygon.way),4326)) | |
| ) | |
| FROM |
This file contains hidden or 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
| class Node: | |
| def __init__(self,value): | |
| self.left = Leaf() | |
| self.right = Leaf() | |
| self.value = value | |
| self.maxima = value.high | |
| def search(tree,interval): | |
| if interval.low > tree.maxima: |
This file contains hidden or 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
| #!/usr/bin/env python2 | |
| from shapely.geometry import Polygon | |
| from matplotlib import pyplot | |
| from descartes import PolygonPatch | |
| class IntervalTree(object): |
This file contains hidden or 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
| [21:27:59] ways: 12875k/12875k | |
| [21:28:02] ways: total time 1 h 29m 48s for 12875277 (2389/s) | |
| [21:30:02] nodes: 561k/561k | |
| [21:30:03] nodes: total time 2 m 1 s for 561535 (4635/s) | |
| create_generalized_tables | |
| create_views | |
| [21:30:03] writing took 1 h 40m 38s | |
| [21:30:03] imposm took 1 h 40m 38s |
This file contains hidden or 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
| #!/usr/bin/env python2 | |
| # make sure to install shapely and matplotlib | |
| # pip install shapely matplotlib | |
| # maybe use a virtual environment | |
| p1=(350,75) | |
| p2=(379,161) | |
| p3=(469,161) | |
| p4=(397,215) |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| ''' | |
| Simple script to create geojson from osm files. | |
| Prints geojson features line by line. | |
| Currently we don't support relations. | |
| Requires (unmodified) imposm and imposm.parser | |
| Inspired by https://github.com/emka/OSMCouch | |
| ''' |
This file contains hidden or 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 pg = require("pg"); | |
| var connectionString = "xxx"; | |
| pg.connect(connectionString, function(error, client){ | |
| if(error) { | |
| console.log(error); | |
| } else { | |
| query = client.query("SELECT * FROM nodes"); | |
| query.on('error', function(error){ console.log(error);}); | |
| query.on('row', function(row){ console.log(row);}); | |
| } |