Skip to content

GeoTrellisRasterSource should return None on empty reads - #3240

Merged
pomadchin merged 2 commits into
locationtech:masterfrom
pomadchin:fix/sparsed-stich
May 14, 2020
Merged

pomadchin merged 2 commits into
locationtech:masterfrom
pomadchin:fix/sparsed-stich

Conversation

@pomadchin

@pomadchin pomadchin commented May 13, 2020 •

Copy link
Copy Markdown
Member

Overview

This PR removes a duplicate GeoTrellisRasterSource.sparseStitch function that also was not safe enough and could work (incorrectly) with empty inputs.

Checklist

Notes

This bug was revelaed during this issue investigation.

@pomadchin
pomadchin force-pushed the fix/sparsed-stich branch from 9e78875 to 3e791a9 Compare May 13, 2020 22:46
tiles: Seq[(SpatialKey, MultibandTile)] with Metadata[TileLayerMetadata[SpatialKey]],
extent: Extent
): Option[Raster[MultibandTile]] = {
val md = tiles.metadata

@pomadchin pomadchin May 13, 2020 •

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.

There was no tiles.isEmpty check, and anyway we don't need this function anymore, see #2903

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you comment a bit further on why we don't need this anymore? That linked issue + its links don't show where the original problem handling missing spatialkeys is addressed in the original sparsestitch function.

@pomadchin pomadchin May 14, 2020 •

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.

@CloudNiner if you will look a bit above (at the place where it was used):

sparseStitch(tiles, extent) we can use the inbuilt function now tiles.sparseStitch(extent)

The issue #2903 was addressed in your PR here #3017 which is called "Add sparse stitch method to StitchCollectionMethods".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lol embarrassing -- I do in fact remember this now. 👍

Comment thread CHANGELOG.md
tiles: Seq[(SpatialKey, MultibandTile)] with Metadata[TileLayerMetadata[SpatialKey]],
extent: Extent
): Option[Raster[MultibandTile]] = {
val md = tiles.metadata

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you comment a bit further on why we don't need this anymore? That linked issue + its links don't show where the original problem handling missing spatialkeys is addressed in the original sparsestitch function.

@pomadchin
pomadchin force-pushed the fix/sparsed-stich branch from f186d03 to c5635bd Compare May 14, 2020 12:47
@pomadchin
pomadchin force-pushed the fix/sparsed-stich branch from c5635bd to 42c94b4 Compare May 14, 2020 12:47
@pomadchin pomadchin self-assigned this May 14, 2020
@pomadchin
pomadchin merged commit 18b67fb into locationtech:master May 14, 2020
@pomadchin
pomadchin deleted the fix/sparsed-stich branch May 14, 2020 14:05
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