Skip to content

Instantly share code, notes, and snippets.

View gannebamm's full-sized avatar

Florian Hoedt gannebamm

View GitHub Profile
@gannebamm
gannebamm / gist:1e1cd8442f90769d4c31
Last active October 30, 2015 15:55
Stacktrace geonode updatelayers
Traceback (most recent call last):
File "/usr/bin/django-admin", line 5, in <module>
management.execute_from_command_line()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.p y", line 399, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.p y", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 285, in execute
@gannebamm
gannebamm / alternativeBivariateLegend.R
Created September 15, 2016 12:37
alternative bivariate chloropleth map legend done in R with ggplot
# alternative bivariate chloropleth map legend
# by Florian Hoedt
# gis.hoedt@gmail.com
require(maptools)
require(ape) #needed?
# shp with data
dataPath <- "C:/temp/Modul_09_VisKarto/A/A_1/both.shp"
shpData <- readShapePoly(dataPath)
@gannebamm
gannebamm / snippet.py
Created April 21, 2017 10:57
ZonalMetrics Tools snippet
#[ pyt stuff ...]
class MetricsCalcTool(object):
def __init__(self):
self.category = "ZonalMetrics"
self.label = "FILL ME IN SUBCLASS"
self.description = "FILL ME IN SUBCLASS"
self.canRunInBackground = True
self._temp_layers = []
self._temp_layer_nb = 1
@gannebamm
gannebamm / config.py
Last active November 3, 2017 09:22
record audio samples via pyaudio for the ASSOS project - creates IO ERRORS
### configuration file for assos_listen
# upload
upload = False
# config for this sensor
sensorID = "al_03"
# sampling rate & chunk size
chunkSize = 1024
samplingRate = 44100 #44100 # 44100 needed for Aves sampling
@gannebamm
gannebamm / config.py
Created November 3, 2017 09:22
record audio samples via alsaaudio for the ASSOS project - creates bad chunks of data
### configuration file for assos_listen
# upload
upload = False
# config for this sensor
sensorID = "al_03"
# sampling rate & chunk size
chunkSize = 1024
samplingRate = 44100 #44100 # 44100 needed for Aves sampling
@gannebamm
gannebamm / PAMTrilateration.ipnb
Created December 14, 2017 22:21 — forked from anonymous/PAMTrilateration.ipnb
PAM Trilateration Example
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Passive Audio Monitoring Trilateration\n",
"\n",
"## The Issue\n",
"One example of a trilateration algorithm is the GPS based localization. The algorithm uses the runtimes of three or more signals to determine the position of the sensor on earth. In this algorithm the _absolute_ runtimes for each signal are known due to the GPS timestamps send by the satellites.\n",
@gannebamm
gannebamm / samplepoints.sql
Created January 3, 2018 17:52
sample points on campus
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.2
-- Dumped by pg_dump version 10.0
-- Started on 2018-01-03 18:49:42
SET statement_timeout = 0;
@gannebamm
gannebamm / st_makeline_3d.sql
Created January 3, 2018 17:53
ST_MakeLine for samplepoints - does not create 3d Lines
SELECT ST_MAKELINE(
(SELECT geom
FROM samplepoints_xyz
WHERE name = 'al_01'),
(SELECT geom
FROM samplepoints_xyz
WHERE name = 'sound_01')), 's1' AS sample
@gannebamm
gannebamm / st_makeline_3d_working.sql
Created January 5, 2018 13:25
ST_MakeLine with creating a 3DIM enabled table works for 3d features
CREATE TABLE samplelines
(
id serial,
name character varying(50) COLLATE pg_catalog."default",
CONSTRAINT samplelines_pkey PRIMARY KEY (id)
)
-- add 3dims enabled geometry column
SELECT AddGeometryColumn('public', 'samplelines', 'geom', 25832, 'LINESTRING', 3);
-- pick the samplepoints and create lines
@gannebamm
gannebamm / query.sql
Created January 28, 2018 17:50
Query for getting the number of red lines which are crossed by each black line
select SUM(red.n), black.*
from red, black
where st_crosses(red.geometry, black.geometry)
group by black.ID