Skip to content

Instantly share code, notes, and snippets.


Nick Doiron mapmeld

View GitHub Profile
mapmeld / scraper-1
Created Apr 10, 2012
Scraping County GIS
View scraper-1
get '/parcel' do
url = ''
url = URI.parse(url)
headers = {
"Accept" => "*/*",
"Accept-Charset" => "ISO-8859-1,utf-8;q=0.7,*;q=0.3",
"Accept-Encoding" => "gzip,deflate,sdch",
"Accept-Language" => "en-US,en;q=0.8",
"Connection" => "keep-alive",
"Content-Length" => "409",
mapmeld / fieldpapers-bookmarklet.js
Created Apr 19, 2012
Red Pen: experimental auto-marker for
View fieldpapers-bookmarklet.js
Red Pen turns red (and blue!) dots on Field Papers tiles into markers automatically
Tested with Sharpie and PaperMate ballpoint pens
Write a description to save the marker
I don't understand the server-side installation or the QR-scanning, so I'm using a bookmarklet
Client-side HTML5 Canvas for tile inspection
// collect the most zoomed-in tiles from the scan
var zoomimgs = document.getElementsByTagName("img");
mapmeld / CalGOLD-SC.rb
Created Apr 30, 2012
CalGOLD Search for Santa Cruz
View CalGOLD-SC.rb
get '/calgold' do
if params["kywd"] == "search"
return "<!DOCTYPE html>\n<html>\n<head>\n<link href='/bootstrap-mini.css' rel='stylesheet' type='text/css'/></head>\n<body>\n<div class='well'><h3>What is your business type?</h3>\n<form action='/calgold' method='get'><input name='kywd' value='' placeholder='Category'/><input type='submit' class='btn btn-info' value='Search' style='vertical-align:top;'/></form><br/><h4>Examples</h4><i>shoe store</i><br/><i>restaurant</i><br/><i>bowling alley</i><br/>or try <i>general business information</i><br/><a href='' target='_blank'>All Business Types</a></div>\n</body>\n</html>"
postparams = {"kywd" => params["kywd"], "VW" => "OUT"}
catquest = Net::HTTP.post_form(URI.parse(''), postparams)
categories = catquest.body.split("<input type='CHECKBOX'")
index = 0
linkout = ""
categories.each do |category|
mapmeld / OpenBlock_EsriMap.html
Created May 3, 2012
OpenBlock with Esri Map
View OpenBlock_EsriMap.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "">
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">@media print { .gmnoprint { display:none }}@media screen { .gmnoscreen { display:none }}</style>
<title>Bibb County | OpenBlock Test</title>
<meta name="robots" content="noarchive">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<link rel="home" title="Home" href="">
mapmeld / parking-app-hnl.html
Created May 17, 2012
Parking App using HNL data, Esri maps
View parking-app-hnl.html
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"
<title>Parcel Locator</title>
<link rel="stylesheet" type="text/css" href="">
<link rel="stylesheet" type="text/css" href="">
mapmeld / xyzwms.rb
Created Jun 10, 2012
XYZ tile to WMS
View xyzwms.rb
get '/countymap/:z/:x/:y' do
x = params[:x].to_i
y = params[:y].to_i
z = params[:z].to_i
maxExtent = {
"left" => -20037508.34,
"right" => 20037508.34,
"top" => 20037508.34,
"bottom" => -20037508.34
from datetime import datetime, timedelta
m31 = open('June 1.csv','r')
buses = { }
def zap(content):
return content.replace('\x00','').replace('\r\n','')
firstline = 1
minutebyminute = timedelta(minutes=1)
# Bus TimeTabler
# Imports CSV of Bus GPS points and KML of Bus Stops along a route.
# Helps create a complete timetable by recording when selected vehicles on this route approach the stop
import datetime
# import a day's worth of bus tracks
bustrackfile = open('May 30.csv', 'r')
bustrack = [ ]
for line in bustrackfile:
mapmeld / signage.js
Created Jun 23, 2012
Macon-Bibb Sign Regulations
View signage.js
zonePermissions = [
zoneNames: [ "RR", "R-1AAA", "R-1AAAA", "R-1AA", "R-1A", "R-1", "MHR" ],
categories: [
name: "Single-family residential",
locations: [ "Freestanding", "Wall" ],
maxsigns: 1,
maxfreestanding: 1,
maxsize: 2,
mapmeld /
Created Jun 24, 2012
# Bus TimeTabler with Saturday routes
import datetime
# import a day's worth of bus tracks
bustrackfile = open('Jun 2.csv', 'r')
bustrack = [ ]
for line in bustrackfile:
You can’t perform that action at this time.