Skip to content

Instantly share code, notes, and snippets.

View rsimon's full-sized avatar

Rainer Simon rsimon

View GitHub Profile
<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" } },
{
@rsimon
rsimon / annotation.json
Last active November 27, 2015 08:32
ElasticSearch Mapping for Pelagios annotations
{
"object": {
"properties": {
"identifier": { "type": "string", "index": "not_analyzed" },
"homepage": { "type": "string", "index": "no" },
"is_in_dataset": {
"type": "nested",
"properties": {
"identifier": { "type": "string", "index": "not_analyzed" },
"title": { "type": "string", "index": "no" }
@rsimon
rsimon / common.json
Created November 27, 2015 07:51
ElasticSearch Mapping for Pelagios 'Common Object Properties'
{
"object": {
"properties": {
"identifier": { "type": "string", "index": "not_analyzed" },
"object_type": { "type": "string", "index": "not_analyzed" },
"title": { "type": "string" },
"description": { "type": "string" },
"homepage": { "type": "string", "index": "no" },
"is_in_dataset": {
"type": "nested",
  • Install the Tile Layer Plugin
  • The tile layer plugin needs to be configured with tile sources. Configuration works via tab-separated-value (.tsv) files. Locate the plugin's default .tsv directory. This depends on you platform, but will ususally be some place like:
.qgis2/python/plugins/TileLayerPlugin/layers/
C:\Users\rsimon\.qgis2/pyhton/plugins/TileLayerPlugin/layers
@rsimon
rsimon / gist:411cffc81edbd9a3604e
Last active August 29, 2015 14:02
Adding columns to a Postgres table
sudo -u postgres psql recogito
ALTER TABLE gdocuments ADD COLUMN geo_origin character varying(254);
ALTER TABLE gdocuments ADD COLUMN geo_findspot character varying(254);
ALTER TABLE gdocuments ADD COLUMN geo_author_location character varying(254);
@rsimon
rsimon / ptdoubles.csv
Created May 15, 2014 08:06
List of Peutinger Table data doubles
Segment 1 1C4 TPPlace98
Segment 10 10B4 TPPlace2650
Segment 4 4B2 TPPlace3550
Segment 3 3B4 TPPlace1122
Segment 3 3B5 TPPlace2953
Segment 4 4B1 TPPlace2958
Segment 5 5B2 TPPlace1293
Segment 10 10B3 TPPlace2616
Segment 8 8A1 TPPlace3121
Segment 4 4B2 TPPlace2966
@rsimon
rsimon / gist:2c050ba033e2f6881d91
Last active August 29, 2015 14:01
Getting top unidentified places from Recogito DB
SELECT
-- concat (toponym, toponym_corrected), count(*)
coalesce(toponym, toponym_corrected), count(*)
FROM annotations WHERE
(status = 'NOT_IDENTIFYABLE' OR status = 'NO_SUITABLE_MATCH' OR status = 'AMBIGUOUS' OR status = 'MULTIPLE')
-- GROUP BY concat(toponym, toponym_corrected)
GROUP BY coalesce(toponym, toponym_corrected)
ORDER BY count desc ;