-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
JP2Grok: add new driver for JPEG 2000 format using Grok library #8133
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some CI testing of the driver would be desirable. It should be normally sufficient to have Grok installed in .github/workflows/ubuntu_20.04/Dockerfile.ci
@@ -0,0 +1,552 @@ | |||
|
|||
.. _raster.JP2Grok: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My comments on the doc done in the previous iteration #5117 haven't been addressed
-------------- | ||
|
||
The following open option is available: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have now dedicated syntax ( https://gdal.org/development/dev_documentation.html#define-and-reference-configuration-options ) to define open and creation options. But better would be to try to commonalize that with the openjpeg driver through .rst inclusion
import gdaltest | ||
|
||
pytestmark = pytest.mark.require_driver('JP2Grok') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I raised previously in https://github.com/OSGeo/gdal/pull/5117/files#r793891898 , there's a lot of similarity between that file and jp2openjpeg.py . I presume using pytest fixtures we could factor a lot and most differences are perhaps in checksums for lossy compression (I didn't check) . Any opinion @dbaston if that's worth it ? The potential downsides would be if the behavior of drivers would have to diverge in significant ways, but I don't anticipate that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rouault any ideas on how we get to a common test base for both drivers ? Also, can I run the python driver test locally ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any ideas on how we get to a common test base for both drivers ?
presumably using pytest.fixture() in test_jp2openjpeg.py. The driver_name fixture in autotest/ogr/ogr_rfc35py (recent master) could serve as inspiration. Presumably something along (untested...):
@pytest.fixture(autouse=True, params=["JP2OpenJPEG", "JP2Grok"])
def driver(request):
driver_name = request.param
jp2_drv = gdal.GetDriverByName(driver_name)
if jp2_drv is None:
pytest.skip(f"{driver_name} not available")
gdaltest.deregister_all_jpeg2000_drivers_but(driver_name)
yield jp2_drv
gdaltest.reregister_all_jpeg2000_drivers()
def test_1(driver):
... do something ....
def test_2(driver):
... do something ....
Also, can I run the python driver test locally ?
Sure, you need to have the swig and python-dev packages installed. Then:
- cmake -DBUILD_PYTHON_BINDINGS=ON ..
- make python_binding
- source ../scripts/setenv.sh
- pytest autotest/gdrivers/jp2openjpeg.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
4d54430
to
c9562e5
Compare
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
@boxerab I'm currently on vacations until August 7th, so just to warn you to be patient. |
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
bacb567
to
aebafa8
Compare
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
46469ef
to
b715c9d
Compare
Once this PR is validated, it will be re-used in OSGeo#8133
Once this PR is validated, it will be re-used in OSGeo#8133
you also need to format your code according to our formatting rules. See https://gdal.org/development/dev_practices.html#commit-hooks how to install pre-commit. You 'll need to run "pre-commit run --all-files" to fix the formatting of files and git rebase on top of latest master to get rid off unrelated CI failures and clean the commit history |
Once this PR is validated, it will be re-used in OSGeo#8133
should now be rebased on top of latest master now that #8142 has been merged |
e0b45b8
to
6c25303
Compare
Once this PR is validated, it will be re-used in OSGeo#8133
Is there some kind of table with availables drivers and their corresponding licences? |
Drivers themselves are MIT. But underlying libraries have their own licence indeed. In the JPEG2000 world, only the JP2OpenJPEG driver relies on a permissive license (openjpeg is 2-clause BSD licensed). Others are either proprietary (MrSID, ECW, Kakadu, Luratech) or Grok AGPL |
The license of the Grok driver is MIT. The license of the Grok library is AGPL. The licenses that apply to GDAL source tree are listed in LICENSE.TXT (contents can be seen for example with I fear it is up to the one who builds GDAL to check what they add into the mixturea and under which licenses, and decide how to report the licenses for their users. |
Is there some news regarding this PR ? |
No time to work on this PR for foreseeable future. Closing. |
What does this PR do?
This PR adds a new driver for the JPEG 2000 format using Grok library.
Design Strategy
The existing
JP2OpenJPEG
driver was copied and refactored to isolate the OpenJPEG-specific bitsin a header file
opj_context
while keeping most of the generic logic intact. Then, a similar header filegrk_context
was created with Grok-specific bits. So, this refactor could be used for both open source JPEG 2000drivers.
Testing
Basic performance testing of
gdal_translate
with default settings on a large HiRISE image shows this driver outperforming the existing open source driver by 6 times.What are related issues/pull requests?
#3449
#5117
Tasklist