Month: February 2011

Adding ECW support to GDAL via plugins.

Posted by – Sunday 2011-02-27

In this post we will see how to add to the Geospatial Data Abstraction Library [1] (GDAL) library limited support [note 1] for ER Mapper’s Enhanced Compression Wavelet (ECW) format[2]. The environment will be an Ubuntu Linux operating system.

The ECW format has become very popular because it achieves high compression ratios at the expense of small amounts of RAM memory and computing time. Another remarkable feature of this format is selective decompression, that is, it is “able to selectively decompress a portion of digital imagery while viewing the image, and to selectively decompress the image at different levels of detail (as the user zooms in or out the image view)” [3]. Other popular compression formats like TIFF or JPEG do not feature selective decompression; the whole image must be decompressed before viewing it, a seriuos issue when working with gigabyte sized images like orthophotographs.

The ECW format is propietary and, thus Linux distros like Debian or Ubuntu do not provide support for ECW in GDAL, even in their selections of non-free packages. That is the reason of the ‘install recipes’ shown in this post.

In the first section we will see how to compile this library, creating a .deb package useful for future installations. In the second section we will see how to install the GDAL’s ECW plugin, also needed to get GDAL able to read ECW files.

Come abilitare il supporto ai file ECW in GDAL e visualizzarli in GRASS e QGIS“, written in Italian language, is the article this one is based on.


Efficient LiDAR data bulk load in a PostGIS database.

Posted by – Sunday 2011-02-06

In this post we will see how to efficiently perform data bulk load in a spatial PostGIS database running in a Linux environment, coming the data from an airborne LiDAR survey.

Spatial databases can be used to store data collected in remote sensing Light Detection and Ranging[1] (LiDAR) surveys. LiDAR technology has many applications is forestry, where it is used in the generation Digital Terrain Models and Digital Surface Models[2], estimation of forest fuel variables…

In an airborne LiDAR survey, a LiDAR sensor emits laser pulses towards ground. Laser pulses are reflected when reaching obstacles as trees or the ground and, after a time elapse, echoes are received by the sensor, which records elapsed time and echo intensity. In addition, this kind of sensors have a kinematic Global Positioning System[3] (GPS) and an Inertial Measurement Unit[4] (IMU) that continuously registers the spatial position of the aircraft. Thus, high precision geo-referenced elevation and laser reflection intensity data is collected.

LiDAR surveys produce high volume of data. For instance, as of 2010 a commercial airborne LiDAR survey provided 12 points per square meter, which sums 120,000 points for an area as small as a hectare.

Thus, the problem of efficiently loading LiDAR data in a spatial database arises. The obvious approach, using INSERT queries, will work, but at the expense of consuming a lot of time. In sections 1, 2 and 3 we will see how to achieve efficient bulk data load in PostGIS by using the command COPY[5]. In section 4 some benchmarking is done, comparing the perfomance of data loading with COPY and INSERT.