From Fedora 12 to a GIS workstation


I’m embarking on a bit of an adventure. I decided to build my work computer based on Fedora 12, and to include a collection of FOSS GIS programs. I have an idea (no proof, just a hunch) that Red Hat Enterprise Linux 6 will be more or less based on Fedora 12.  So confronting the issues now will be a good investment of time.  In addition I want to be able to import compressed raster images in ECW format, as well as satellite data from the MODIS program.

These data are supplied in the scientific data format HDF.  NASA adopted HDF as it’s standard over a decade ago.  HDF files offer two key advantages: they include, within the file itself, a complete description of the data that the file contains, and they are designed to hold many parallel data sets. While this suits NASA’s needs very well, the HDF format is not natively georeferenced. To this end a format known as EOS-HDF, which is just a superset of regular HDF, is used. The header enclosed in an EOS-HDF file contains the spatial information necessary to transform the data sets into a coordinate reference system for use in GIS.  So I’ll be compiling and installing the software libraries that support these data formats. Then, since the front-end software, i.e. QGIS and GRASS, depend on the underlying libraries for reading the data, I’ll also re-compile these programs.

I’ll try to record step-by-step as I work through this mission both for future reference, and for others who might be interested. Most likely this will stretch over a few posts…

My tactics include:

  • Start with  a fresh install of Fedora 12, no GIS yet.
  • Use yum to install packages whenever possible
  • Since I require some data formats that are not part of the basic gdal installation, I’ll have to compile gdal, and then up the chain to GRASS and QGIS.
  • All locally compiled software will be housed in /usr/local
  • All source packages are placed in and compiled in ~/Download
  • I have the /etc/sudoers file setup like on Ubuntu for commands requiring root permissions.

BASICS

First get the basic geospatial stuff:

~$ sudo yum install proj proj-epsg proj-devel geos libgeotiff libgeotiff-devel

and add compilers and build tools:

~$ sudo yum install gcc gcc-c++ gcc-gfortran flex byacc ncurses-devel bison

additional python packages will be required (some are for later on):

~$ sudo yum install wxGTK wxGTK-devel swig python-psycopg2 numpy PyQt4 PyQt4-devel sip sip-devel wxPython wxPython-devel

ECW SDK

Obtain and compile the  ecw library as outlined on the QGIS wiki

I’ll be placing this SDK and all my other locally compiled software into /usr/local. The libraries in /usr/local/lib need to be “found” by other software as we procede, so we need to add a configuration for the loader to search that directory. I do this by adding a conf file to ld.so.conf.d like so:

~$sudo echo "/usr/local/lib" >> /etc/ld.so.conf.d/gdal-1.6.conf
~$sudo ldconfig

HDF4

Install hdf library and software:

The szip compression library is used in NASA’s EOS-HDF format, so we need that first. The szip licence is somewhat restrictive for commercial use. But there are no limitations for decoding-only programs, or personal use. The HDFGroup website has the source available for download. Unzip the source and go into its directory, then run configure and do the compile:

~/Download$ cd szip-2.1
~/Download/szip-2.1$ ./configure --prefix=/usr/local
~/Download/szip-2.1$ make && sudo make install

some more packages from yum, and we’re ready to compile and install HDF:

~/Download$ sudo yum install zlib zlib-devel compat-gcc-34-g77

The EOS-HDF format is currently based on the HDF4 series.  The newer HDF5 is different, and incompatible with the original HDF4. Apparently a newer EOS-HDF5 version is already in use, but data I requested from NASA’s WIST data access site is still in the HDF4 version. So download the 4.2 version package, again from the HDFGroup website .  Untar the archive and drop into its directory.

~/Download$ tar xjvf HDF4.2r4.tar.bz2
~/Download$ cd HDF4.2r4
~/Download/HDF4.2r4$ ./configure --with-szlib=/usr/local/lib --prefix=/usr/local/hdf4.2
~/Download/HDF4.2r4$ make && make check
~/Download/HDF4.2r4$ sudo make install && sudo make check-install

Now is a good time to go for donuts and coffee. More to come…

Creative Commons License
This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
  1. #1 by Cameron Shorter - January 11th, 2010 at 04:41

    Hi Micha,

    Are you aware of the Arramagong Virtual Machine and LiveDVD build scripts that were used to build an Ubuntu based Geospatial distribution for FOSS4G 2009?

    We put together a build process and build scripts which can be used to install GIS packages for most of the popular Open Source geospatial applications.

    I expect that you will find these scripts very useful as a starting point for building a Fedora based distribution.

    Why don’t you discuss you ideas on our email list, and there is likely we can find ways to collaborate.

    Useful links:

    http://lists.osgeo.org/mailman/listinfo/live-demo

    http://wiki.osgeo.org/wiki/Live_GIS_Disc

    http://wiki.osgeo.org/wiki/Live_GIS_Build

    https://svn.osgeo.org/osgeo/livedvd/gisvm/trunk/bin/

  2. #2 by Micha Silver - January 16th, 2010 at 14:46

    Hello Cameron:

    Yes I know about the Arramagong LiveCD. I sent one to my neice, an environmentalist who is tired of struggling with ArcGIS server. Haven’t heard back from her yet, but as soon as 3.0 comes out, I’ll be sure to send her a copy…

    Thanks for mentioning the distro agnostic build scripts. I had the impression that Arramagong was strictly aimed at Xubuntu. I’ve joined the maillist and I’ll certainly have a look.

    Micha

  3. #3 by Gaurav Leekha - March 8th, 2010 at 06:10

    hi..
    can u tell me how to configure compat gcc34…actually i have install gcc and gcc34 from RPM then i tried to run the command
    “./configure prefix =” but some error like “file or directory not found”..so plz plz help me…
    thanks.

  4. #4 by Micha Silver - March 8th, 2010 at 08:52

    Hi Gaurav:
    What is it you’re trying to do? If you have gcc installed from RPM then you shouldn’t need to configure anything. To test try:
    gcc –version
    The configure command must be run from within a directory with source code, of course. i.e. there should be an executable ‘configure’ in that directory…

(will not be published)
  1. No trackbacks yet.