[gdal-dev] [EXTERNAL] Re: FITS format not listed in gdalinfo --formats

Trent Hare thare at usgs.gov
Thu Jul 5 10:12:10 PDT 2018


 Susan,
   Yes -  the FITS format is supported in GDAL once compilation has been
linked to CFITSIO.

Note this driver is currently being enhanced to (1) better support FITS
files within GDAL and (2) the format FITS will have an extension added to
it, which allows more typical GIS map projection support. That branch of
GDAL is being worked on Chiara Marmo:
https://github.com/epn-vespa/gdal/tree/fits_driver

For Mac, I'm not sure this will work, but on Linux (Fedora and Ubuntu) this
should get you FITS support in GDAL (and also get QGIS with FITS also).

*In order to have QGIS working with FITS*

   - install CFITSIO (Fedora : cfitsio-devel ; Ubuntu : libcfitsio-dev)
   - install GDAL (Fedora : gdal-devel ; Ubuntu : libgdal-dev)
   - install QGIS


*Temporary workaround:  *
  So a method Chiara created to test GDAL for FITS users is a simple Python
script which creates a GDAL VRT header pointing into the FITS file. Once
the VRT is created, any GDAL program can use it by pointing at the VRT file
(gdal_translate, QGIS, ArcMap, ...). Perhaps that is worth a shot.
https://github.com/epn-vespa/fits2vrt

Lastly, once the FITS driver is updated we will try to support an anaconda
version of GDAL with CFITSIO pre-built for users (should help Macs users
too).

Good luck,
Trent


P.S. maybe a little un-tested *build help* (linux again - sorry).

Install CFITSIO
Clone/download the GDAL repo.
$ cd gdal/gdal
you have compiled there the 'fits-driver' branch, using
$ ./configure
In that same repo you have a config.log file.
If you grep cfitsio in config.log you must have (among others, and
depending on your distro)
EXTRA_INCLUDES='-I/usr/include/cfitsio '
LIBS='-lcrypto -lexpat -ljasper -ljpeg -lgeotiff -ltiff -lpng -lcfitsio -lz
-lpthread -lm -lrt -ldl  -lpcre'
now
$ ./make
more: https://trac.osgeo.org/gdal/wiki/BuildingOnUnix


On Thu, Jul 5, 2018 at 9:59 AM Susan Borda <sborda at umich.edu> wrote:

> Thanks Evan, I saw that mentioned in the formats list but I'm not sure how
> to "build GDAL" with this library. I just downloaded GDAL and it uses
> Python 3.6 but the version of CFITSIO I found uses Python 2.x. I'm using a
> Mac but can easily run all of this on Linux VM if need be.
>
> -susan
>
> On Thu, Jul 5, 2018 at 12:45 PM Even Rouault <even.rouault at spatialys.com>
> wrote:
>
>> On jeudi 5 juillet 2018 12:41:08 CEST Susan Borda wrote:
>> > Hi-
>> > I'm new to gdal and am trying to use gdalinfo to read a *.fits file
>> > (astronomy files), specifically the header. When I list the formats
>> > supported by gdalinfo, I'm only seeing FIT not FITS. Is FITS no longer
>> > supported?
>>
>> It is, but you must build GDAL against the CFITSIO library:
>> http://gdal.org/frmt_various.html#FITS
>>
>> On Debian and derivatives, this is the libcfitsio-dev package.
>>
>> --
>> Spatialys - Geospatial professional services
>> http://www.spatialys.com
>>
>
>
> --
> Susan Borda
> Data Workflows Specialist
> Research Data Services
> University of Michigan Libraries
> 3175 Shapiro Library
> 734-764-9134 | sborda at umich.edu
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180705/3926ee3f/attachment.html>


More information about the gdal-dev mailing list