Skip to content

Instantly share code, notes, and snippets.

View allixender's full-sized avatar

Alex Kmoch allixender

View GitHub Profile
gcloud compute --project "cloud-project1" ssh --zone "us-central1-f" "cloud-instance1"
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install openjdk-7-jdk git
sudo apt-get install libgdal-java libgdal-dev gdal-bin netcdf-bin libnetcdf-dev
library(gstat)
library(sos4R)
gwl.converters <- SosDataFieldConvertingFunctions(
"http://resources.smart-project.info/gemet/groundwaterlevel" = sosConvertDouble,
"http://www.opengis.net/def/property/OGC/0/SamplingTime" = sosConvertTime,
"http://www.opengis.net/def/property/OGC/0/FeatureOfInterest" = sosConvertString)
gwl <- SOS(url = "http://portal.smart-project.info/52nSOSv3.5.0/sos",
dataFieldConverters = gwl.converters)
# summary(gwl)
gwl_offerings <- sosOfferings(gwl)
# demo sos 400
library(sos4R)
g1.converters <- SosDataFieldConvertingFunctions(
"http://vocab.smart-project.info/sensorweb/phenomenon/Temperature" = sosConvertDouble,
"http://www.opengis.net/def/property/OGC/0/SamplingTime" = sosConvertTime,
"http://www.opengis.net/def/property/OGC/0/FeatureOfInterest" = sosConvertString)
myopts <- curlOptions(ssl.verifyhost=FALSE, ssl.verifypeer=FALSE, followlocation=TRUE)
handle <- getCurlHandle( .opts= myopts)
# wps.des: sos4R_wps_gwl_horo, title = interp mean gw levels per Foi per year via SOS,
# abstract = A Simple and useless demo WPS Process just summing the meaausrements for a given Foi;
# wps.in: year, string;
# calculate something... variable "input" don't has to be initialized
library(sos4R)
library(akima)
library(fields)
@allixender
allixender / parallel-transcode.sh
Created August 29, 2015 10:32
Parallel for Tesseract OCR and lulti-page pdfs
#!/bin/bash
#ocrpdftotext
# adjusted implementation of http://ubuntuforums.org/showthread.php?t=880471
DPI=300
TESS_LANG=eng
FILENAME=${@}
TMP_NAME=`basename "$FILENAME" .pdf`
OUTPUT_FILENAME=${TMP_NAME}-out-${DPI}.txt
@allixender
allixender / zoo-orfeo-buildscript.sh
Last active April 14, 2016 23:22
ZOO-Project WPS offers integration with the Orfeo Remote Sensing and Image Manipulation Toolbox. The build chain takes some time an has a few traps. This build has shown to work with the example request, however a few spurious errors still show up in operations.
#!/bin/bash
# ZOO-Project WPS offers integration with the Orfeo Remote Sensing and Image Manipulation Toolbox.
# The build chain takes some time an has a few traps. This build has shown to work with the example request,
# however a few spurious errors still show up in server operations. I have been able to work through
# http://zoo-project.org/docs/kernel/orfeotoolbox.html and execute the example request. A black result PNG
# is returned.
# tail -f /var/log/apache2/error.log
--
@allixender
allixender / zoo-sagagis-buildscript.sh
Created April 15, 2016 00:57
ZOO-Project WPS offers integration with the SAGA GIS. The build chain takes some time an has a few traps. This build completes and the example request Garden_Fractals works, but a GRID sum causes a few spurious errors.
# ZOO-Project WPS offers integration with the SAGA GIS.
# The build chain takes some time an has a few traps.
# My build completes and the example request Garden_Fractals works,
# but a GRID sum causes SIGSEV11 errors and complete successfully
# .. although somestuff is working along the operation..
# apache2 log
## snip
error: line 18: character not allowed ';'
error: line 18: character not allowed ';'
cluster_name: 'Test Cluster'
hinted_handoff_enabled: true
max_hint_window_in_ms: 10800000 # 3 hours
hinted_handoff_throttle_in_kb: 1024
max_hints_delivery_threads: 2
batchlog_replay_throttle_in_kb: 1024
authenticator: AllowAllAuthenticator
authorizer: AllowAllAuthorizer
permissions_validity_in_ms: 2000
partitioner: org.apache.cassandra.dht.Murmur3Partitioner
@allixender
allixender / geotools-jai-build.sbt
Last active July 19, 2019 09:50
To get GeoTools dependencies for Scala/SBT with JAI right on public build servers like Travis
// val geotoolsVersion = "8.7"
val geotoolsVersion = "9.5"
// val geotoolsVersion = "10.8"
// val geotoolsVersion = "11.3"
// val geotoolsVersion = "12.0"
// val geotoolsVersion = "13-SNAPSHOT"
libraryDependencies ++= Seq(
"org.geotools" % "gt-epsg-hsql" % geotoolsVersion,
"org.geotools" % "gt-referencing" % geotoolsVersion,
package controllers;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import play.Logger;
import play.mvc.Controller;