Search code examples
postgresqlpostgisgdal

Add libraries to GDAL


I've been reading through the documentation and I'm having a hard time finding where and how to add libraries to a PostGIS install with GDAL support, installed from a windows binary packager. I'm importing an NITF file with an embedded JPEG2000 image within. the error reads

ERROR 1: Unable to open JPEG2000 within NITF file.
No JPEG2000 capable driver (JP2KAK JP2EECW JP2MRSID etc...) is availale.

You can define the NITF_OPENUNDERLYING_DS configuration option to NO, in order to just get the metadata.

It also doesn't state how to set that configuration. Because I would much rather have the metadata for this stage of my project. Any help or direction would be greatly appreciated


Solution

  • Many GDAL installations don't include J2K support. Before loading NITF's, I would try a normal j2k file (.jp2). That will tell you for sure. If no support is included, I would consider just building it from source.

    With GDAL, you have several options for a J2K reader. Usually, I use OpenJPEG as it seems to build easier in Windows for me. Otherwise, you can use Jasper. Kakadu is a good library, but it is not free.

    Luckily, the nmake Makefile is really clean. You should need to tweak only the config file beforehand (nmake.opt). I would build Proj4 and OpenJpeg with it.

    Finally, here are the NITF driver docs in GDAL if that has what you are looking for...

    http://www.gdal.org/frmt_nitf.html