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

Discussion: JPEG2000 files question

in: Orienteering; General

Jan 12, 2018 3:23 PM # 
andreais:
I used to get image files from https://viewer.nationalmap.gov/basic/ They used to have two formats, regular JPG files with PNG georeferenced files included, and the JPEG2000 files. I have no problems with the JPG files loading into OCAD into the right position, but now these files are no longer there, and they only kept the JPEG2000. I have still not figured out how to convert these files so I can load them as backgrounds into OCAD 12 without losing the georeferencing information.
Advertisement  
Jan 12, 2018 4:52 PM # 
danfoster:
One option may be to use the free IrvanView software for Windows, and also install the free extensions for it, which includes a JPEG2000 plugin. You can then open the .jp2 file, save it at the same dimensions as a PNG file, and then rename the .jgw or .j2w worldfile (which contains the georeferencing info) to .pgw
Jan 12, 2018 6:19 PM # 
igor_:
On a Mac I think this worked for me:
sips -s format jpeg image.jp2 --out image.jpg
Jan 12, 2018 10:31 PM # 
robplow:
You could try GeoViewer (https://www.lizardtech.com/geoviewer-pro/overview). That worked for me converting MRSID files to something OCAD would handle.

I tried IrfanView which would change the format but lost the georeferencing but maybe the suggestion above works.
Jan 12, 2018 10:37 PM # 
andreais:
I'll try the non-Mac variant tonight, heading out as downhill ski instructor - even though all lessons might get cancelled by the time I get there - 0F and dropping fast.
Jan 13, 2018 2:49 AM # 
Canadian:
Can you load them as a layer in QGIS? That's usually the first thing I try to do with strange georeferenced files. Who's tends to open most things pretty reliably.
Jan 13, 2018 2:57 AM # 
andreais:
@Canadian - I only now see QGIS is freeware? I always thought it was not ... or maybe there are different ones?
Jan 13, 2018 2:36 PM # 
Canadian:
Yes, QGIS is open source. I really don't know much about it or really how to use it properly but seem to figure it out enough each time to fumble through what I need for basemap prep...
Feb 5, 2018 5:30 AM # 
andreais:
OK, I tried everything suggested... and more.... I don't seem to be able to extract/get/retain/whatever the georeferencing information. Is the georeferencing embedded in jp2 files, or would a jg2 have to be accompanying it somewhere?
Feb 5, 2018 4:23 PM # 
haywoodkb:
Have you tried to convert JP2 data to GeoTIFF using GDAL?
Feb 5, 2018 5:41 PM # 
edwarddes:
There are probably world files (*.jgw) to go along with the jp2 files.
Feb 5, 2018 5:44 PM # 
hughmac⁴:
Another vote for GDAL! I like the latest MSVC 2017 x64 zipped 'complete' binaries from GISInternals

# translate from jp2 to geotiff
gdal_translate -of GTiff INFILE.jp2 OUTFILE.tif
# reproject to WGS84/UTM (change zone as appropriate)
gdalwarp -t_srs "+proj=utm +zone=18 +datum=WGS84" OUTFILE.tif FINAL.tif
Feb 5, 2018 6:08 PM # 
Jagge:
If jp2 file has geo-referencing, you shouold be able to see it by printing out all metadata with exiftool

https://www.sno.phy.queensu.ca/~phil/exiftool/
https://www.sno.phy.queensu.ca/~phil/exiftool/exif...

From "examples":
Print all meta information in an image, including duplicate and unknown tags, sorted by group (for family 1).

exiftool -a -u -g1 a.jpg
Feb 5, 2018 8:00 PM # 
andreais:
@hughmac Thanks! It finally got it! Had one warning in the first step, but appears to not have affected the final file. I can just hope https://viewer.nationalmap.gov/basic/ does not change again so soon....
Feb 6, 2018 3:25 PM # 
hughmac⁴:
Sweeeet!! Nice job.

Please login to add a message.