Register | Login
Attackpoint - performance and training tools for orienteering athletes

Discussion: GDAL: JPEG 2000 to GeoTIFF

in: Orienteering; Gear & Toys

Sep 1, 2014 12:34 PM # 
Tundra/Desert:
My GDAL gags on USGS's NAIP 1 m files, which are in JPEG 2000 format. I downloaded a converter, but it's buggy. Ed and others, have you had to deal with this?
Advertisement  
Sep 1, 2014 1:25 PM # 
Jagge:
I have once made similar kind of conversion by using irfanview to convert jpeg2000 files to tiffs and exiftool for reading coordinates from jpeg2000 files to tfw files. You can try that if nothing else works.
Sep 1, 2014 1:31 PM # 
igor_:
On a Mac this worked:
sips -s format jpeg source.jp2 --out result.jpg
Sep 1, 2014 1:31 PM # 
edwarddes:
I find that GDAL likes to throw lots of warnings at me on jp2 files, and is really really slow, but that it eventually works. Are the input files 4 band? Try explicitly specifying the bands that you want in the output.
Sep 1, 2014 4:44 PM # 
Pellervo:
Latest gdal-versions include only open source libraries for jp2 files and those work poorly on some files. For example 2.0.4 version of fwtools has kakadu-based jp2 converter and it works mostly better. Of course installing it you end up having two gdal distros on your computrr. Another option that works at least in finnish data is irfanview and exiftool as jagge said.
Sep 1, 2014 5:34 PM # 
Tundra/Desert:
I ended up just using the buggy freeware viewer/converter. Hope it doesn't move things around.
Sep 1, 2014 5:54 PM # 
cedarcreek:
I had to do the "explicitly specifying bands" as Ed recommended. It took maybe 10 attempts to get the command so that it would work. Unfortunately, I didn't keep notes, which I'm learning is very important. Without specifying bands, the output just looked wrong. It was washed-out and without contrast. It was from an aerial set flown in summer specifically for agricultural use.
Sep 1, 2014 7:13 PM # 
edwarddes:
If the source is 4 band CIR, then I think GDAL is trying to use the 4th band as an alpha mask in some way, which can make things look really weird and washed out. I like to separate the image into an RGB, and a IR file and work with them separately. Better than that though is to find someone at the GIS department that can get you access to the source tif files instead of the compressed jp2 ones.
Sep 2, 2014 7:53 AM # 
Terje Mathisen:
I have also used IrfanView to convert to regular JPEG format, along with a custom perl script to generate the required JGW world files.

This discussion thread is closed.