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 | |
# -*- coding: utf-8 -*- | |
############################################################################### | |
# $Id$ | |
# | |
# Project: OGR Python samples | |
# Purpose: Create OGR VRT from source datasource | |
# Author: Frank Warmerdam, [email protected] | |
# | |
############################################################################### |
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 'Select ''' || quote_ident(f_table_name) || ''' as name, Sum((ST_Area(' || quote_ident(f_geometry_column) || ')) from ' | |
|| quote_ident(f_table_schema) || '.' || quote_ident(f_table_name) || ' UNION' | |
FROM geometry_columns | |
order by f_table_name |
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
//Adpated by mtravis from https://github.com/ardhi/Leaflet.MousePosition/ for use with BNG co-ords. Inspired by http://ghost.mixedbredie.net/reprojecting-leaflet-coordinates/ | |
//You will still need Leaflet.MousePosition/src/L.Control.MousePosition.css from the original repo for this to work | |
//Also include a link to https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.10/proj4.js | |
//Finally add L.control.mousePosition().addTo(map); to the your script | |
L.Control.MousePosition = L.Control.extend({ | |
options: { | |
position: 'bottomleft', | |
separator: ' : ', | |
emptyString: 'Unavailable', |
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
from qgis.core import * | |
from qgis.utils import iface | |
from PyQt4.QtCore import * | |
from PyQt4.QtGui import * | |
def snapping_toggle(): | |
layer = QgsMapLayerRegistry.instance().mapLayersByName("topographicline")[0] | |
#layer = iface.activeLayer() | |
_, enabled, _, _, _, _ = QgsProject.instance().snapSettingsForLayer(layer.id()) | |
QgsProject.instance().setSnapSettingsForLayer(layer.id(), not enabled, 0, 1, 10, True) |
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
from qgis.core import * | |
from qgis.gui import * | |
from qgis.utils import iface | |
@qgsfunction(args=0, group='Custom') | |
def mapCenter(value1,feature, parent): | |
x = str(int(iface.mapCanvas().extent().center().x())) | |
y = str(int(iface.mapCanvas().extent().center().y())) | |
point = x + ',' + y | |
return point |
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
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
prefix owl: <http://www.w3.org/2002/07/owl#> | |
prefix xsd: <http://www.w3.org/2001/XMLSchema#> | |
prefix sr: <http://data.ordnancesurvey.co.uk/ontology/spatialrelations/> | |
prefix lrhpi: <http://landregistry.data.gov.uk/def/hpi/> | |
prefix lrppi: <http://landregistry.data.gov.uk/def/ppi/> | |
prefix skos: <http://www.w3.org/2004/02/skos/core#> | |
prefix lrcommon: <http://landregistry.data.gov.uk/def/common/> |
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
# Note: Environment variables can be used with any of | |
# the options by using a token of the form: | |
# $HOME, ${HOME} or %TEMP% (Windows only) | |
# The directory containing your source files. | |
# All supported files in the specified directory and | |
# it's descendants will be loaded. | |
src_dir=/home/matt/loader/data/import/ | |
# The directory used to store the translated data |
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
L.Draw.Circle = L.Draw.SimpleShape.extend({ | |
statics: { | |
TYPE: 'circle' | |
}, | |
options: { | |
shapeOptions: { | |
stroke: true, | |
color: '#f06eaa', | |
weight: 4, |
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
<OGRVRTDataSource> | |
<OGRVRTLayer name="50kgaz2012_new"> | |
<SrcDataSource>C:\OSOpenData\Data\Gazetteer\50kgaz2012_new.csv</SrcDataSource> | |
<GeometryType>wkbPoint</GeometryType> | |
<LayerSRS>EPSG:27700</LayerSRS> | |
<GeometryField encoding="PointFromColumns" x="EAST" y="NORTH"/> | |
</OGRVRTLayer> | |
</OGRVRTDataSource> |
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
# The directory containing your source OS Open Data | |
# files. All files in the specified directory and it's decendents will be loaded. | |
src_dir=C:\OSOpenWorkingArea\Data\ | |
# The .csv file containing parameters for each dataset | |
csv_table=C:\OSOpenWorkingArea\Table.csv | |
# Database the datasets will be loaded into | |
database=dbname='OSOpenData' user='postgres' host='localhost' password='postgres' |
NewerOlder