Skip to content

Instantly share code, notes, and snippets.

OpenLayers.Util.QuickHull = (function() {
var buildConvexHull = function (baseLine, points, allBaseLines) {
var convexHullBaseLines = [],
maxDistance = 0,
maxPoint = [],
newPoints = [],
point, distance, i, vY, vX;
for (i = 0; i < points.length; i++) {
point = points[i];
vY = baseLine[1][0] - baseLine[0][0];
@neogis-de
neogis-de / sort_qgis_plugin_loading_times.py
Last active November 15, 2016 16:15
sort_qgis_plugin_loading_times
import pprint
import operator
plugin_load_times= qgis.utils.plugin_times
sorted_load_times = sorted(plugin_load_times.items(), key=operator.itemgetter(1))
pprint.pprint(sorted_load_times)
# in addition to: https://gis.stackexchange.com/questions/209129/how-to-tell-which-qgis-plugins-are-slow-to-load?stw=2
# helpt to sort dictionary from: https://stackoverflow.com/questions/613183/sort-a-python-dictionary-by-value
@neogis-de
neogis-de / postgis_trigger.sql
Last active June 30, 2018 05:02
postgis Trigger between polygon and point layer insert update delete ST_Intersection
CREATE TABLE label_point (
gid serial NOT NULL,
geom geometry(point, 3857),
label_sample varchar(255),
CONSTRAINT label_point_pkey PRIMARY KEY (gid)
);
CREATE TABLE soil (
gid serial NOT NULL,
geom geometry(polygon, 3857),
BEGIN;
-------------------------------------------------------
-- CREATE test tables
CREATE TABLE label_point (
gid serial NOT NULL,
geom geometry(point, 3857),
label_sample varchar(255),
@neogis-de
neogis-de / postgis_split_polygons.sql
Created November 12, 2015 09:09
postgis split polygons with polygons
CREATE TABLE public.testpolygons1
(
gid serial PRIMARY KEY,
geom geometry(Polygon,3857)
);
CREATE TABLE public.testpolygons2
(
gid serial PRIMARY KEY,
geom geometry(Polygon,3857)