Skip to content

Add Circe codecs for GeoTiffInfo and related classes - #3128

Merged
pomadchin merged 5 commits into
locationtech:masterfrom
echeipesh:feature/geotiffinfo-codecs
Oct 17, 2019
Merged

pomadchin merged 5 commits into
locationtech:masterfrom
echeipesh:feature/geotiffinfo-codecs

Conversation

@echeipesh

@echeipesh echeipesh commented Oct 16, 2019 •

Copy link
Copy Markdown
Contributor

Overview

Encoding GeoTiffInfo can be useful for caching purposes. To minimize the implicit resolution time we're tucking away codecs into companion objects and making heavy use of macro encoder/decoder derivation where we can. This is likely going to be needed again in client code and we can save people some pain by just doing it here.

Related: raster-foundry/raster-foundry@0fe73d7

This PR also:

  • breaks out GeoTiffInfo out of GeoTiffReader to minimize weirdness in the codebase
  • Merges TiffTagsReader class into TiffTags.read method

Checklist

  • docs/CHANGELOG.rst updated, if necessary

Moving out of GeoTiffReader class. This is a often used class in client code and it makes little sense to tuck it away in a reader.
@echeipesh
echeipesh requested a review from pomadchin October 16, 2019 19:01
@pomadchin pomadchin changed the title Add Cerci codecs for GeoTiffInfo and related classes Add Circe codecs for GeoTiffInfo and related classes Oct 16, 2019
Encoding GeoTiffInfo can be useful for caching purposes. To minimize the implicit resolution time we're tucking away codecs into companion objects and making heavy use of macro encoder/decoder derivation where we can.
@echeipesh
echeipesh force-pushed the feature/geotiffinfo-codecs branch from 5218e78 to 52b683e Compare October 16, 2019 22:13
Move to minimze weirdness in code base.
- we don't need another class to hold a function
- make private methods private to minmize public API surface
- unroll the super weird method extension for tag reading
- apply methods should not do reading
@echeipesh
echeipesh force-pushed the feature/geotiffinfo-codecs branch from 52b683e to a059d11 Compare October 17, 2019 01:28

@pomadchin pomadchin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM in general, clean and sweet, though requires a couple of fixes.
Also, mb it makes sense to import codes from the extras packages to make them user configurable?

Comment thread raster/src/main/scala/geotrellis/raster/io/geotiff/StorageMethod.scala Outdated
Comment thread raster/src/main/scala/geotrellis/raster/io/geotiff/StorageMethod.scala Outdated
Comment thread raster/src/main/scala/geotrellis/raster/io/geotiff/tags/BasicTags.scala Outdated
Comment thread raster/src/main/scala/geotrellis/raster/io/geotiff/tags/CmykTags.scala Outdated
Comment thread raster/src/main/scala/geotrellis/raster/io/geotiff/package.scala
@pomadchin
pomadchin force-pushed the feature/geotiffinfo-codecs branch 2 times, most recently from eea171b to 2fa0407 Compare October 17, 2019 20:27

@pomadchin pomadchin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Done, the reason why codecs are not Configured is because they all need even a default configuration passed everywhere ref. For now, to keep raster package simple, we can go with default codecs and they probably fit 90% of all cases and an implicit configuration will only introduce complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants