29 mars 2024
Serveurs cartographiques
SIG Géomatique

Geospatial Data Abstraction Library (GDAL) utilities

GDAL also has some powerful utilities. Several command-line data access/manipulation utilities are available. All use the GDAL libraries for tasks such as the following:

gdalinfo
Interrogates a raster/image file and gives information about the file. This command, when given a raster file/data source name, provides a listing of various statistics about the data, as shown in the following code:

gdalinfo vancouver.tif

Driver: GTiff/GeoTIFF

Size is 1236, 1028

Coordinate System is:

PROJCS["NAD83 / UTM zone 10N",

    GEOGCS["NAD83",

        DATUM["North_American_Datum_1983",

            SPHEROID["GRS 1980",6378137,298.2572221010042,

                AUTHORITY["EPSG","7019"]],

            AUTHORITY["EPSG","6269"]],

        PRIMEM["Greenwich",0],

        UNIT["degree (supplier to define representation)",0.01745329251994328],

        AUTHORITY["EPSG","4269"]],

    PROJECTION["Transverse_Mercator"],

    PARAMETER["latitude_of_origin",0],

    PARAMETER["central_meridian",-123],

    PARAMETER["scale_factor",0.9996],

    PARAMETER["false_easting",500000],

    PARAMETER["false_northing",0],

    UNIT["metre",1,

        AUTHORITY["EPSG","9001"]],

    AUTHORITY["EPSG","26910"]]

Origin = (480223.000000,5462627.000000)

Pixel Size = (15.00000000,-15.00000000)

Corner Coordinates:

Upper Left  (  480223.000, 5462627.000) (123d16'19.62"W, 49d18'57.81"N)

Lower Left  (  480223.000, 5447207.000) (123d16'16.88"W, 49d10'38.47"N)

Upper Right (  498763.000, 5462627.000) (123d 1'1.27"W, 49d18'58.96"N)

Lower Right (  498763.000, 5447207.000) (123d 1'1.10"W, 49d10'39.61"N)

Center      (  489493.000, 5454917.000) (123d 8'39.72"W, 49d14'48.97"N)

Band 1 Block=256x256 Type=Byte, ColorInterp=Red

Band 2 Block=256x256 Type=Byte, ColorInterp=Green

Band 3 Block=256x256 Type=Byte, ColorInterp=Blue

Various pieces of important information are shown here: image format, size, map projection used (if any), geographic extent, number of colors, and pixel size. All these pieces of information can be very useful when working with data, particularly data that is from an external source about which little is known

gdal_translate
Translates a raster/image between formats. It has numerous powerful functions such as image resizing, adding ground control points for geo-referencing, and taking subsets of data. This tool can also manipulate any supported format for other purposes, such as web or graphic design. This is particularly useful when images are very large and not easily handled by other software.

gdaladdo
Adds overview levels to a file. This feature improves application performance viewing a file. Applications that are able to read these overviews can then request appropriate resolutions for the display and map scale without loading the full resolution of the file into memory. Instead, portions of an image at reduced resolution are quickly provided.

gdalwarp
Takes a source image and reprojects it into a new image, warping the image to fit the output coordinate system. This is very useful when source data isn’t in the required coordinate spatial reference system. For example, a geo-referenced satellite image may be projected into UTM projection with meter units, but the application requires it to be unprojected in geographic coordinates (latitude/longitude) measured in degrees.

gdal_merge.py
A very powerful tool that takes multiple input images and stitches them together into a single output image. It is a Python script that requires the Python interpreter software to be installed on your system and the GDAL Python module to be loaded. This is a good example of how powerful programs can be built on top of GDAL using higher-level languages such as Python. See http://python.org/ for more information about the programming language. Recent download packages of FWTools include GDAL and Python as well. See http://fwtools.maptools.org/.

gdaltindex
Creates or appends the bounds of an image into an index shapefile. You run gdaltindex with image names as a parameter. GDAL checks the geographic extents of the image and creates a rectangular shape. The shape and the name of the image files are then saved to the output shapefile. This image index can be used by MapServer to define a single layer that is actually made up of more than one image. It works as a virtual image data source and helps MapServer find the right image efficiently.

In general, GDAL aids in accessing, converting, and manipulating rasters/images. When further programming is done using languages such as Python, GDAL can also serve as a powerful analysis tool. In one sense GDAL can also be used as a rough viewing tool because it allows conversion into commonly viewable formats (e.g., JPEG) for which many non-GIS users may have viewing software.

Web Mapping Illustrated, Juin 2005. By Tyler Mitchell, Publisher: O’Reilly, Pages: 368

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Certifications

You cannot copy content of this page / Veuillez saisir ce que vous souhaitez copier.

error: Content is protected !!