Saturday, February 26, 2011

HDF4 support for GDAL on Arch Linux

I have been trouble reading HDF files with OTB on Arch Linux for a while. I finally took the time to investigate this problem and come to a solution.
At the beginning I was misled by the fact that I was able to open a HDF5 file with Monteverdi on Arch. But I finally understood that the GDAL pre-compiled package for Arch was only missing HDF4 support.
It is due to the fact that HDF4 depends on libjpeg version 6, and is incompatible with the standard current version of libjpeg on Arch.
So the solution is to install libjpeg6 and HDF4 from the AUR and then regenerate the gdal package, who, during the configuration phase will automatically add HDF4 support.
Here are the detailed steps I took:
  1. Install libjpeg6 from AUR:
    1. mkdir ~/local/packages
    2. cd ~/local/packages
    3. wget http://aur.archlinux.org/packages/libjpeg6/libjpeg6.tar.gz
    4. tar xzf libjpeg6.tar.gz
    5. cd libjpeg6
    6. makepkg -i #will prompt for root psswd for installation
  2. Install HDF4 from AUR:
    1. cd ~/local/packages
    2. wget http://aur.archlinux.org/packages/hdf4-nonetcdf/hdf4-nonetcdf.tar.gz
    3. tar xzf hdf4-nonetcdf.tar.gz
    4. cd hdf4-nonetcdf
    5. makepkg -i #will prompt for root psswd for installation
  3. Setup an Arch Build System build tree
    1. sudo pacman -S abs
    2. sudo abs
    3. mkdir ~/local/abs
  4. Compile gdal
    1. cp -r /var/abs/community/gdal ~/local/abs
    2. makepkg -s #generated the package without installing it
    3. sudo makepkg -U gdal-1.8.0-2-x8664.pkg.tar.gz
If you are new to using AUR and makepkg, please note that the AUR package installation need the sudo package to be installed first (the packages are build as a non root user and sudo is called by makepkg).
Step 3 above is only needed if you have never set up the Arch Build System on your system.

Wednesday, February 9, 2011

Understanding map projections

Map projections are both easy and tricky. I am not a specialist at all about the subject, but I have used them a little bit.

When I say that map projections are easy, I mean that, even without understanding them completely, there are tools which allow a user to get the work one. Of course, I use the Orfeo Toolbox library, which in turn uses the OSSIM library. Actually, some years ago, with a student, we designed the interface in order to integrate OSSIM map projections (and sensor models too) into OTB so that they could be used as the existing geometric transforms already available in OTB (which came from ITK).

The only thing we had to understand in order to design this interface was that map projections are coordinate transformations. Then, we chose the appropriate object-oriented design pattern together with a bit of C++ templates for the generic programming ingredient and that was it.

When some users started using the projections (well, WE were those users) questions arised about the projections themselves. The task in answering to these questions would have been much easier if we had had this info (posted by Caitlin Dempsey on GIS Lounge):

/"The USGS has posted a scanned file of John P. Snyder's 1987 "Map/ Projections: A Working Manual" online in PDF and DjVu format. The beginning of the book contains substantial introductory information about map projection families and distortions. Each projection is started with a useful summary of the context and usage of that particular projection. Snyder then delves into detail about the history, features, and usage before providing the mathematical /formulas used to calculate the projection."/

Sunday, February 6, 2011

Traffic Monitoring with TerraSAR-X

I have just read this interesting article which describes away to measure vehicle speeds using space-borne SAR sensors. The article explains very clearly how Doppler effect can be used, either with one single image, or with an interferometric pair, to estimate the speed of cars or ships.

DLR's TerraSAR-X system has always impressed me. It has been providing very high quality images from its launch. For having used the images, I can say that their geometrical quality is very good. And as far as I know, this is the only operational system in flight which is able to perform one-pass interferometry.

So far so good.

However, the article forgets to mention that these satellites acquire only 2 images per day on a given point of the Earth's surface -- typically in the morning and in the evening – so one can not expect to use this technology for real-time traffic monitoring.

So you don't need to worry about getting a ticket for speed.

Author: Jordi Inglada