Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a SourceName field into RasterSources #224

Merged
merged 4 commits into from
Aug 12, 2019

Conversation

pomadchin
Copy link
Member

Overview

This PR allows RasterSources to have a name (or identifier) different from the path, for the in memory cases or for the MosaicRasterSource that can't have a path to the source.

Checklist

  • Add entry to CHANGELOG.md

Closes #197

@pomadchin pomadchin force-pushed the feature/named-raster-source branch 5 times, most recently from 734e967 to 4b1e71c Compare August 9, 2019 12:42
@@ -39,18 +39,18 @@ import java.net.MalformedURLException
*
* @example "zip+s3://bucket/prefix/zipped-data.zip!data.tif"
*/
case class GDALDataPath(path: String) extends DataPath
case class GDALPath(value: String) extends SourcePath
Copy link
Collaborator

Choose a reason for hiding this comment

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

💯

@pomadchin pomadchin changed the title Add Named RasterSources Add a SourceName field into RasterSources Aug 12, 2019
@@ -21,16 +21,17 @@ import java.net.URI
/**
* Represents the path to data that is to be read.
*/
trait DataPath {
trait SourcePath extends SourceName {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, this makes a lot of sense.

Copy link
Collaborator

@echeipesh echeipesh left a comment

Choose a reason for hiding this comment

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

My only comment is to get rid of Base classes and inline them to avoid cluttering up the namespace. Otherwise this is a great improvement. It gets rid of RasterSourceMetadata and solves the naming problem really efficiently. RasterSource extends RasterMetadata RasterMetadata has name: SourceName and SourcePath extends SourceName. So we can match on name and work only on RasterMetadata if required.

@pomadchin pomadchin force-pushed the feature/named-raster-source branch 4 times, most recently from fea1719 to 272f2ad Compare August 12, 2019 17:43
@pomadchin
Copy link
Member Author

Merging once CI is happy!

@pomadchin pomadchin merged commit 0772265 into geotrellis:master Aug 12, 2019
@pomadchin pomadchin self-assigned this Aug 20, 2019
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.

RasterSource Identification
2 participants