Skip to content

Add RasterSources API - #3053

Merged
pomadchin merged 21 commits into
locationtech:masterfrom
pomadchin:feature/rastersources
Sep 4, 2019
Merged

pomadchin merged 21 commits into
locationtech:masterfrom
pomadchin:feature/rastersources

Conversation

@pomadchin

@pomadchin pomadchin commented Aug 14, 2019 •

Copy link
Copy Markdown
Member

Overview

This PR moves the code from the https://github.com/geotrellis/geotrellis-contrib repository.
Adds:

  • GeoTrellisRasterSources (think of a better naming (?))
  • GeoTiffRasterSources
  • GDALRasterSources

All the effects functionality still remains in the contrib repo.

Checklist

  • docs/CHANGELOG.rst updated, if necessary
  • Make GDAL Tests work (travis should launch tests in a docker container)

CQs

Closes #2941
Closes #3051
Closes #3054
Closes geotrellis/geotrellis-contrib#233
Closes https://github.com/azavea/geotrellis/issues/160

@pomadchin
pomadchin requested a review from echeipesh August 14, 2019 22:10
@pomadchin
pomadchin force-pushed the feature/rastersources branch from 695a824 to 777c869 Compare August 14, 2019 22:15
@pomadchin pomadchin changed the title Add RasterSources functionality Add RasterSources API Aug 14, 2019
@pomadchin
pomadchin force-pushed the feature/rastersources branch 2 times, most recently from 91c9556 to 296ac03 Compare August 14, 2019 23:28
Comment thread build.sbt
.settings(commonSettings)
.settings(Settings.gdal)

lazy val `gdal-spark` = project

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the better name / project structure for tests that include tiling, spark and GDAL?


import java.io.File

object GDALTestUtils {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mb the better place for it in a raster-testkit?

Comment thread gdal-spark/src/test/scala/geotrellis/GDALTestUtils.scala

expected.dimensions shouldBe actual.dimensions

assertEqual(expected.crop(gridBounds), actual.tile.crop(gridBounds))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full rasters comparison is too slow, since it is ~1500x1500 n bands comparison, so I decided to generate a tiny (~250x250) random grid bounds to test it; it added an x10 boost to theese tests (less than 10 seconds instead of more than a minute)

Comment thread gdal/src/main/resources/reference.conf Outdated
Comment thread vector/src/main/scala/geotrellis/vector/Extent.scala Outdated
Comment thread gdal/src/main/scala/geotrellis/raster/gdal/GDALDataType.scala
@pomadchin
pomadchin force-pushed the feature/rastersources branch 9 times, most recently from 6b627fc to bfb71ad Compare August 16, 2019 17:14
@pomadchin
pomadchin force-pushed the feature/rastersources branch 2 times, most recently from 405a58f to 8e2a0df Compare August 26, 2019 18:50
@pomadchin
pomadchin force-pushed the feature/rastersources branch 3 times, most recently from 6471123 to a6dda44 Compare August 26, 2019 21:19
Its used exclusivly there and avoids introducing another top level class.
Potentially it could even be flatterend if not for somewhat confusing prefexing.
The list of Some/None from the case class is otherwise unreadable
We want to allow extending this method for some ill begotten reason, its too restrictive not to do that.
Warning on CellSize downsing are not good enough reason to have a logger in Tile class. This is just too low level and being away of this case is basically expected as baseline knowladge from the users of the library
case class GDALRasterSource(
dataPath: GDALPath,
options: GDALWarpOptions = GDALWarpOptions.EMPTY,
class GDALRasterSource(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was using GDALRasterSources without a new keyword. I find it very convinient, mb istead of adding new keyword in tests you can add an overload for convenience? So from the one hand users would be allowed to extend classes, from the other - they will have a handy overload.

def convert(targetCellType: CellType): ArrayTile = {
val tile = ArrayTile.alloc(targetCellType, cols, rows)

if(targetCellType.isFloatingPoint != cellType.isFloatingPoint)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have you removed it? I thought that sometimes it is a useful warn O:

@pomadchin
pomadchin force-pushed the feature/rastersources branch from 9b30f69 to 17ab6f3 Compare September 2, 2019 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants