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 support for jpeg2000 writing #43

Merged
merged 2 commits into from Feb 26, 2019
Merged

Conversation

mraspaud
Copy link
Member

@mraspaud mraspaud commented Feb 25, 2019

  • Tests added (for all bug fixes or enhancements)
  • Tests passed (for all non-documentation changes)
  • Passes git diff origin/master **/*py | flake8 --diff (remove if you did not edit any Python files)
  • Fully documented (remove if this change should not be visible to users, e.g., if it is an internal clean-up, or if this is part of a larger project that will be documented later)

@mraspaud mraspaud self-assigned this Feb 25, 2019
@coveralls
Copy link

coveralls commented Feb 25, 2019

Coverage Status

Coverage increased (+0.08%) to 89.017% when pulling 55d7585 on mraspaud:feature-jp2000 into 8073e70 on pytroll:master.

Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

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

Looks good but I have a couple questions. If we are now saving JPEG2000 files (can PIL save these?) with rasterio then is it possible to save all of the image formats with rasterio? Should PIL only be used as a fall back? What does rasterio do with chunked saving? I didn't think JPEG2000 supported that?

@mraspaud
Copy link
Member Author

Yes, rasterio can save in any format that gdal supports basically, so even png for example. As an extra feature, it does save a extra xml file on the side with geographical info for those formats that don't support having it inside the image file. So in principle, we could have PIL as a backup only.

Regarding chunked saving, you are right that rasterio doesn't support it for jpeg2000. The format seems to support it, but somewhere along the way it got lost, probably at the gdal driver stage. But the benefit of jpeg2000 is reduced file size, about 1/4 of the size for large SAR images I observed. And QGIS can read them.

@djhoese
Copy link
Member

djhoese commented Feb 25, 2019

Does saving a chunked PNG image with rasterio produce a different file than using PIL? What about PngInfo or whatever that PIL uses? Does rasterio or gdal have an option for not creating the xml file?

@mraspaud
Copy link
Member Author

mraspaud commented Feb 25, 2019

I haven't tested rasterio for saving PNGs so much, so I really have no clue. As for skipping the xml creation, I've looked a bit, but couldn't find anything. So maybe PIL should be kept in satpy as it is for now.

@mraspaud mraspaud merged commit ad3630c into pytroll:master Feb 26, 2019
@mraspaud mraspaud deleted the feature-jp2000 branch February 26, 2019 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants