Visualising Urban Geographies: Using GDAL commands

The GDAL command line programs allow simple ways of viewing and converting between different image formats, or changing map projections. You can also use ArcGIS and QGIS to do these things. Understanding the commands is useful for understanding the way QGIS describes these processes. (Further information about using GDAL commands in QGIS using the Gdaltools plugin). The GDAL command line programs can be downloaded as part of the OSGeo4W software. (This also includes QGIS). To install OSGeo4W: The gdalinfo program is useful for listing information about a map image, for example, its format, size, coordinate system, extent, and any nodata pixels.The command takes the form: The ogr2ogr program is useful for converting vector map files to different formats. For example, an ESRI shapefile can be converted into a KML file with ogr2ogr. The command takes the form: -a_srs srs_def is used to assign the resulting Spatial Reference System. For example, -a_srs EPSG:27700 puts the output file into the British National Grid. [-f format_name]. Some possible formats are -f 'ESRI Shapefile' or -f 'KML'. View list of supported vector formats. The gdal_translate program converts map images between different formats, for example, from TIFF to JPEG. The command takes the form: For example, gdal_translate -of JPEG c:edgar.tif c:edgar.jpeg converts the TIFF image c:edgar.tif to create a new file edgar.jpeg The -a_nodata element can specify and maintain nodata or blank pixels, useful especially for mosaicking images. For example, if nodata pixels are white (255), use the command gdal_translate -of JPEG -a_nodata 255 c:edgar.tif c:edgar.jpeg The gdaltransform program converts map images between different projections, for example, from the British National Grid to the Global Spherical Mercator projection. The command takes the form: gdaltransform [-s_srs srs_def] [-t_srs srs_def] [-a_nodata value] [sourcefilename] [destinationfilename] -s_srs srs_def is used to assign the source Spatial Reference System. For example, -s_srs EPSG:27700 confirms the input file as being in the British National Grid projection. For example, to transform / reproject a map in the British National Grid projection (EPSG: 27700) into the WGS 84 Spherical Mercator projection (EPSG: 4326) use the command: By swapping the -s_srs and -t_srs parameters, the file can be converted from the WGS84 Spherical Mercator (EPSG: 4326) to the British National Grid (EPSG: 27700): Help. For all the GDAL commmands, type a -- help suffix after the command to display the full list of options/parameters for that command, eg. gdal_translate --help The GdalTools plugin in QGIS presents these GDAL commands, and others, through a graphic interface with natural language for options and settings. To use this, open QGIS and under Plugins >, Manage Plugins, scroll down and select the GdalTools plugin. The GDAL tools then appear as a set of options under the Raster menu, including Information, Translate, and Warp. Source.


Яндекс.Метрика Рейтинг@Mail.ru Free Web Counter
page counter
Last Modified: April 22, 2016 @ 7:03 am