Skip to content

Instantly share code, notes, and snippets.

@stijnvanhoey
stijnvanhoey / cartopy_wms_dem_example.py
Last active October 5, 2020 14:16
Examples on how to add OGC WMS and WMTS services to cartopy
# I use Mercator here as I saw only mercator is supported by the webservice (see website Michel Stuyts or getcapabilities call)
plain_crs = ccrs.Mercator()
fig, ax = plt.subplots(subplot_kw={"projection": plain_crs}, figsize=(10, 10))
ax.set_extent([2.4, 8, 48., 52], crs=ccrs.PlateCarree())
# Add WMS imaging.
base_uri = 'https://image.discomap.eea.europa.eu/arcgis/services/Elevation/EUElev_DEM_V11/MapServer/WMSServer'
layer_name = 'DEM_v11_Masked2'
ax.add_wms(base_uri, layers=layer_name)
@stijnvanhoey
stijnvanhoey / std_output
Created August 11, 2020 19:10
Conda incompatible reporting
Collecting package metadata (repodata.json): done
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed |
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed /
@stijnvanhoey
stijnvanhoey / refactor_stratified.ipynb
Last active May 26, 2020 06:26
SIR model implementation tryout
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stijnvanhoey
stijnvanhoey / debug.md
Last active May 15, 2020 07:24
[Matlab tips and tricks] Small utilities and usefulsnippets for Matlab

In the console, do:

dbstop if error

to stop Matlab in debugging mode on an error.

#
# refactored of https://github.com/OlafenwaMoses/ImageAI/blob/master/imageai/Detection/__init__.py for yolov3 only
# credits to @OlafenwaMoses
#
# MIT License
#
# Van Hoey S.
import os
import cv2
@stijnvanhoey
stijnvanhoey / pandas_validation_errors.ipynb
Last active March 20, 2019 06:57
Pandas documentation errors
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stijnvanhoey
stijnvanhoey / planet_labs_api.R
Last active October 25, 2021 14:39
Activate and download assets from Planet Labs API
library(glue)
library(httr)
library(tidyverse)
library(jsonlite)
#' Search for planet labs images
#'
#' Credits to https://www.lentilcurtain.com/posts/accessing-planet-labs-data-api-from-r/
@stijnvanhoey
stijnvanhoey / distance_fun.R
Last active November 29, 2018 13:44
Calculate the internal receiver and measurement stations distances along a river network
##
## Derive distance matrix for a given set of receivers within the boundaries
## af the provided water bodies - support functions
##
## Van Hoey S.
## Lifewatch INBO
##
library("sp")
library("rgdal")
@stijnvanhoey
stijnvanhoey / seq_string.R
Last active May 16, 2018 14:45
Sequence in string to sequence string + separate rows
library(tidyr)
library(dplyr)
library(purrr)
#' Create sequence from colon sepearted sequence in string format
#'
#' @param input character character vector with : based sequences
#' in between comma separated numbers
#'
@stijnvanhoey
stijnvanhoey / userflora_export_plot.R
Created March 7, 2018 12:24
Loop plot for multiple species from userflora
library(RODBC)
library(ggplot2)
library(nlme)
library(mgcv)
library(lme4)
library(MASS)
library(splines)
# additional library to install for parameterized queries
library(RODBCext)