Skip to content

Instantly share code, notes, and snippets.

View timwaters's full-sized avatar
💭
Set your status

Tim Waters timwaters

💭
Set your status
View GitHub Profile
#tried this with ` Kernel.system IO.popen and open3:popen3
p "mkdir -p tmp/demo/{first/{app,views},second}" #works on command line tmp/demo/first/app /views tmp/demp/second
`mkdir -p tmp/demo/{first/{app,views},second}` #doesnt - literally creates tmp/demo/{first/{app,views},second}/
#sh -c "/bin/mkdir -p tmp/demo/{first/{app,views},second}" on command line also creates the same error, if that helps
`bash -c "mkdir -p tmp/demo/{first/{app,views},second}"` DOES WORK
<?xml version="1.0" ?><Map bgcolor="rgb(255,255,255)" srs="+init=epsg:4326">
<Style name="NYC_Structures4326_style">
<Rule>
<PolygonSymbolizer>
<CssParameter name="fill">rgb(78,110,187)</CssParameter>
<CssParameter name="gamma">0.7</CssParameter>
</PolygonSymbolizer>
<LineSymbolizer>
<CssParameter name="stroke-width">0.96</CssParameter>
</LineSymbolizer>
<WMT_MS_Capabilities version="1.1.1">
<Service>
<Name>OGC:WMS</Name>
<Title/>
<OnlineResource xlink:href="http://localhost/cgi-bin/tilecache/tilecache.cgi?"/>
</Service>
<Capability>
<wfs:FeatureCollection xmlns:wfs='http://www.opengis.net/wfs'><gml:featureMember xmlns:gml='http://www.opengis.net/gml'><feature:features xmlns:feature='http://mapserver.gis.umn.edu/map
server' fid='OpenLayers.Feature.Vector_376'><feature:geometry><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates cs=',' ts=' ' decimal='.'>386.1038331111523,430.56381244
0417 8662.60570320745,453.291312440417 8648.969203207427,6256.97686852735 347.9197403869348,6216.06736852735 386.1038331111523,430.563812440417</gml:coordinates></gml:LinearRing></gml:o
uterBoundaryIs></gml:Polygon></feature:geometry></feature:features></gml:featureMember></wfs:FeatureCollection>
<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs"><gml:featureMember xmlns:gml="http://www.opengis.net/gml"><feature:features xmlns:feature="http://mapserver.gis.umn.edu/map
server" fid="OpenLayers.Feature.Vector_376"><feature:geometry><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates decimal="." cs="," ts=" ">386.10383311
@timwaters
timwaters / gist:639346
Created October 21, 2010 20:59
batch import of control points into mapwarper
require 'fastercsv'
namespace :import do
desc "Imports GCP from a CSV file"
task :gcps_from_csv => :environment do
filename = "/path/to/lovely.csv"
puts "This imports a load of points from a csv file."
puts "WARNING: This may bugger up the system, especially if you have a lot of points!"
puts "Using File #{filename}"
require 'rubygems'
require 'qusion'
begin
Qusion.start(ENV)
rescue => e
raise "Failed to start Qusion: #{e}"
end
#start listening.
parti plats lat long
SDP A 60.2452640095735 24.906005859375
SDP B 60.3323860724971 25.400390625
Kok C 60.2234472043989 24.27978515625
Kok D 60.4084276004575 24.58740234375
@timwaters
timwaters / gist:1206922
Created September 9, 2011 18:12
live blog attempt openstreetmap sotm 2011
friday openstreetmap conference - state of the map 2011
panel discussion about getting osm with business
how to build software to get data into osm. needs millions of people. So need apps that are different thaneditor - gmaes, fun stuff, that happen inciodentally to add stuff to map.
philip - scobbler
good and painful experiences
germany - very good data
how can we close gap, spotting errors on map, and pro mappier fixing them
@timwaters
timwaters / gist:1248798
Created September 28, 2011 18:33
ruby mapnik displaying a raster?
CURRENT_PATH = File.expand_path(File.dirname(__FILE__))
require File.join(CURRENT_PATH, '..', 'lib', 'ruby_mapnik')
map = Mapnik::Map.new do |m|
m.width = 2024
m.height = 1768
m.background = Mapnik::Color.new("#fff")
m.srs = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"
@timwaters
timwaters / geocder.patch
Created October 11, 2011 19:58
patch for old dbs geocommons geocoder
# Unpack an array of little-endian 4-byte ints, and convert them into
# signed floats by dividing by 10^6, inverting the process used by the
# compress_wkb_line() function in the SQLite helper extension.
def unpack_geometry (geom)
points = []
if !geom.nil?
# Pete - The database format is completely different to the one
# expected by the code, so I've done some detective work to
# figure out what it should be. It looks like the format is
# | 1 byte Type | 4 byte SRID | 4 byte element count| 8 byte double coordinates *