Skip to content

Instantly share code, notes, and snippets.

View aaronlidman's full-sized avatar

Aaron Lidman aaronlidman

View GitHub Profile
@aaronlidman
aaronlidman / errors.sh
Created July 13, 2014 22:30
Keepright error counts
keepright=# select count(object_id) as count, error_name from errors group by error_name order by count DESC;
count | error_name
---------+------------------------------------
7919526 | multiple nodes on the same spot
4687834 | missing tracktype
2538111 | missing maxspeed
2044474 | missing tags
2042926 | highway-waterway
1785604 | fixme-tagged items
keepright=# select count(object_id) as count, error_name from errors group by error_name order by count DESC;
256280 | point of interest without name
227587 | missing turn restriction
215243 | highway-riverbank
133183 | railway crossings without tag
79830 | dead-ended one-ways
72253 | waterway-waterway
53722 | places of worship without religion
48564 | motorways without ref
@aaronlidman
aaronlidman / grid-me-up.js
Created June 8, 2014 18:55
Generate some points from tile centroids
var sm = new (require('sphericalmercator'));
var bbox = [
-74.11847034659208,
40.65030727676827,
-73.88125841625703,
40.82946563333333
];
var zoom = 16;
This file has been truncated, but you can view the full file.
<?xml version='1.0' encoding='UTF-8'?>
<osm generator="alex@mapbox.com" version="0.6">
<node id="-2" visible="true" lon="-76.96661849418113" lat="38.93326073528159"/>
<node id="-3" visible="true" lon="-76.96680002581607" lat="38.93327529035660"/>
<node id="-4" visible="true" lon="-76.96678821982192" lat="38.93336491962504"/>
<node id="-5" visible="true" lon="-76.96660680329693" lat="38.93335036456490"/>
<node id="-6" visible="true" lon="-76.96661745965940" lat="38.93326865666332"/>
<way id="-2" visible="true">
<nd ref="-2"/>
<nd ref="-3"/>
- http://osmly.s3.amazonaws.com/los-angeles-parks/la-parks.html#!
@aaronlidman
aaronlidman / geojson.js
Last active August 29, 2015 13:56
IRC problem
<script>
var map = L.mapbox.map('map', 'examples.map-9ijuk24y')
.setView([38.9880463, -76.9442844], 15),
markers;
$.getJSON("jsonRetrieval.php", function (data) {
markers = L.geoJson(data, {
onEachFeature: onEachFeature
}).addTo(map);
@aaronlidman
aaronlidman / featureCollection.geojson
Created December 10, 2013 17:06
GeoJSON test data. Mostly from the spec: http://geojson.org/geojson-spec.html.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
amenity=fast_food
amenity=fuel
amenity=restaurant
amenity=bank
amenity=cafe
amenity=pharmacy
amenity=car_rental
shop=supermarket
shop=convenience
<html>
<head>
<title>OSM & GeoJSON by Aaron Lidman</title>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.1.0/lodash.js"></script>
<script type="text/javascript" src="http://rawgithub.com/aaronlidman/osm-and-geojson/gh-pages/osm_geojson.js"></script>
<script type="text/javascript" src="http://rawgithub.com/tyrasd/osmtogeojson/master/osmtogeojson.js"></script>
<script type="text/javascript">
function toGeo() {
var xml = document.getElementById('osmxml').value;
var start = new Date().getTime(),
<html>
<head>
<title>OSM & GeoJSON by Aaron Lidman</title>
<script type="text/javascript" src="http://rawgithub.com/aaronlidman/osm-and-geojson/gh-pages/osm_geojson.js"></script>
<script type="text/javascript" src="http://rawgithub.com/tyrasd/osmtogeojson/master/osmtogeojson.js"></script>
<script type="text/javascript">
function toGeo() {
var xml = document.getElementById('osmxml').value;
var start = new Date().getTime(),
geojson = osm_geojson.osm2geojson(xml),