Skip to content

Instantly share code, notes, and snippets.

View MarcoDuiker's full-sized avatar

Marco Duiker MarcoDuiker

View GitHub Profile
##clip_layer=optional vector
##filter_expression=optional string
##polygon=boolean True
##point=boolean True
##line=boolean True
##sum_expression=string
##selected_features_only=boolean True
##sum_total=output number
##sum_result_table=output table
@MarcoDuiker
MarcoDuiker / Handleiding PDOK BAG WFS in QGIS.txt
Last active June 26, 2017 08:51
Gebruik PDOK BAG WFS in QGIS
Via onderstaande werkwijze kun je de BAG WFS in QGIS gebruiken waarbij alle objecten binnen het opgegeven venster worden getoond, ook als het er meer dan 1000 zijn.
Opvragen attribuuttabel en 'Save as...' werken naar behoren. Bij elke zoom- of schuifactie op het kaartbeeld worden de gegevens opnieuw opgehaald. Een vorm van caching creëren zou dus niet gek zijn ...
Het werkt als volgt. Maak eerst een xml-bestand waarin de koppeling naar de BAG en de juiste kaartlaag wordt gedefinieerd. Bijvoorbeeld bag_pand.vrt.xml met de volgende inhoud:
<OGRWFSDataSource>
<URL>http://geodata.nationaalgeoregister.nl/bag/wfs?service=wfs&amp;typeName=bag:pand&amp;srsName=EPSG:28992</URL>
<PagingAllowed>ON</PagingAllowed>
</OGRWFSDataSource>
@MarcoDuiker
MarcoDuiker / gist_plugin.py
Created October 25, 2018 10:56
Accessing QGIS plugin from the QGIS python console
from qgis.utils import plugins
dir(plugins['plugin_name'])
@MarcoDuiker
MarcoDuiker / values_from_list.py
Created February 21, 2018 13:53
Qgis Function grabbing a value from a list
from qgis.core import *
from qgis.gui import *
@qgsfunction(args='auto', group='Custom')
def values_from_list(string, number, feature, parent):
"""
Takes the n-th value from a list in a field where the list is
written like: (3:value1, value2,value3). Such lists are often a
result of importing gml. <br />
@MarcoDuiker
MarcoDuiker / bitscope.py
Last active November 4, 2018 09:47
Getting Frequency and FFT plots with THD+N figure from Bitscope DDR file
#!/usr/bin/python3
#
# bitscope.py:
# (c) 2016 Derrik Walker v2.0
#
# Python Library for bitscope functions
#
# This is the Library goes with the blog post:
#
# http://www.doomd.net/2016/10/the-bitscope-linux-and-python.html
@MarcoDuiker
MarcoDuiker / wfs.py
Created March 18, 2019 10:34
Doing WFS post request from python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import requests
import argparse
def post(args):