Opened 8 years ago

Last modified 6 years ago

#3173 new defect

slow raster processing on r.external connected jpeg2000 layers

Reported by: dnewcomb Owned by: grass-dev@…
Priority: normal Milestone: 7.2.4
Component: Raster Version: svn-releasebranch72
Keywords: r.external, GDAL Cc:
CPU: x86-64 Platform: MSWindows 7


Just did a quick NVDI with Sentienl-2 bands downloaded from the Amazon cloud. If I link to the B04.jp2 and B08.jp2 images via r.external it takes about 60 minutes to create an ndvi layer.

If I import the layers ( 13 seconds each) and then run to create an ndvi layer, it takes 1 minute 24 sec.

This is with Wingrass 64 bit r69539

Images used were downloaded from

Change History (10)

comment:1 by neteler, 8 years ago

Component: ImageryRaster
Keywords: r.external GDAL added

Please also post the GDAL version and the JPEG2000 being used. The performance can quite differ and is rather unrelated to GRASS since r.external relies on GDAL.

comment:2 by dnewcomb, 8 years ago

gdalinfo --version gives: GDAL 2.1.1, released 2016/07/07

gdalinfo --formats gives:

JP2OpenJPEG for JP2 driver

Not sure which version of the JP2OpenJPEG driver was used.

comment:3 by neteler, 8 years ago

There is some dicussion on the right JPEG2000 driver to choose:

IMHO it is a GDAL related issue, not GRASS GIS related.

comment:4 by dnewcomb, 8 years ago

Looks like the best option for an open source stack is the JP2OpenJPEG driver, which is what is installed with the gdal version that in the Wingrass standalone binary.

What confuses me is that a straight to read , uncompress, and import the data takes seconds, while read, uncompress, and analyze takes substantially longer.

Will try to confirm that it happens on Linux as well before digging deeper.

comment:5 by dnewcomb, 8 years ago

Ok, had a few moment minutes to test on 10/20/16 with a fresh nightly build for 64 bit windows and a fresh SVN pull for GRASS 7.2.

The Linux version of GRASS did a simple NDVI in 3 minutes 5 seconds on a 4 year old i5 laptop with spinning drive. Gdal version is 2.1.0 Libopenjpeg version is 2.1.0-2

The Windows nightly build took 60 minutes on a 1 year old i7 running on an SSD drive. Will try again next week.

Current version of Gdal in OSGeo4W is gdal, 2.1.2-1. Current version of openjpeg, openjpeg is 2.0.0-2. does not list any changes related to speed.

QGIS windows version for windows has closer to GRASS Linux speeds when manually calculating NDVI using the raster calculator and appears to be using the 2.0.0-2 version of openjpeg ( as well as I can tell at this time of the night).

Not sure if it is strictly a Linux vs Windows issue or library version issue, or something else.

comment:6 by neteler, 8 years ago


Ticket retargeted after milestone closed

comment:7 by martinl, 7 years ago


comment:8 by neteler, 7 years ago


Ticket retargeted after milestone closed

comment:9 by martinl, 6 years ago

Milestone: 7.2.3

Ticket retargeted after milestone closed

comment:10 by martinl, 6 years ago

Milestone: 7.2.4
Note: See TracTickets for help on using tickets.