Skip to content

Commit

Permalink
Add Rasterio Affine Transform support (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
pomadchin authored Dec 21, 2021
1 parent bb91c11 commit 2a1fab9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Added
- Add Azure RangeReaders [#386](https://github.com/geotrellis/geotrellis-server/pull/386)
- Add GetFeatureInfoExtended support [#388](https://github.com/geotrellis/geotrellis-server/pull/388)
- Add Rasterio Affine Transform support [#390](https://github.com/geotrellis/geotrellis-server/pull/390)

## Changed
- STAC Assets regex selectors support [#388](https://github.com/geotrellis/geotrellis-server/pull/388)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ object ProjTransform {

def apply(transform: List[Double]): Either[String, ProjTransform] = apply(transform.toArray)

implicit val enProjGDALTransform: Encoder[ProjTransform] = Encoder.encodeList[Double].contramap(_.toList)
implicit val decProjGDALTransform: Decoder[ProjTransform] = Decoder.decodeList[Double].emap(ProjTransform.apply)
implicit val enProjGDALTransform: Encoder[ProjTransform] = Encoder.encodeList[Double].contramap(_.toList)
implicit val decProjGDALTransform: Decoder[ProjTransform] = Decoder.decodeList[Double].emap { list =>
val transform = if (list.length > 6) {
// handle rasterio affine transform
val List(a, b, c, d, e, f) = list.take(6)
List(c, a, b, f, d, e)
} else list
apply(transform)
}
}
2 changes: 1 addition & 1 deletion stac/src/main/scala/geotrellis/stac/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import io.circe.syntax._
import io.circe.generic.extras.Configuration

package object stac {
implicit lazy val configuration: Configuration = Configuration.default.withSnakeCaseMemberNames
implicit lazy val configuration: Configuration = Configuration.default.withSnakeCaseMemberNames.withDefaults

implicit class ExtentOps(val self: Extent) extends AnyVal {
def toTwoDimBbox: TwoDimBbox = {
Expand Down

0 comments on commit 2a1fab9

Please sign in to comment.