Skip to content

Instantly share code, notes, and snippets.

@pomadchin
pomadchin / Test.scala
Created November 19, 2015 10:41
DealyedInit bug example
import annotations.template
import reflect.runtime.universe.TypeTag
case class SW(s: String)
case class IW(c: Int)
case class BW(d: Double)
case class PD(sw: SW, iw: IW, bw: BW)
@template((i: Int, s: String, d: Double) => PD(SW(s), IW(i), BW(d)))
object Test2 extends App {
kill -9 $(jps | grep Spark | awk '{print $1}')
@pomadchin
pomadchin / fail.txt
Last active January 15, 2016 16:12 — forked from lossyrob/hilbert-error-test.scala
Hilbert key error
java.lang.IllegalArgumentException: bitSetRange=Pow2LengthBitSetRange[start=size: 4096 bitset: {},level=4096] exceeds 62 bits for a non-negative long.
[info] at com.google.common.base.Preconditions.checkArgument(Preconditions.java:119)
[info] at com.google.uzaygezen.core.ranges.LongRangeHome.toRange(LongRangeHome.java:40)
[info] at com.google.uzaygezen.core.ranges.LongRangeHome.toRange(LongRangeHome.java:27)
[info] at com.google.uzaygezen.core.ranges.RangeUtil.toOrthotope(RangeUtil.java:50)
[info] at com.google.uzaygezen.core.SimpleRegionInspector.assess(SimpleRegionInspector.java:127)
[info] at com.google.uzaygezen.core.BacktrackingQueryBuilder.visit(BacktrackingQueryBuilder.java:121)
[info] at com.google.uzaygezen.core.ZoomingSpaceVisitorAdapter.visit(ZoomingSpaceVisitorAdapter.java:66)
[info] at com.google.uzaygezen.core.CompactHilbertCurve.accept(CompactHilbertCurve.java:182)
[info] at geotrellis.spark.io.index.hilbert.HilbertSpaceTimeKeyIndex.indexRanges(HilbertSpaceTimeKeyIndex.scala:1
@pomadchin
pomadchin / result.log
Created January 15, 2016 16:30
result
~~~~~~~~~~~~~~~~~~~
SpaceTimeKey(1,1,2010-01-01T00:00:00.000Z): (1001,1001)
SpaceTimeKey(1,1,2011-01-01T00:00:00.000Z): (1001,1001)
SpaceTimeKey(1,1,2012-01-01T00:00:00.000Z): (1001,1001)
SpaceTimeKey(1,1,2013-01-01T00:00:00.000Z): (1001,1001)
SpaceTimeKey(1,1,2014-01-01T00:00:00.000Z): (1001,1001)
SpaceTimeKey(1,2,2010-01-01T00:00:00.000Z): (1002,1002)
SpaceTimeKey(1,2,2011-01-01T00:00:00.000Z): (1002,1002)
SpaceTimeKey(1,2,2012-01-01T00:00:00.000Z): (1002,1002)
SpaceTimeKey(1,2,2013-01-01T00:00:00.000Z): (1002,1002)
@pomadchin
pomadchin / build.sbt
Last active January 29, 2016 19:19
GeoTrellis Kryo workaroud
// have not check should we exclude it from spark-core (actually don't remember)
// actually we exclude kryo 2.24
val geotrellisSpark = "com.azavea.geotrellis" %% "geotrellis-spark" % Version.geotrellis exclude("com.esotericsoftware.kryo", "kryo")
val geotrellisRaster = "com.azavea.geotrellis" %% "geotrellis-raster" % Version.geotrellis exclude("com.esotericsoftware.kryo", "kryo")
val geotrellisVector = "com.azavea.geotrellis" %% "geotrellis-vector" % Version.geotrellis exclude("com.esotericsoftware.kryo", "kryo")
val geotrellisProj4 = "com.azavea.geotrellis" %% "geotrellis-proj4" % Version.geotrellis exclude("com.esotericsoftware.kryo", "kryo")
val sparkCore = "org.apache.spark" %% "spark-core" % Version.spark exclude("com.esotericsoftware.kryo", "kryo")
val kryo = "com.esotericsoftware.kryo" % "kryo" % "2.21"
@pomadchin
pomadchin / geowave.log
Created February 8, 2016 11:29
WARN Log
Feb 08, 2016 11:12:13 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'GeoServerResourceLoader', but ApplicationContext is unset.
Feb 08, 2016 11:12:13 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'GeoServerResourceLoader', but ApplicationContext is unset.
Feb 08, 2016 11:12:13 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
Feb 08, 2016 11:12:13 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'ExtensionProvider', but ApplicationContext is unset.
Feb 08, 2016 11:12:13 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNING: Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
@pomadchin
pomadchin / PlayMini.scala
Created February 20, 2016 13:14 — forked from xuwei-k/PlayMini.scala
came back play mini!
#!/usr/bin/env scalas
/***
scalaVersion := "2.11.7"
libraryDependencies += "com.typesafe.play" %% "play-netty-server" % "2.4.6"
*/
import play.core.server._
import play.api.routing.sird._
import play.api.mvc._
@pomadchin
pomadchin / TestEnvironment.scala
Last active April 1, 2016 15:49
Sample of validation function (not compiles but near to be compiled, just copy pasted Rob's version with some fixes and additional comments)
package geotrellis.test
import geotrellis.core.LayoutSchemeArg
import geotrellis.core.poly.{PolyCombine, PolyIngest, PolyValidate, PolyWrite}
import geotrellis.raster._
import geotrellis.spark.io._
import geotrellis.spark.io.avro.AvroRecordCodec
import geotrellis.spark.io.index.KeyIndexMethod
import geotrellis.spark.tiling.TilerKeyMethods
import geotrellis.spark._
@pomadchin
pomadchin / FailingGTBuild.text
Created April 8, 2016 12:40
TileRDDMaskMethodsSpec Filed; Scala 2.11.8; Oracle jdk 1.7
[info] TileRDDMaskMethodsSpec:
[info] TileLayerRDDMask
[info] - should properly mask a float32 user defined nodata layer
[info] - should properly mask a float32 user defined nodata layer, without filtering empty tiles
[info] - should properly mask a multiband float32 user defined nodata layer
[info] masking against more polygons
[info] - should be masked by random polygons
[info] - should be masked by complex polygons
[info] - should be masked by random multipolygons *** FAILED ***
[info]  Array(-2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -2147483648, -21474
@pomadchin
pomadchin / build.sbt
Created May 6, 2016 15:58
GeoTrellis with GeoMesa build sample
name := "nathan-test"
version := "0.1.0"
scalaVersion := "2.10.7"
crossScalaVersions := Seq("2.11.8", "2.10.7")
organization := "com.azavea"
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.html"))
scalacOptions ++= Seq(
"-deprecation",
"-unchecked",
"-Yinline-warnings",