This file contains hidden or 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
rem DOS batch file to run Loader on Windows using GDAL and python | |
rem provided by OSGeo4W. As this script requires the OSGeo4W environment | |
rem to run it must be passed as an argument to OSGeo4W.bat like so: | |
rem call C:\OSGeo4W\OSGeo4W.bat C:\Temp\Loader\run_loader.bat | |
rem Change to the folder that this script is in (assumes this script is | |
rem in the same folder as the Loader readme) | |
cd /D %~dp0 | |
rem change to the python directory |
This file contains hidden or 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
# Example of downloading all data from a GeoServer WFS server | |
# and loading it into a PostGIS database. Use with caution | |
# as you could put a lot of load on someone's server if they | |
# host a lot of data which might make them sad. | |
# In response to: http://underdark.wordpress.com/2012/09/26/wfs-to-postgis-in-3-steps/ | |
BASEURL="http://data.wien.gv.at/daten/geoserver/ows?service=WFS&version=1.1.0" | |
for LAYERNAME in `wget -qO- $BASEURL"&request=GetCapabilities" | xpath -q -e "//FeatureType/Name/text()"` ; do | |
PARTS=(${LAYERNAME//:/ }) |
This file contains hidden or 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
""" | |
A class used to manipulate Police KML data, used with prepgml4ogr.py. | |
""" | |
import os | |
from lxml import etree | |
class prep_kml(): | |
def __init__(self, inputfile): |
This file contains hidden or 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 res = [ | |
140000.0000000000, | |
70000.0000000000, | |
35000.0000000000, | |
17500.0000000000, | |
8750.0000000000, | |
4375.0000000000, | |
2187.5000000000, | |
1093.7500000000, | |
546.8750000000, |
This file contains hidden or 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
// Bounding box of our TMS that define our area of interest | |
var bbox = [-600000, -300000, 1300000, 1600000]; | |
// Resolutions of our TMS that the tiles will be displayed at calculated so | |
// that at resolution 0 the bounds fit one 256x256 tile: (maxx - minx)/256 | |
var res = [7421.875, 3710.9375, 1855.46875, 927.734375]; | |
// Define the Proj4Leaflet coordinate reference system base on British National Grid | |
var crs = L.CRS.proj4js( | |
'EPSG:27700', |
This file contains hidden or 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
from threading import Timer | |
def debounce(wait): | |
""" Decorator that will postpone a functions | |
execution until after wait seconds | |
have elapsed since the last time it was invoked. """ | |
def decorator(fn): | |
def debounced(*args, **kwargs): | |
def call_it(): |
This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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 = '[email protected]' |
NewerOlder