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

Merge GeoTiffSource and ImageSource into RasterioSource #723

Merged
merged 3 commits into from Mar 25, 2019

Conversation

@lewfish
Copy link
Contributor

@lewfish lewfish commented Mar 21, 2019

Overview

Previously, we were using GeoTiffSource for reading geo-referenced files, and ImageSource for non-geo-referenced files using Rasterio. This was unnecessarily complicated and the names were misleading since GeoTiffSource could read any geo-referenced format handled by Rasterio/GDAL and not just TIFFs. So, this PR eliminates the two classes, moving functionality from GeoTiffSource into RasterioSource (the former base class of the two classes). Rasterio uses the identity transform for non-geo-referenced imagery, which made this refactor easier. This is handles backward compatibility in that configs can use the old, deprecated names, and old protobufs can still be read.

Testing

All changes tested with unit tests.

Closes #628

@codecov
Copy link

@codecov codecov bot commented Mar 25, 2019

Codecov Report

Merging #723 into develop will decrease coverage by 0.34%.
The diff coverage is 80.17%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #723      +/-   ##
===========================================
- Coverage     72.5%   72.16%   -0.35%     
===========================================
  Files          170      167       -3     
  Lines         8408     8226     -182     
===========================================
- Hits          6096     5936     -160     
+ Misses        2312     2290      -22
Impacted Files Coverage Δ
...ision/data/raster_transformer/stats_transformer.py 96% <ø> (ø) ⬆️
...rvision/data/raster_source/raster_source_config.py 83.95% <ø> (+1.02%) ⬆️
...ource/semantic_segmentation_label_source_config.py 54.41% <ø> (-1.48%) ⬇️
...sion/data/raster_transformer/raster_transformer.py 80% <ø> (ø) ⬆️
.../label_store/semantic_segmentation_raster_store.py 15.47% <0%> (+0.35%) ⬆️
rastervision/data/raster_source/api.py 100% <100%> (ø) ⬆️
rastervision/data/raster_source/default.py 88.23% <100%> (+1.27%) ⬆️
rastervision/registry.py 80.67% <100%> (ø) ⬆️
rastervision/data/raster_source/raster_source.py 89.18% <100%> (+4%) ⬆️
rastervision/predictor.py 15.87% <12.5%> (+0.61%) ⬆️
... and 48 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 091feb9...9468ca7. Read the comment docs.

@codecov
Copy link

@codecov codecov bot commented Mar 25, 2019

Codecov Report

Merging #723 into develop will decrease coverage by 0.35%.
The diff coverage is 80.17%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #723      +/-   ##
===========================================
- Coverage    72.51%   72.16%   -0.36%     
===========================================
  Files          170      167       -3     
  Lines         8424     8226     -198     
===========================================
- Hits          6109     5936     -173     
+ Misses        2315     2290      -25
Impacted Files Coverage Δ
...ision/data/raster_transformer/stats_transformer.py 96% <ø> (ø) ⬆️
...rvision/data/raster_source/raster_source_config.py 83.95% <ø> (+1.02%) ⬆️
...ource/semantic_segmentation_label_source_config.py 54.41% <ø> (-1.48%) ⬇️
...sion/data/raster_transformer/raster_transformer.py 80% <ø> (ø) ⬆️
.../label_store/semantic_segmentation_raster_store.py 15.47% <0%> (+0.35%) ⬆️
rastervision/data/raster_source/api.py 100% <100%> (ø) ⬆️
rastervision/data/raster_source/default.py 88.23% <100%> (+1.27%) ⬆️
rastervision/registry.py 80.67% <100%> (ø) ⬆️
rastervision/data/raster_source/raster_source.py 89.18% <100%> (ø) ⬆️
rastervision/predictor.py 15.87% <12.5%> (ø) ⬆️
... and 51 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7902f11...7cac688. Read the comment docs.

@lewfish lewfish force-pushed the lf/rasterio-source branch from 9468ca7 to 7cac688 Mar 25, 2019
lewfish added 3 commits Mar 21, 2019
* There's no need to have two separate classes because Rasterio handles
non-georeferenced data and uses the identity transform
* This handles backward compatibility in the sense of allowing use of the old names
in configs and protobufs that use the old names
@lewfish lewfish merged commit 8ccbf23 into develop Mar 25, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@lewfish lewfish deleted the lf/rasterio-source branch Mar 25, 2019
@lewfish lewfish removed the review label Mar 25, 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
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant