Skip to content

Instantly share code, notes, and snippets.

@nomoregrapes
nomoregrapes / handy-regex.txt
Created January 13, 2016 14:44
Handy regex queries
#super-simple bounding box match
bbox\=([\+\-]?[0-9]+\.[0-9]+),([\+\-]?[0-9]+\.[0-9]+),([\+\-]?[0-9]+\.[0-9]+),([\+\-]?[0-9]+\.[0-9]+)
#bounding box, strictly matches long,lat,long,lat by limiting to +/-90 and +/-180
bbox\=([\+\-]?([0-9]|[0-8][0-9]|90)\.[0-9]+),([\+\-]?([0-9]|[0-9][0-9]|1[0-7][0-9]|180)\.[0-9]+),([\+\-]?([0-9]|[0-8][0-9]|90)\.[0-9]+),([\+\-]?([0-9]|[0-9][0-9]|1[0-7][0-9]|180)\.[0-9]+)
@nomoregrapes
nomoregrapes / OSM-searches.txt
Last active October 26, 2015 10:39
Handy search queries for OpenStreetMap, use for filters in JOSM or Overpass queries.
# Landuse and major roads
# Useful filter when mapping landuse=residential areas, only want to attach them to major features.
# The first bit is for ways you're creating, so you can add landuse tags
(type:way AND -tags:0) AND (type:way AND (-waterway=riverbank AND -landuse=* AND -leisure=* AND -natural=* AND -amenity=* -highway=trunk AND -highway=primary AND -highway=secondary))
# Other useful filters?...
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nomoregrapes
nomoregrapes / data-fixes.sql
Created October 7, 2015 10:39
Handy mySQL queries for fixing data
# When lat/lon are the wrong way round in a table called "location". Where clause works for UK, adjust for elsewhere.
# UPDATE location SET lat=(@temp:=lat), lat = lon, lon = @temp WHERE lat < 45;
@nomoregrapes
nomoregrapes / maptime-durham.geojson
Created August 26, 2015 11:48
Geojson section for Maptime chapters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.