Skip to content

Commit 6f16ab4

Browse files
authored
Merge pull request #61 from moradology/feature/bump-gtc-0.5.0
Remove typeclass requirements and required typeclasses where possible
2 parents f7e3a96 + c064f66 commit 6f16ab4

File tree

8 files changed

+6
-26
lines changed

8 files changed

+6
-26
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ lazy val commonSettings = Seq(
1010
cancelable in Global := true,
1111
scalaVersion := scalaVer,
1212
crossScalaVersions := crossScalaVer,
13-
version := "0.0.11",
13+
version := "0.0.12",
1414
scalacOptions := Seq(
1515
"-deprecation",
1616
"-unchecked",

core/src/main/scala/geotrellis/server/HasRasterExtents.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ import simulacrum._
1010

1111
@typeclass trait HasRasterExtents[A] {
1212
@op("rasterExtents") def rasterExtents(self: A)(implicit contextShift: ContextShift[IO]): IO[NEL[RasterExtent]]
13-
@op("crs") def crs(self: A)(implicit contextShift: ContextShift[IO]): IO[CRS]
1413
}
1514

core/src/main/scala/geotrellis/server/LayerExtent.scala

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ object LayerExtent extends LazyLogging {
2727
interpreter: BufferingInterpreter
2828
)(
2929
implicit reify: ExtentReification[Param],
30-
enc: Encoder[Param],
3130
contextShift: ContextShift[IO]
3231
): (Extent, CellSize) => IO[Interpreted[MultibandTile]] = (extent: Extent, cs: CellSize) => {
3332
for {
3433
expr <- getExpression
35-
_ <- IO.pure(logger.info(s"Retrieved MAML AST for extent ($extent) and cellsize ($cs): ${expr.asJson.noSpaces}"))
34+
_ <- IO.pure(logger.info(s"Retrieved MAML AST for extent ($extent) and cellsize ($cs): ${expr.toString}"))
3635
paramMap <- getParams
37-
_ <- IO.pure(logger.info(s"Retrieved parameters for extent ($extent) and cellsize ($cs): ${paramMap.asJson.noSpaces}"))
36+
_ <- IO.pure(logger.info(s"Retrieved parameters for extent ($extent) and cellsize ($cs): ${paramMap.toString}"))
3837
vars <- IO.pure { Vars.varsWithBuffer(expr) }
3938
params <- vars.toList.parTraverse { case (varName, (_, buffer)) =>
4039
val thingify = paramMap(varName).extentReification
@@ -50,7 +49,6 @@ object LayerExtent extends LazyLogging {
5049
interpreter: BufferingInterpreter
5150
)(
5251
implicit reify: ExtentReification[Param],
53-
enc: Encoder[Param],
5452
contextShift: ContextShift[IO]
5553
) = apply[Param](getParams.map(mkExpr(_)), getParams, interpreter)
5654

@@ -61,7 +59,6 @@ object LayerExtent extends LazyLogging {
6159
interpreter: BufferingInterpreter
6260
)(
6361
implicit reify: ExtentReification[Param],
64-
enc: Encoder[Param],
6562
contextShift: ContextShift[IO]
6663
): (Map[String, Param], Extent, CellSize) => IO[Interpreted[MultibandTile]] =
6764
(paramMap: Map[String, Param], extent: Extent, cellsize: CellSize) => {
@@ -75,7 +72,6 @@ object LayerExtent extends LazyLogging {
7572
param: Param
7673
)(
7774
implicit reify: ExtentReification[Param],
78-
enc: Encoder[Param],
7975
contextShift: ContextShift[IO]
8076
): (Extent, CellSize) => IO[Interpreted[MultibandTile]] =
8177
(extent: Extent, cellsize: CellSize) => {

core/src/main/scala/geotrellis/server/LayerHistogram.scala

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import geotrellis.vector.Extent
99
import geotrellis.raster._
1010
import geotrellis.raster.histogram._
1111

12-
import _root_.io.circe._
1312
import cats.data.{NonEmptyList => NEL}
1413
import cats.effect._
1514
import cats.implicits._
@@ -72,7 +71,6 @@ object LayerHistogram extends LazyLogging {
7271
)(
7372
implicit reify: ExtentReification[Param],
7473
extended: HasRasterExtents[Param],
75-
enc: Encoder[Param],
7674
contextShift: ContextShift[IO]
7775
): IO[Interpreted[List[Histogram[Double]]]] =
7876
for {
@@ -105,7 +103,6 @@ object LayerHistogram extends LazyLogging {
105103
)(
106104
implicit reify: ExtentReification[Param],
107105
extended: HasRasterExtents[Param],
108-
enc: Encoder[Param],
109106
contextShift: ContextShift[IO]
110107
) = apply[Param](getParams.map(mkExpr(_)), getParams, interpreter, maxCells)
111108

@@ -118,7 +115,6 @@ object LayerHistogram extends LazyLogging {
118115
)(
119116
implicit reify: ExtentReification[Param],
120117
extended: HasRasterExtents[Param],
121-
enc: Encoder[Param],
122118
contextShift: ContextShift[IO]
123119
): (Map[String, Param]) => IO[Interpreted[List[Histogram[Double]]]] =
124120
(paramMap: Map[String, Param]) => {
@@ -133,7 +129,6 @@ object LayerHistogram extends LazyLogging {
133129
)(
134130
implicit reify: ExtentReification[Param],
135131
extended: HasRasterExtents[Param],
136-
enc: Encoder[Param],
137132
contextShift: ContextShift[IO]
138133
) = {
139134
val eval = curried(RasterVar("identity"), BufferingInterpreter.DEFAULT, maxCells)

core/src/main/scala/geotrellis/server/LayerTms.scala

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import com.azavea.maml.ast._
88
import com.azavea.maml.ast.codec.tree._
99
import com.azavea.maml.eval._
1010
import com.typesafe.scalalogging.LazyLogging
11-
import io.circe._
12-
import io.circe.syntax._
1311
import cats.effect._
1412
import cats.implicits._
1513
import geotrellis.raster._
@@ -35,14 +33,13 @@ object LayerTms extends LazyLogging {
3533
interpreter: BufferingInterpreter
3634
)(
3735
implicit reify: TmsReification[Param],
38-
enc: Encoder[Param],
3936
contextShift: ContextShift[IO]
4037
): (Int, Int, Int) => IO[Interpreted[MultibandTile]] = (z: Int, x: Int, y: Int) => {
4138
for {
4239
expr <- getExpression
43-
_ <- IO.pure(logger.info(s"Retrieved MAML AST at TMS ($z, $x, $y): ${expr.asJson.noSpaces}"))
40+
_ <- IO.pure(logger.info(s"Retrieved MAML AST at TMS ($z, $x, $y): ${expr.toString}"))
4441
paramMap <- getParams
45-
_ <- IO.pure(logger.info(s"Retrieved parameters for TMS ($z, $x, $y): ${paramMap.asJson.noSpaces}"))
42+
_ <- IO.pure(logger.info(s"Retrieved parameters for TMS ($z, $x, $y): ${paramMap.toString}"))
4643
vars <- IO.pure { Vars.varsWithBuffer(expr) }
4744
params <- vars.toList.parTraverse { case (varName, (_, buffer)) =>
4845
val eval = paramMap(varName).tmsReification(buffer)
@@ -62,7 +59,6 @@ object LayerTms extends LazyLogging {
6259
interpreter: BufferingInterpreter
6360
)(
6461
implicit reify: TmsReification[Param],
65-
enc: Encoder[Param],
6662
contextShift: ContextShift[IO]
6763
) = apply[Param](getParams.map(mkExpr(_)), getParams, interpreter)
6864

@@ -73,7 +69,6 @@ object LayerTms extends LazyLogging {
7369
interpreter: BufferingInterpreter
7470
)(
7571
implicit reify: TmsReification[Param],
76-
enc: Encoder[Param],
7772
contextShift: ContextShift[IO]
7873
): (Map[String, Param], Int, Int, Int) => IO[Interpreted[MultibandTile]] =
7974
(paramMap: Map[String, Param], z: Int, x: Int, y: Int) => {
@@ -87,7 +82,6 @@ object LayerTms extends LazyLogging {
8782
param: Param
8883
)(
8984
implicit reify: TmsReification[Param],
90-
enc: Encoder[Param],
9185
contextShift: ContextShift[IO]
9286
) = (z: Int, x: Int, y: Int) => {
9387
val eval = curried(RasterVar("identity"), BufferingInterpreter.DEFAULT)

core/src/main/scala/geotrellis/server/vlm/gdal/GDALNode.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ object GDALNode extends RasterSourceUtils {
4040
implicit val gdalNodeRasterExtents: HasRasterExtents[GDALNode] = new HasRasterExtents[GDALNode] {
4141
def rasterExtents(self: GDALNode)(implicit contextShift: ContextShift[IO]): IO[NEL[RasterExtent]] =
4242
getRasterExtents(self.uri.toString)
43-
def crs(self: GDALNode)(implicit contextShift: ContextShift[IO]): IO[CRS] =
44-
getCRS(self.uri.toString)
4543
}
4644

4745
implicit val gdalNodeTmsReification: TmsReification[GDALNode] = new TmsReification[GDALNode] {

core/src/main/scala/geotrellis/server/vlm/geotiff/GeoTiffNode.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ object GeoTiffNode extends RasterSourceUtils {
3333
implicit val cogNodeRasterExtents: HasRasterExtents[GeoTiffNode] = new HasRasterExtents[GeoTiffNode] {
3434
def rasterExtents(self: GeoTiffNode)(implicit contextShift: ContextShift[IO]): IO[NEL[RasterExtent]] =
3535
getRasterExtents(self.uri.toString)
36-
def crs(self: GeoTiffNode)(implicit contextShift: ContextShift[IO]): IO[CRS] =
37-
getCRS(self.uri.toString)
3836
}
3937

4038
implicit val cogNodeTmsReification: TmsReification[GeoTiffNode] = new TmsReification[GeoTiffNode] {

project/Dependencies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ object Dependencies {
44

55
val circeVer = "0.10.0"
66
val gtVer = "3.0.0-SNAPSHOT"
7-
val gtcVer = "0.4.0"
7+
val gtcVer = "0.5.0"
88
val http4sVer = "0.19.0"
99
val scalaVer = "2.11.12"
1010
val crossScalaVer = Seq(scalaVer, "2.12.7")

0 commit comments

Comments
 (0)