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 | |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
import re | |
import sqlite3 as sqlite | |
# Hacky serving of MBtile data | |
# Put filename to the MBTiles file below: this could be done with cmd line options | |
# but this is a hack so there .... |
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
var autoElm = document.getElementById('elm-name'); | |
autocomplete = new google.maps.places.Autocomplete(autoElm); | |
google.maps.event.addListener(autocomplete, 'place_changed', function () { | |
var place = autocomplete.getPlace(); | |
if (!place.geometry) { | |
return; | |
} | |
instance.setCenter(place.geometry.location); | |
instance.setZoom(19); |
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 org.jooq.util.jaxb.* | |
import org.jooq.util.* | |
ext.db = [ | |
url: 'jdbc:postgresql://host/db', | |
user: 'user', | |
password: 'user', | |
schema: 'schema' | |
] |
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
package main | |
/* | |
#cgo LDFLAGS: -lproj | |
#include <string.h> | |
#include <proj_api.h> | |
*/ | |
import "C" | |
import ( | |
"fmt" |
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
package main | |
import ( | |
"bufio" | |
"encoding/binary" | |
"flag" | |
"fmt" | |
"image" | |
"image/color" | |
"image/png" |
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 | |
import sqlite3 as sqlite | |
import os | |
import sys | |
import time | |
# Extracts an mbtiles database into a pyramid structure | |
if len(sys.argv) != 2: |
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
POLYGON\s*\(\s*(\(\s*(?<X>\-?\d+(:?\.\d+)?)\s+(?<Y>\-?\d+(:?\.\d+)?)(?:\s*,\s*\-?\d+(:?\.\d+)?\s+\-?\d+(:?\.\d+)?)*\s*,\s*\k<X>\s+\k<Y>\s*\))(\s*,\s*\(\s*(?<XH>\-?\d+(:?\.\d+)?)\s+(?<YH>\-?\d+(:?\.\d+)?)(?:\s*,\s*\-?\d+(:?\.\d+)?\s+\-?\d+(:?\.\d+)?)*\s*,\s*\k<XH>\s+\k<YH>\s*\))*\s*\) |
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
package main | |
/* | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "gdal_version.h" | |
#include "ogr_api.h" | |
#cgo darwin pkg-config: gdal | |
#cgo linux pkg-config: gdal |
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
INSERT into | |
spatial_ref_sys (srid, auth_name, auth_srid, proj4text, srtext) | |
values ( | |
27701, 'custom', 27701, | |
'+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs +nadgrids=/usr/local/share/osgb/OSTN02_NTv2.gsb', | |
'PROJCS["OSGB 1936 / British National Grid NAD Grid Extension",GEOGCS["OSGB 1936",DATUM["OSGB_1936",SPHEROID["Airy 1830",6377563.396,299.3249646,AUTHORITY["EPSG","7001"]],TOWGS84[446.448,-125.157,542.06,0.15,0.247,0.842,-20.489],EXTENSION["PROJ4_GRIDS","/usr/local/share/osgb/OSTN02_NTv2.gsb"],AUTHORITY["EPSG","6277"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4277"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",49],PARAMETER["central_meridian",-2],PARAMETER["scale_factor",0.9996012717],PARAMETER["false_easting",400000],PARAMETER["false_northing",-100000],UNIT["Meter",1]]' | |
); |
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 uk.gov.nationalarchives.droid.core.BinarySignatureIdentifier; | |
import uk.gov.nationalarchives.droid.core.SignatureParseException; | |
import uk.gov.nationalarchives.droid.core.interfaces.IdentificationRequest; | |
import uk.gov.nationalarchives.droid.core.interfaces.IdentificationResult; | |
import uk.gov.nationalarchives.droid.core.interfaces.IdentificationResultCollection; | |
import uk.gov.nationalarchives.droid.core.interfaces.RequestIdentifier; | |
import uk.gov.nationalarchives.droid.core.interfaces.resource.FileSystemIdentificationRequest; | |
import uk.gov.nationalarchives.droid.core.interfaces.resource.RequestMetaData; | |
import java.io.File; |
NewerOlder