Skip to content

Instantly share code, notes, and snippets.

View rsimon's full-sized avatar

Rainer Simon rsimon

View GitHub Profile
@rsimon
rsimon / test.html
Created March 8, 2018 12:21
'Remote control' OpenLayers through a DOM element that obstructs direct access
<html>
<head>
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.4/css/ol.css" type="text/css">
<style>
#above, #below {
position:absolute;
top:0;
left:0;
width:640px;
height:480px;
@rsimon
rsimon / example.scala
Last active January 30, 2018 08:13
Play JSON Serialization and Trait Methods
// Trait that adds the 'computeSum' method
trait HasSum {
val a: Int
val b: Int
def computeSum() = a + b
}
@rsimon
rsimon / pleiades-sample.json
Created September 30, 2016 12:08
Pleiades sample record
{
"features": [{
"geometry": {
"type": "Point",
"coordinates": [-3.606772,
39.460299
]
},
"type": "Feature",
"id": "darmc-location-20192",
@rsimon
rsimon / amber-annotations.ttl
Last active September 20, 2016 19:19
Amber Routes routes & annotations dummy
@prefix cnt: <http://www.w3.org/2011/content#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix oa: <http://www.w3.org/ns/oa#> .
@prefix pelagios: <http://pelagios.github.io/vocab/terms#> .
@prefix relations: <http://pelagios.github.io/vocab/relations#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema> .
# Any custom vocab terms that might be needed
@rsimon
rsimon / amber-void.ttl
Last active September 20, 2016 19:11
Amber Routes VoID dummy
@prefix : <http://my-domain.org/my-data/> .
@prefix void: <http://rdfs.org/ns/void#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<https://github.com/kgeographer/topotime/hroutes> a void:Dataset;
# MANDATORY
dcterms:title "Historical Routes from Topotime";
# OPTIONAL
{
"bbox": [
16.8224041,
42.7657037,
16.8224041,
42.7657037
],
"connectsWith": [
"1004"
],
<html>
<head>
<title>Annotorious OpenSeadragon Test Page</title>
<script src="openseadragon/openseadragon.min.js"></script>
<link rel="stylesheet" type="text/css" href="../../css/theme-dark/annotorious-dark.css" />
<script type="text/javascript" src="http://localhost:9810/compile?id=annotorious"></script>
<script type="text/javascript">
annotorious.plugin.HelloWorldPlugin = function(opt_config_options) { }
annotorious.plugin.HelloWorldPlugin.prototype.initPlugin = function(anno) {
{
"size" : 0,
"aggs" : {
"is_conflation_of" : {
"nested" : {
"path" : "is_conflation_of"
},
"aggs" : {
"source_gazetteer" : {
"terms" : { "field" : "is_conflation_of.source_gazetteer" }
{
"size" : 5,
"query" : {
"nested" : {
"path" : "is_conflation_of.names",
"query" : {
"match" : { "is_conflation_of.names.name": "athens" }
}
}
}
{
"size" : 5,
"query" : {
"nested" : {
"path" : "is_conflation_of",
"query" : {
"bool": {
"should": [
{ "match" : { "is_conflation_of.title": "athenae" } },
{