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
// Define reduce, fn and list are required, init is an optional initial value | |
// which will be passed to fn with the first item in list | |
function reduce(fn, list, init) { | |
var val = init, | |
start = 0; | |
if (val === undefined) { | |
if (list.length > 1) { | |
val = list[0]; | |
start = 1; | |
} else { |
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
find /var/data/osmm/ -type f -print0 | \ | |
parallel -0 python loader.py loader.config "src_dir={}" |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
setxkbmap gb && sudo apt-get install git-core gedit && cd && git clone https://github.com/AstunTechnology/osgis-ol3-leaflet.git ; cd osgis-ol3-leaflet ; gedit ol3/ol3.js & firefox http://astuntechnology.github.io/osgis-ol3-leaflet/ & |
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
// Extent of the map in units of the projection (these match our base map) | |
var extent = [-3276800, -3276800, 3276800, 3276800]; | |
// Fixed resolutions to display the map at (pixels per ground unit (meters when | |
// the projection is British National Grid)) | |
var resolutions = [1600,800,400,200,100,50,25,10,5,2.5,1,0.5,0.25,0.125,0.0625]; | |
// Define WGS84 projection (copied from http://epsg.io/3857.js) | |
proj4.defs("EPSG:3857","+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 +wktext +no_defs"); |
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 'CREATE INDEX ' || quote_ident(f_table_name || '_geom_idx') || ' ON ' || quote_ident(f_table_schema) || '.' || quote_ident(f_table_name) || ' USING GIST (' || quote_ident(f_geometry_column) || ');' AS SQL | |
FROM geometry_columns | |
WHERE f_table_name IN ('topographicarea', | |
'topographicline'); |
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
function hexToRgb(hex) { | |
return 'rgb(' + hex.slice(1).match(/../g).map(c => parseInt(c, 16)) +')' | |
} |
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/env python | |
# sample usage: checksites.py eriwen.com nixtutor.com yoursite.org | |
import pickle, os, sys, logging | |
from httplib import HTTPConnection, socket | |
from smtplib import SMTP | |
def email_alert(message, status): | |
fromaddr = 'you@gmail.com' |
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 *, ST_GeometryType(geom) as geom_type, ST_AsEWKT(geom) as geom_wkt from complex; |
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
src_dir=C:\GML_Loader\data\import | |
out_dir=C:\loader_data\export | |
tmp_dir=C:\loader_data\temp | |
ogr_cmd=ogr2ogr -append -skipfailures -f PostgreSQL PG:'dbname=test active_schema=public host=localhost port=5432 user=postgres password=******' $file_path | |
prep_cmd=python prepgml4ogr.py $file_path prep_osgml.prep_addressbase |
OlderNewer