This file contains 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
// Decode an encoded polyline into a list of lat/lng tuples. | |
function decodeLine (encoded) { | |
var len = encoded.length; | |
var index = 0; | |
var array = []; | |
var lat = 0; | |
var lng = 0; | |
while (index < len) { | |
var b; |
This file contains 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
javascript: (function () { | |
(function () { | |
var v = "1.3.2"; | |
if (window.jQuery === undefined || window.jQuery.fn.jquery < v) { | |
var done = false; | |
var script = document.createElement("script"); | |
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; | |
script.onload = script.onreadystatechange = function () { | |
if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { | |
done = true; |
This file contains 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/python | |
""" | |
This script is designed to act as assistance in converting shapefiles | |
to OpenStreetMap data. This file is optimized and tested with MassGIS | |
shapefiles, converted to EPSG:4326 before being passed to the script. | |
You can perform this conversion with | |
ogr2ogr -t_srs EPSG:4326 new_file.shp old_file.shp |
This file contains 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
ogr2ogr [output] [input] -skipfailures -t_srs EPSG:900913 -clipsrc -180 -85.0511 180 85.0511 |
This file contains 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 way, highway, railway, | |
(CASE WHEN highway IN ('motorway') THEN 'highway' | |
WHEN highway IN ('trunk', 'primary') THEN 'major_road' | |
ELSE 'minor_road' END) AS kind, | |
'no'::VARCHAR AS is_link, | |
(CASE WHEN tunnel IN ('yes', 'true') THEN 'yes' | |
ELSE 'no' END) AS is_tunnel, | |
(CASE WHEN bridge IN ('yes', 'true') THEN 'yes' | |
ELSE 'no' END) AS is_bridge, |
This file contains 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 way, highway, railway, tunnel, bridge, layer, | |
(CASE | |
WHEN highway IN ('motorway', 'motorway_link') THEN 'highway' | |
WHEN highway IN ('trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', 'tertiary_link') THEN 'major_road' | |
WHEN highway IN ('footpath', 'track', 'footway', 'steps', 'pedestrian', 'path', 'cycleway') THEN 'path' | |
WHEN railway IN ('rail', 'tram', 'light_rail', 'narrow_guage', 'monorail') THEN 'rail' | |
ELSE 'minor_road' END) AS kind, | |
(CASE WHEN highway LIKE '%_link' THEN 'yes' | |
ELSE 'no' END) AS is_link, |
This file contains 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
#!/bin/bash | |
for shp in $(find . -name \*.shp); | |
do | |
ogr2ogr "$(dirname $shp)/$(basename $shp .shp)-900913.shp" $shp -skipfailures -t_srs EPSG:900913 -clipsrc -180 -85.0511 180 85.0511 | |
shapeindex "$(dirname $shp)/$(basename $shp .shp)-900913.shp" | |
done |
This file contains 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
import sys | |
infile = sys.argv[1] | |
outfile = sys.argv[2] | |
## Prepare the input/output for read/write of files | |
fin = open(infile, 'r') | |
fout = open(outfile, 'w') |
This file contains 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
-124.75,24.53,-66.94,49.01 |
This file contains 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
mp3splt -t 30.00 file.mp3 |
OlderNewer