Skip to content

Instantly share code, notes, and snippets.

window.select = function(query) {
var d = document;
if (query.split(' ').length > 1 ||
query.split(',').length > 1 ||
query.split('[').length > 1 ||
query.split(':').lenght > 1) return d.querySelectorAll(query);
if (query.charAt(0) === '#') return d.getElementById(query.substring(1));
if (query.charAt(0) === '.') return d.getElementsByClassName(query.substring(1));
return d.getElementsByTagName(query);
};
@aaronlidman
aaronlidman / bing-places.js
Created September 3, 2013 20:12
I wanted to use these Bing locations as a backdrop for my project's index page but it doesn't really have anything to do with the project. I think it's a bit distracting. Maybe I can use it for another project or something.
var places = [
[-21.815289, 114.164930, 15],
[-22.7667, 113.680, 17],
[-26.6922, 113.6009, 17],
[-31.61751, 131.5492, 17],
[29.17023, -118.32509, 16],
[48.38595, -124.72506, 17],
[29.99712, 48.1951332, 14],
[5.283854, 100.310164, 17],
[37.27266, -112.945032, 16],
{
title: 'Outline the park',
instructions: '\
<ul>\
<li>Outline the nearby park.</li>\
<li>Pay blahblahblah to the tags, especially the \'name\' tag.</li>\
<li>It\'s possible the data is out of date or just wrong; report problems accordingly.</li>\
<li>Yellow features are other OSM features there to help you. You can\'t edit them here but clicking them provides more information. If you know they\'re wrong, go to osm.org and fix them.</li>\
</ul>',
db: 'http://127.0.0.1:5000/?db=dedupeLAparks',
@aaronlidman
aaronlidman / flow.md
Created September 12, 2013 22:30
I had this in the osmly readme, too detailed, will scare people away.

Current flow

  • WARNING: make sure everything is approved by the appropriate OSM authorities like the imports mailing list before importing to the main OSM API, if you aren't sure, ask somebody
  • prep the source
    • remove conflicting duplicates
    • reproject to EPSG:4326 (WGS 84)
    • remove useless attributes (like official internal ids)
      • OSMLY can do this for you, see usePropertyAsTag setting in settings_documentation.md it takes a whitelist of properties you want to use, everything else is ignored
    • rename attributes to their osm equivalents
  • OSMLY can do this for you, see renameProperty setting in settings_documentation.md
@aaronlidman
aaronlidman / sshport.txt
Created September 19, 2013 07:00
Fix ssh port for public wifi
vi /etc/ssh/sshd_config
Add: Port 443
/etc/init.d/ssh restart
@aaronlidman
aaronlidman / buildtest.geojson
Created September 19, 2013 08:01
la parks, deduped 8/31
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aaronlidman
aaronlidman / cemeteries.geojson
Created September 26, 2013 22:06
LA County Land Use Import. All files have been conflated and left with only name attributes. OSMLY will simplify the geometry and build a sqlite database for each file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aaronlidman
aaronlidman / alltheparks.geojson
Created September 26, 2013 23:37
LA County Parks Import. Data has conflated and left with only name attributes. OSMLY will simplify the geometry and build a sqlite database out of it. 810 parks.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<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),
<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(),