1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413
|
#ifndef DOXYGEN_SKIP
/* $Id: gdal_utilities.dox 25825 2013-04-01 08:45:42Z dron $ */
#endif /* DOXYGEN_SKIP */
/*!
\page gdal_utilities GDAL Utilities
\brief A collection of GDAL related programs.
The following utility programs are distributed with GDAL.
<ul>
<li> \ref gdalinfo - report information about a file.
<li> \ref gdal_translate - Copy a raster file, with control of output format.
<li> \ref gdaladdo - Add overviews to a file.
<li> \ref gdalwarp - Warp an image into a new coordinate system.
<li> \ref gdaltindex - Build a MapServer raster tileindex.
<li> \ref gdalbuildvrt - Build a VRT from a list of datasets.
<li> \ref gdal_contour - Contours from DEM.
<li> \ref gdaldem - Tools to analyze and visualize DEMs.
<li> \ref rgb2pct - Convert a 24bit RGB image to 8bit paletted.
<li> \ref pct2rgb - Convert an 8bit paletted image to 24bit RGB.
<li> \ref gdal_merge - Build a quick mosaic from a set of images.
<li> \ref gdal2tiles - Create a TMS tile structure, KML and simple web viewer.
<li> \ref gdal_rasterize - Rasterize vectors into raster file.
<li> \ref gdaltransform - Transform coordinates.
<li> \ref nearblack - Convert nearly black/white borders to exact value.
<li> \ref gdal_retile - Retiles a set of tiles and/or build tiled pyramid levels.
<li> \ref gdal_grid - Create raster from the scattered data.
<li> \ref gdal_proximity - Compute a raster proximity map.
<li> \ref gdal_polygonize - Generate polygons from raster.
<li> \ref gdal_sieve - Raster Sieve filter.
<li> \ref gdal_fillnodata - Interpolate in nodata regions.
<li> \ref gdallocationinfo - Query raster at a location.
<li> \ref gdalsrsinfo - Report a given SRS in different formats. (GDAL >= 1.9.0)
<li> \ref gdalmove - Transform the coordinate system of a file (GDAL >= 1.10)
<li> \ref gdal_edit - Edit in place various information of an existing GDAL dataset (projection, geotransform, nodata, metadata)
<li> \ref gdal-config - Get options required to build software using GDAL.
<li> \ref gdalmanage - Identify, copy, rename and delete raster.
</ul>
\section gdal_utilities_creating Creating New Files
Access an existing file to read it is generally quite simple. Just
indicate the name of the file or dataset on the commandline. However,
creating a file is more complicated. It may be necessary to indicate the
the format to create, various creation options affecting how it will
be created and perhaps a coordinate system to be assigned. Many of
these options are handled similarly by different GDAL utilities, and are
introduced here. <p>
<dl>
<dt> <b>-of</b> <i>format</i></dt><dd>
Select the format to create the new file as. The formats are assigned short
names such as GTiff (for GeoTIFF) or HFA (for Erdas Imagine). The list of
all format codes can be listed with the <b>--formats</b> switch. Only
formats list as "(rw)" (read-write) can be written.<p>
Many utilities default
to creating GeoTIFF files if a format is not specified. File extensions
are not used to guess output format, nor are extensions generally added
by GDAL if not indicated in the filename by the user.
</dd>
<dt> <b>-co</b> <i>NAME=VALUE</i></dt><dd>
Many formats have one or more optional creation options that can be used
to control particulars about the file created. For instance, the GeoTIFF
driver supports creation options to control compression, and whether the file
should be tiled.<p>
The creation options available vary by format driver, and some simple
formats have no creation options at all. A list of options supported
for a format can be listed with the "--format <format>" commandline
option but the web page for the format is the definitive source of
information on driver creation options.<p>
</dd>
<dt> <b>-a_srs</b> <i>SRS</i></dt><dd>
Several utilities, (gdal_translate and gdalwarp) include the ability
to specify coordinate systems with commandline options like
<b>-a_srs</b> (assign SRS to output), <b>-s_srs</b> (source SRS) and
<b>-t_srs</b> (target SRS).<p>
These utilities allow the coordinate system (SRS = spatial reference system)
to be assigned in a variety of formats.<p>
<ul>
<li> <b>NAD27</b>/<b>NAD83</b>/<b>WGS84</b>/<b>WGS72</b>:
These common geographic (lat/long) coordinate
systems can be used directly by these names.
<li> <b>EPSG:</b><i>n</i>: Coordinate systems (projected or geographic) can
be selected based on their EPSG codes, for instance EPSG:27700 is the British
National Grid. A list of EPSG coordinate systems can be found in the GDAL
data files gcs.csv and pcs.csv.
<li> <i>PROJ.4 Definitions</i>: A PROJ.4 definition string can be used
as a coordinate system. For instance "+proj=utm +zone=11 +datum=WGS84".
Take care to keep the proj.4 string together as a single argument to the
command (usually by double quoting). <p>
<li> <i>OpenGIS Well Known Text</i>: The Open GIS Consortium has defined
a textual format for describing coordinate systems as part of the Simple
Features specifications. This format is the internal working format
for coordinate systems used in GDAL. The name of a file containing a
WKT coordinate system definition may be used a coordinate system argument,
or the entire coordinate system itself may be used as a commandline
option (though escaping all the quotes in WKT is quite challenging). <p>
<li> <i>ESRI Well Known Text</i>: ESRI uses a slight variation on OGC WKT
format in their ArcGIS product (ArcGIS .prj files), and these may be used
in a similar manner to WKT files, but the filename should be prefixed with
<b>ESRI::</b>. For example <b>"ESRI::NAD 1927 StatePlane Wyoming West FIPS 4904.prj"</b>. <p>
<li> <i>Spatial References from URLs</i>: For example
http://spatialreference.org/ref/user/north-pacific-albers-conic-equal-area/.<p>
<li> <i>filename</i>: The name of a file containing WKT, PROJ.4 strings, or
XML/GML coordinate system definitions can be provided. <p>
</ul>
</dd>
</dl>
\section gdal_utilities_switches General Command Line Switches
All GDAL command line utility programs support the following
"general" options.<p>
<dl>
<dt> <b>--version</b></dt><dd> Report the version of GDAL and exit.</dd>
<dt> <b>--formats</b></dt><dd> List all raster formats supported by this
GDAL build (read-only and read-write) and exit. The format support is indicated
as follows: 'ro' is read-only driver;
'rw' is read or write (ie. supports CreateCopy);
'rw+' is read, write and update (ie. supports Create).
A 'v' is appended for formats supporting virtual IO (/vsimem, /vsigzip, /vsizip, etc).
A 's' is appended for formats supporting subdatasets.
Note: The valid formats for the output of gdalwarp are formats that support the
Create() method (marked as rw+), not just the CreateCopy() method.
</dd>
<dt> <b>--format</b> <i>format</i></dt><dd>
List detailed information about a single format driver. The <i>format</i>
should be the short name reported in the <b>--formats</b> list, such as
GTiff.</dd>
<dt> <b>--optfile</b> <i>file</i></dt><dd>
Read the named file and substitute the contents into the commandline
options list. Lines beginning with # will be ignored. Multi-word arguments
may be kept together with double quotes.
</dd>
<dt> <b>--config</b> <i>key value</i></dt><dd>
Sets the named <a href="http://trac.osgeo.org/gdal/wiki/ConfigOptions">
configuration keyword</a> to the given value, as opposed to
setting them as environment variables. Some common configuration keywords
are GDAL_CACHEMAX (memory used internally for caching in megabytes)
and GDAL_DATA (path of the GDAL "data" directory). Individual drivers may
be influenced by other configuration options.
</dd>
<dt> <b>--debug</b> <i>value</i></dt><dd>
Control what debugging messages are emitted. A value of <i>ON</i> will
enable all debug messages. A value of <i>OFF</i> will disable all debug
messages. Another value will select only debug messages containing that
string in the debug prefix code.
</dd>
<dt> <b>--help-general</b></dt><dd>
Gives a brief usage message for the generic GDAL commandline options
and exit.
</dd>
</dl>
\htmlonly
<p>
$Id: gdal_utilities.dox 25825 2013-04-01 08:45:42Z dron $
</p>
\endhtmlonly
*/
*******************************************************************************
/*! \page gdalinfo gdalinfo
lists information about a raster dataset
\section gdalinfo_synopsis SYNOPSIS
\verbatim
gdalinfo [--help-general] [-mm] [-stats] [-hist] [-nogcp] [-nomd]
[-norat] [-noct] [-nofl] [-checksum] [-proj4] [-mdd domain]*
[-sd subdataset] datasetname
\endverbatim
\section gdalinfo_description DESCRIPTION
The gdalinfo program lists various information about a GDAL supported
raster dataset.
<dl>
<dt> <b>-mm</b></dt><dd> Force computation of the actual min/max values for each
band in the dataset.</dd>
<dt> <b>-stats</b></dt><dd> Read and display image statistics. Force computation if no statistics are stored in an image.</dd>
<dt> <b>-approx_stats</b></dt><dd> Read and display image statistics. Force
computation if no statistics are stored in an image. However, they may be
computed based on overviews or a subset of all tiles. Useful if you are in a
hurry and don't want precise stats.</dd>
<dt> <b>-hist</b></dt><dd> Report histogram information for all bands.</dd>
<dt> <b>-nogcp</b></dt><dd> Suppress ground control points list printing. It may be
useful for datasets with huge amount of GCPs, such as L1B AVHRR or HDF4 MODIS
which contain thousands of them.</dd>
<dt> <b>-nomd</b></dt><dd> Suppress metadata printing. Some datasets may contain a lot
of metadata strings.</dd>
<dt> <b>-nrat</b></dt><dd> Suppress printing of raster attribute table.</dd>
<dt> <b>-noct</b></dt><dd> Suppress printing of color table.</dd>
<dt> <b>-checksum</b></dt><dd> Force computation of the checksum for each band in the dataset.</dd>
<dt> <b>-mdd domain</b></dt><dd> Report metadata for the specified domain</dd>
<dt> <b>-nofl</b></dt><dd> (GDAL >= 1.9.0) Only display the first file of the
file list.</dd>
<dt> <b>-sd</b> <i>subdataset</i></dt><dd> (GDAL >= 1.9.0) If the input
dataset contains several subdatasets read and display a subdataset with
specified number (starting from 1). This is an alternative of giving the full
subdataset name.</dd>
<dt> <b>-proj4</b></dt><dd> (GDAL >= 1.9.0) Report a PROJ.4 string corresponding to the file's coordinate system.</dd>
</dl>
The gdalinfo will report all of the following (if known):
<ul>
<li> The format driver used to access the file.
<li> Raster size (in pixels and lines).
<li> The coordinate system for the file (in OGC WKT).
<li> The geotransform associated with the file (rotational coefficients are
currently not reported).
<li> Corner coordinates in georeferenced, and if possible lat/long based on
the full geotransform (but not GCPs).
<li> Ground control points.
<li> File wide (including subdatasets) metadata.
<li> Band data types.
<li> Band color interpretations.
<li> Band block size.
<li> Band descriptions.
<li> Band min/max values (internally known and possibly computed).
<li> Band checksum (if computation asked).
<li> Band NODATA value.
<li> Band overview resolutions available.
<li> Band unit type (i.e.. "meters" or "feet" for elevation bands).
<li> Band pseudo-color tables.
</ul>
\section gdalinfo_example EXAMPLE
\verbatim
gdalinfo ~/openev/utm.tif
Driver: GTiff/GeoTIFF
Size is 512, 512
Coordinate System is:
PROJCS["NAD27 / UTM zone 11N",
GEOGCS["NAD27",
DATUM["North_American_Datum_1927",
SPHEROID["Clarke 1866",6378206.4,294.978698213901]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",-117],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["metre",1]]
Origin = (440720.000000,3751320.000000)
Pixel Size = (60.000000,-60.000000)
Corner Coordinates:
Upper Left ( 440720.000, 3751320.000) (117d38'28.21"W, 33d54'8.47"N)
Lower Left ( 440720.000, 3720600.000) (117d38'20.79"W, 33d37'31.04"N)
Upper Right ( 471440.000, 3751320.000) (117d18'32.07"W, 33d54'13.08"N)
Lower Right ( 471440.000, 3720600.000) (117d18'28.50"W, 33d37'35.61"N)
Center ( 456080.000, 3735960.000) (117d28'27.39"W, 33d45'52.46"N)
Band 1 Block=512x16 Type=Byte, ColorInterp=Gray
\endverbatim
\if man
\section gdalinfo_author AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de>
\endif
*/
*******************************************************************************
/*! \page gdal_translate gdal_translate
converts raster data between different formats
\section gdal_translate_synopsis SYNOPSIS
\verbatim
gdal_translate [--help-general]
[-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/
CInt16/CInt32/CFloat32/CFloat64}] [-strict]
[-of format] [-b band] [-mask band] [-expand {gray|rgb|rgba}]
[-outsize xsize[%] ysize[%]]
[-unscale] [-scale [src_min src_max [dst_min dst_max]]]
[-srcwin xoff yoff xsize ysize] [-projwin ulx uly lrx lry] [-epo] [-eco]
[-a_srs srs_def] [-a_ullr ulx uly lrx lry] [-a_nodata value]
[-gcp pixel line easting northing [elevation]]*
[-mo "META-TAG=VALUE"]* [-q] [-sds]
[-co "NAME=VALUE"]* [-stats]
src_dataset dst_dataset
\endverbatim
\section gdal_translate_description DESCRIPTION
The gdal_translate utility can be used to convert raster data between
different formats, potentially performing some operations like subsettings,
resampling, and rescaling pixels in the process.
<dl>
<dt> <b>-ot</b>: <i>type</i></dt><dd> For the output bands to be of the
indicated data type.</dd>
<dt> <b>-strict</b>:</dt><dd> Don't be forgiving of mismatches and lost data
when translating to the output format.</dd>
<dt> <b>-of</b> <i>format</i>:</dt><dd> Select the output format. The default
is GeoTIFF (GTiff). Use the short format name.</dd>
<dt> <b>-b</b> <i>band</i>:</dt><dd> Select an input band <i>band</i> for
output. Bands are numbered from 1. Multiple <b>-b</b> switches may be used
to select a set of input bands to write to the output file, or to reorder
bands. Starting with GDAL 1.8.0, <i>band</i> can also be set to "mask,1"
(or just "mask") to mean the mask band of the first band of the input dataset.</dd>
<dt> <b>-mask</b> <i>band</i>:</dt><dd> (GDAL >= 1.8.0) Select an input band
<i>band</i> to create output dataset mask band. Bands are numbered from 1.
<i>band</i> can be set to "none" to avoid copying the global mask of the input dataset if
it exists. Otherwise it is copied by default ("auto"), unless the mask is an alpha channel,
or if it is explicitly used to be a regular band of the output dataset ("-b mask").
<i>band</i> can also be set to "mask,1" (or just "mask") to mean the mask band of
the 1st band of the input dataset.</dd>
<dt> <b>-expand</b> <i>gray|rgb|rgba</i>:</dt><dd> (From GDAL 1.6.0) To expose a dataset with 1 band
with a color table as a dataset with 3 (RGB) or 4 (RGBA) bands. Useful for
output drivers such as JPEG, JPEG2000, MrSID, ECW that don't support color
indexed datasets. The 'gray' value (from GDAL 1.7.0) enables to expand a
dataset with a color table that only contains gray levels to a gray indexed
dataset.</dd>
<dt> <b>-outsize</b> <i>xsize[%] ysize[%]</i>:</dt><dd> Set the size of the output
file. Outsize is in pixels and lines unless '\%' is attached in which case it
is as a fraction of the input image size.</dd>
<dt> <b>-scale</b> <i>[src_min src_max [dst_min dst_max]]</i>:</dt><dd> Rescale the
input pixels values from the range <i>src_min</i> to <i>src_max</i> to
the range <i>dst_min</i> to <i>dst_max</i>. If omitted the output range is
0 to 255. If omitted the input range is automatically computed from the
source data.</dd>
<dt> <b>-unscale</b>:</dt><dd> Apply the scale/offset metadata for the bands
to convert scaled values to unscaled values. It is also often necessary to
reset the output datatype with the <b>-ot</b> switch.</dd>
<dt> <b>-srcwin</b> <i>xoff yoff xsize ysize</i>:</dt><dd> Selects a subwindow
from the source image for copying based on pixel/line location. </dd>
<dt> <b>-projwin</b> <i>ulx uly lrx lry</i>:</dt><dd> Selects a subwindow from
the source image for copying (like <b>-srcwin</b>) but with the corners given
in georeferenced coordinates. </dd>
<dt> <b>-epo</b>: (Error when Partially Outside)</dt><dd>(GDAL >= 1.10) If this
option is set, <b>-srcwin</b> or <b>-projwin</b> values that falls partially outside the
source raster extent will be considered as an error. The default behaviour starting
with GDAL 1.10 is to accept such requests, when they were considered as an error before.</dd>
<dt> <b>-eco</b>: (Error when Completely Outside)</dt><dd>(GDAL >= 1.10) Same
as <b>-epo</b>, except that the criterion for erroring out is when the request falls completely
outside the source raster extent.</dd>
<dt> <b>-a_srs</b> <i>srs_def</i>:</dt><dd> Override the projection for the
output file. The <i>srs_def</i> may be any of the usual GDAL/OGR forms,
complete WKT, PROJ.4, EPSG:n or a file containing the WKT. </dd>
<dt> <b>-a_ullr</b> <i>ulx uly lrx lry</i>:</dt><dd>
Assign/override the georeferenced bounds of the output file. This assigns
georeferenced bounds to the output file, ignoring what would have been derived
from the source file.</dd>
<dt> <b>-a_nodata</b> <i>value</i>:</dt><dd>
Assign a specified nodata value to output bands. Starting with GDAL 1.8.0, can
be set to <i>none</i> to avoid setting a nodata value to the output file if
one exists for the source file</dd>
<dt> <b>-mo</b> <i>"META-TAG=VALUE"</i>:</dt><dd> Passes a metadata key and
value to set on the output dataset if possible.</dd>
<dt> <b>-co</b> <i>"NAME=VALUE"</i>:</dt><dd> Passes a creation option to the
output format driver. Multiple <b>-co</b> options may be listed. See format
specific documentation for legal creation options for each format.</dd>
<dt> <b>-gcp</b> <i>pixel line easting northing elevation</i>:</dt><dd>
Add the indicated ground control point to the output dataset. This option
may be provided multiple times to provide a set of GCPs.
</dd>
<dt> <b>-q</b>:</dt><dd> Suppress progress monitor and other non-error
output.</dd>
<dt> <b>-sds</b>:</dt><dd> Copy all subdatasets of this file to individual
output files. Use with formats like HDF or OGDI that have subdatasets.</dd>
<dt> <b>-stats</b>:</dt><dd> (GDAL >= 1.8.0) Force (re)computation of statistics.</dd>
<dt> <i>src_dataset</i>:</dt><dd>The source dataset name. It can be either
file name, URL of data source or subdataset name for multi-dataset files.</dd>
<dt> <i>dst_dataset</i>:</dt><dd> The destination file name.</dd>
</dl>
\section gdal_translate_example EXAMPLE
\verbatim
gdal_translate -of GTiff -co "TILED=YES" utm.tif utm_tiled.tif
\endverbatim
Starting with GDAL 1.8.0, to create a JPEG-compressed TIFF with internal mask from a RGBA dataset :
\verbatim
gdal_translate rgba.tif withmask.tif -b 1 -b 2 -b 3 -mask 4 -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR --config GDAL_TIFF_INTERNAL_MASK YES
\endverbatim
Starting with GDAL 1.8.0, to create a RGBA dataset from a RGB dataset with a mask :
\verbatim
gdal_translate withmask.tif rgba.tif -b 1 -b 2 -b 3 -b mask
\endverbatim
\if man
\section gdal_translate_author AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de>
\endif
*/
*******************************************************************************
/*! \page gdaladdo gdaladdo
builds or rebuilds overview images
\section gdaladdo_synopsis SYNOPSIS
\verbatim
gdaladdo [-r {nearest,average,gauss,cubic,average_mp,average_magphase,mode}]
[-b band]
[-ro] [-clean] [--help-general] filename levels
\endverbatim
\section gdaladdo_description DESCRIPTION
The gdaladdo utility can be used to build or rebuild overview images for
most supported file formats with one of several downsampling algorithms.
<dl>
<dt> <b>-r</b>
<i>{nearest (default),average,gauss,cubic,average_mp,average_magphase,mode}</i>:</dt><dd>
Select a resampling algorithm.</dd>
<dt> <b>-b</b> <i>band</i>:</dt><dd> (available from GDAL 1.10) Select an input band <i>band</i> for
overview generation. Band numbering starts from 1. Multiple <b>-b</b> switches may be used
to select a set of input bands to generate overviews.</dd>
<dt> <b>-ro</b></dt>:<dd> (available from GDAL 1.6.0) open the dataset in read-only mode, in order to generate
external overview (for GeoTIFF especially). </dd>
<dt> <b>-clean</b></dt>:<dd> (available from GDAL 1.7.0) remove all overviews. </dd>
<dt> <i>filename</i>:</dt><dd> The file to build overviews for (or whose overviews must be removed). </dd>
<dt> <i>levels</i>:</dt><dd> A list of integral overview levels to build. Ignored with -clean option.</dd>
</dl>
<i>Mode</i> (available from GDAL 1.6.0) selects the value which appears most often of all the sampled points.
<i>average_mp</i> is unsuitable for use.
<i>Average_magphase</i> averages complex data in mag/phase space.
<i>Nearest</i> and <i>average</i> are applicable to normal image data.
<i>Nearest</i> applies a nearest neighbour (simple sampling) resampler, while
<i>average</i> computes the average of all non-NODATA contributing pixels.
<i>Cubic</i> resampling (available from GDAL 1.7.0) applies a 4x4 approximate cubic convolution kernel.
<i>Gauss</i> resampling (available from GDAL 1.6.0) applies a Gaussian kernel before computing the overview,
which can lead to better results than simple averaging in e.g case of sharp edges
with high contrast or noisy patterns. The advised level values should be 2, 4, 8, ...
so that a 3x3 resampling Gaussian kernel is selected.
gdaladdo will honour properly NODATA_VALUES tuples (special dataset metadata) so
that only a given RGB triplet (in case of a RGB image) will be considered as the
nodata value and not each value of the triplet independently per band.
Selecting a level value like <i>2</i> causes an overview level that is 1/2
the resolution (in each dimension) of the base layer to be computed. If
the file has existing overview levels at a level selected, those levels will
be recomputed and rewritten in place.
For internal GeoTIFF overviews (or external overviews in GeoTIFF format), note
that -clean does not shrink the file. A later run of gdaladdo with overview levels
will cause the file to be expanded, rather than reusing the space of the previously
deleted overviews. If you just want to change the resampling method on a file that
already has overviews computed, you don't need to clean the existing overviews.
Some format drivers do not support overviews at all. Many format drivers
store overviews in a secondary file with the extension .ovr that is actually
in TIFF format. By default, the GeoTIFF driver stores overviews internally to the file
operated on (if it is writeable), unless the -ro flag is specified.
Most drivers also support an alternate overview format using Erdas Imagine
format. To trigger this use the USE_RRD=YES configuration option. This will
place the overviews in an associated .aux file suitable for direct use with
Imagine or ArcGIS as well as GDAL applications. (eg --config USE_RRD YES)
\section gdaladdo_externalgtiffoverviews External overviews in GeoTIFF format
External overviews created in TIFF format may be compressed using the COMPRESS_OVERVIEW
configuration option. All compression methods, supported by the GeoTIFF
driver, are available here. (eg --config COMPRESS_OVERVIEW DEFLATE).
The photometric interpretation can be set with --config PHOTOMETRIC_OVERVIEW {RGB,YCBCR,...},
and the interleaving with --config INTERLEAVE_OVERVIEW {PIXEL|BAND}.
For JPEG compressed external overviews, the JPEG quality can be set with
"--config JPEG_QUALITY_OVERVIEW value" (GDAL 1.7.0 or later).
For LZW or DEFLATE compressed external overviews, the predictor value can be set
with "--config PREDICTOR_OVERVIEW 1|2|3" (GDAL 1.8.0 or later).
To produce the smallest possible JPEG-In-TIFF overviews, you should use :
\verbatim
--config COMPRESS_OVERVIEW JPEG --config PHOTOMETRIC_OVERVIEW YCBCR --config INTERLEAVE_OVERVIEW PIXEL
\endverbatim
Starting with GDAL 1.7.0, external overviews can be created in the BigTIFF format by using
the BIGTIFF_OVERVIEW configuration option : --config BIGTIFF_OVERVIEW {IF_NEEDED|IF_SAFER|YES|NO}.
The default value is IF_NEEDED. The behaviour of this option is exactly the same as the BIGTIFF creation option
documented in the GeoTIFF driver documentation.
<ul>
<li>YES forces BigTIFF.
<li>NO forces classic TIFF.
<li>IF_NEEDED will only create a BigTIFF if it is clearly needed (uncompressed, and overviews larger than 4GB).
<li>IF_SAFER will create BigTIFF if the resulting file *might* exceed 4GB.
</ul>
<br>
See the documentation of the GeoTIFF driver for further explanations on all those options.
\section gdaladdo_example EXAMPLE
\htmlonly
Example:
\endhtmlonly
Create overviews, embedded in the supplied TIFF file:
\verbatim
gdaladdo -r average abc.tif 2 4 8 16
\endverbatim
Create an external compressed GeoTIFF overview file from the ERDAS .IMG file:
\verbatim
gdaladdo -ro --config COMPRESS_OVERVIEW DEFLATE erdas.img 2 4 8 16
\endverbatim
Create an external JPEG-compressed GeoTIFF overview file from a 3-band RGB dataset
(if the dataset is a writeable GeoTIFF, you also need to add the -ro option to
force the generation of external overview):
\verbatim
gdaladdo --config COMPRESS_OVERVIEW JPEG --config PHOTOMETRIC_OVERVIEW YCBCR
--config INTERLEAVE_OVERVIEW PIXEL rgb_dataset.ext 2 4 8 16
\endverbatim
Create an Erdas Imagine format overviews for the indicated JPEG file:
\verbatim
gdaladdo --config USE_RRD YES airphoto.jpg 3 9 27 81
\endverbatim
\if man
\section gdaladdo_author AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de>
\endif
*/
*******************************************************************************
/*! \page gdaltindex gdaltindex
builds a shapefile as a raster tileindex
\section gdaltindex_synopsis SYNOPSIS
\verbatim
gdaltindex [-tileindex field_name] [-write_absolute_path] [-skip_different_projection] [-t_srs target_srs] index_file [gdal_file]*
\endverbatim
\section gdaltindex_description DESCRIPTION
This program builds a shapefile with a record for each input raster file,
an attribute containing the filename, and a polygon geometry outlining the
raster. This output is suitable for use with <a href="http://mapserver.org/">MapServer</a> as a raster
tileindex.
<ul>
<li> The shapefile (index_file) will be created if it doesn't already exist,
otherwise it will append to the existing file.
<li> The default tile index field is 'location'.
<li> Raster filenames will be put in the file exactly as they are specified
on the commandline unless the option -write_absolute_path is used.
<li> If -skip_different_projection is specified, only files with same projection ref
as files already inserted in the tileindex will be inserted (unless t_srs is specified).
<li> If -t_srs is specified, geometries of input files will be transformed to the desired
target coordinate reference system.
Note that using this option generates files that are NOT compatible with MapServer.
<li> Simple rectangular polygons are generated in the same coordinate reference system
as the rasters, or in target reference system if the -t_srs option is used.
</ul>
\section gdaltindex_example EXAMPLE
\htmlonly
Example:
\endhtmlonly
\verbatim
gdaltindex doq_index.shp doq/*.tif
\endverbatim
\if man
\section gdaltindex_author AUTHOR
Frank Warmerdam <warmerdam@pobox.com>
\endif
*/
*******************************************************************************
/*! \page gdalbuildvrt gdalbuildvrt
Builds a VRT from a list of datasets. (compiled by default since GDAL 1.6.1)
\section gdalbuildvrt_synopsis SYNOPSIS
\verbatim
gdalbuildvrt [-tileindex field_name]
[-resolution {highest|lowest|average|user}]
[-te xmin ymin xmax ymax] [-tr xres yres] [-tap]
[-separate] [-b band] [-sd subdataset]
[-allow_projection_difference] [-q]
[-addalpha] [-hidenodata]
[-srcnodata "value [value...]"] [-vrtnodata "value [value...]"]
[-a_srs srs_def]
[-input_file_list my_liste.txt] [-overwrite] output.vrt [gdalfile]*
\endverbatim
\section gdalbuildvrt_description DESCRIPTION
This program builds a VRT (Virtual Dataset) that is a mosaic of the list of
input GDAL datasets. The list of input GDAL datasets can be specified at the end
of the command line, or put in a text file (one filename per line) for very long lists,
or it can be a MapServer tileindex (see \ref gdaltindex utility). In the later case, all
entries in the tile index will be added to the VRT.
With -separate, each files goes into a separate <i>stacked</i> band in the VRT band. Otherwise,
the files are considered as tiles of a larger mosaic and the VRT file has as many bands as one
of the input files.
If one GDAL dataset is made of several subdatasets and has 0 raster bands,
all the subdatasets will be added to the VRT rather than the dataset itself.
gdalbuildvrt does some amount of checks to assure that all files that will be put
in the resulting VRT have similar characteristics : number of bands, projection, color
interpretation... If not, files that do not match the common characteristics will be skipped.
(This is only true in the default mode, and not when using the -separate option)
If there is some amount of spatial overlapping between files, the order may depend on the order they
are inserted in the VRT file, but this behaviour should not be relied on.
This utility is somehow equivalent to the gdal_vrtmerge.py utility and is build by default
in GDAL 1.6.1.
<dl>
<dt> <b>-tileindex</b>:</dt><dd>
Use the specified value as the tile index field, instead of the default value with is 'location'.
</dd>
<dt> <b>-resolution</b> {highest|lowest|average|user}:</dt><dd>
In case the resolution of all input files is not the same, the -resolution flag
enables the user to control the way the output resolution is computed. 'average' is the default.
'highest' will pick the smallest values of pixel dimensions within the set of source rasters.
'lowest' will pick the largest values of pixel dimensions within the set of source rasters.
'average' will compute an average of pixel dimensions within the set of source rasters.
'user' is new in GDAL 1.7.0 and must be used in combination with the -tr option to specify the target resolution.
</dd>
<dt> <b>-tr</b> xres yres :</dt><dd> (starting with GDAL 1.7.0)
set target resolution. The values must be expressed in georeferenced units.
Both must be positive values. Specifying those values is of course incompatible with
highest|lowest|average values for -resolution option.
</dd>
<dt> <b>-tap</b>:</dt><dd> (GDAL >= 1.8.0) (target aligned pixels) align
the coordinates of the extent of the output file to the values of the -tr,
such that the aligned extent includes the minimum extent.</dd>
<dt> <b>-te</b> xmin ymin xmax ymax :</dt><dd> (starting with GDAL 1.7.0)
set georeferenced extents of VRT file. The values must be expressed in georeferenced units.
If not specified, the extent of the VRT is the minimum bounding box of the set of source rasters.
</dd>
<dt> <b>-addalpha</b>:</dt><dd> (starting with GDAL 1.7.0)
Adds an alpha mask band to the VRT when the source raster have none. Mainly useful for RGB sources (or grey-level sources).
The alpha band is filled on-the-fly with the value 0 in areas without any source raster, and with value
255 in areas with source raster. The effect is that a RGBA viewer will render
the areas without source rasters as transparent and areas with source rasters as opaque.
This option is not compatible with -separate.</dd>
<dt> <b>-hidenodata</b>:</dt><dd> (starting with GDAL 1.7.0)
Even if any band contains nodata value, giving this option makes the VRT band
not report the NoData. Useful when you want to control the background color of
the dataset. By using along with the -addalpha option, you can prepare a
dataset which doesn't report nodata value but is transparent in areas with no
data.</dd>
<dt> <b>-srcnodata</b> <em>value [value...]</em>:</dt><dd> (starting with GDAL 1.7.0)
Set nodata values for input bands (different values can be supplied for each band). If
more than one value is supplied all values should be quoted to keep them
together as a single operating system argument. If the option is not specified, the
intrinsic nodata settings on the source datasets will be used (if they exist). The value set by this option
is written in the NODATA element of each ComplexSource element. Use a value of
<tt>None</tt> to ignore intrinsic nodata settings on the source datasets.</dd>
<dt> <b>-b</b> <i>band</i>:</dt><dd>(GDAL >= 1.10.0)
Select an input <i>band</i> to be processed. Bands are numbered from 1.
If input bands not set all bands will be added to vrt</dd>
<dt> <b>-sd</b> <i>subdataset</i></dt><dd> (GDAL >= 1.10.0) If the input
dataset contains several subdatasets use a subdataset with the specified
number (starting from 1). This is an alternative of giving the full subdataset
name as an input.</dd>
<dt> <b>-vrtnodata</b> <em>value [value...]</em>:</dt><dd> (starting with GDAL 1.7.0)
Set nodata values at the VRT band level (different values can be supplied for each band). If more
than one value is supplied all values should be quoted to keep them together
as a single operating system argument. If the option is not specified,
intrinsic nodata settings on the first dataset will be used (if they exist). The value set by this option
is written in the NoDataValue element of each VRTRasterBand element. Use a value of
<tt>None</tt> to ignore intrinsic nodata settings on the source datasets.</dd>
<dt> <b>-separate</b>:</dt><dd> (starting with GDAL 1.7.0)
Place each input file into a separate <i>stacked</i> band. In that case, only the first
band of each dataset will be placed into a new band. Contrary to the default mode, it is not
required that all bands have the same datatype.
</dd>
<dt> <b>-allow_projection_difference</b>:</dt><dd> (starting with GDAL 1.7.0)
When this option is specified, the utility will accept to make a VRT even if the input datasets have
not the same projection. Note: this does not mean that they will be reprojected. Their projection will
just be ignored.
</dd>
<dt> <b>-a_srs</b> <i>srs_def</i>:</dt><dd> (starting with GDAL 1.10)
Override the projection for the output file. The <i>srs_def</i> may be any of the usual GDAL/OGR forms,
complete WKT, PROJ.4, EPSG:n or a file containing the WKT. </dd>
<dt> <b>-input_file_list</b>:</dt><dd>
To specify a text file with an input filename on each line
</dd>
<dt> <b>-q</b>:</dt><dd> (starting with GDAL 1.7.0)
To disable the progress bar on the console
</dd>
<dt> <b>-overwrite</b>:</dt><dd>Overwrite the VRT if it already exists.</dd>
</dl>
\section gdalbuildvrt_example EXAMPLE
\htmlonly
Example:
\endhtmlonly
Make a virtual mosaic from all TIFF files contained in a directory :
\verbatim
gdalbuildvrt doq_index.vrt doq/*.tif
\endverbatim
Make a virtual mosaic from files whose name is specified in a text file :
\verbatim
gdalbuildvrt -input_file_list my_liste.txt doq_index.vrt
\endverbatim
Make a RGB virtual mosaic from 3 single-band input files :
\verbatim
gdalbuildvrt -separate rgb.vrt red.tif green.tif blue.tif
\endverbatim
Make a virtual mosaic with blue background colour (RGB: 0 0 255) :
\verbatim
gdalbuildvrt -hidenodata -vrtnodata "0 0 255" doq_index.vrt doq/*.tif
\endverbatim
\if man
\section gdalbuildvrt_author AUTHOR
Even Rouault <even.rouault@mines-paris.org>
\endif
*/
*******************************************************************************
/*! \page gdal_contour gdal_contour
builds vector contour lines from a raster elevation model
\section gdal_contour_synopsis SYNOPSIS
\verbatim
Usage: gdal_contour [-b <band>] [-a <attribute_name>] [-3d] [-inodata]
[-snodata n] [-i <interval>]
[-f <formatname>] [[-dsco NAME=VALUE] ...] [[-lco NAME=VALUE] ...]
[-off <offset>] [-fl <level> <level>...]
[-nln <outlayername>]
<src_filename> <dst_filename>
\endverbatim
\section gdal_contour_description DESCRIPTION
This program generates a vector contour file from the input raster elevation
model (DEM).
Starting from version 1.7 the contour line-strings will be oriented
consistently. The high side will be on the right, i.e. a line string goes
clockwise around a top.
<dl>
<dt> <b>-b</b> <em>band</em>:</dt><dd> picks a particular band to get the DEM from. Defaults to band 1.</dd>
<dt> <b>-a</b> <em>name</em>:</dt><dd>provides a name for the attribute in which to put the elevation. If not provided no elevation attribute is attached. </dd>
<dt> <b>-3d</b>:</dt> <dd>
Force production of 3D vectors instead of 2D. Includes elevation at
every vertex.</dd>
<dt> <b>-inodata</b>:</dt> <dd> Ignore any nodata value implied in the dataset - treat all values as valid.</dd>
<dt> <b>-snodata</b> <em>value</em>:</dt><dd>
Input pixel value to treat as "nodata". </dd>
<dt> <b>-f</b> <em>format</em>:</dt> <dd>
create output in a particular format, default is shapefiles.</dd>
<dt> <b>-dsco</b> <em>NAME=VALUE</em>:</dt><dd> Dataset creation option (format specific)</dd>
<dt> <b>-lco</b> <em>NAME=VALUE</em>:</dt><dd> Layer creation option (format specific)</dd>
<dt> <b>-i</b> <em>interval</em>:</dt><dd>
elevation interval between contours.</dd>
<dt> <b>-off</b> <em>offset</em>:</dt><dd>
Offset from zero relative to which to interpret intervals.</dd>
<dt> <b>-fl</b> <em>level</em>:</dt>
<dd> Name one or more "fixed levels" to extract.</dd>
<dt> <b>-nln</b> <em>outlayername</em>:</dt>
<dd> Provide a name for the output vector layer. Defaults to "contour".</dd>
</dl>
\section gdal_contour_example EXAMPLE
This would create 10meter contours from the DEM data in dem.tif and produce
a shapefile in contour.shp/shx/dbf with the contour elevations in the "elev"
attribute.
\verbatim
gdal_contour -a elev dem.tif contour.shp -i 10.0
\endverbatim
\if man
\section gdal_contour_author AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de>
\endif
*/
*******************************************************************************
/*! \page gdal_rasterize gdal_rasterize
burns vector geometries into a raster
\section gdal_rasterize_synopsis SYNOPSIS
\verbatim
Usage: gdal_rasterize [-b band]* [-i] [-at]
[-burn value]* | [-a attribute_name] [-3d]
[-l layername]* [-where expression] [-sql select_statement]
[-of format] [-a_srs srs_def] [-co "NAME=VALUE"]*
[-a_nodata value] [-init value]*
[-te xmin ymin xmax ymax] [-tr xres yres] [-tap] [-ts width height]
[-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/
CInt16/CInt32/CFloat32/CFloat64}] [-q]
<src_datasource> <dst_filename>
\endverbatim
\section gdal_rasterize_description DESCRIPTION
This program burns vector geometries (points, lines and polygons) into the
raster band(s) of a raster image. Vectors are read from OGR supported vector
formats.
Note that the vector data must in the same coordinate system as the
raster data; on the fly reprojection is not provided.
Since GDAL 1.8.0, the target GDAL file can be created by gdal_rasterize. One of -tr or -ts option
must be used in that case.
<dl>
<dt> <b>-b</b> <em>band</em>: </dt><dd>
The band(s) to burn values into. Multiple -b arguments may be used to burn
into a list of bands. The default is to burn into band 1.</dd>
<dt> <b>-i</b>: </dt><dd>
Invert rasterization. Burn the fixed burn value, or the burn value associated
with the first feature into all parts of the image <em>not</em> inside the
provided a polygon.</dd>
<dt> <b>-at</b>: </dt><dd>
Enables the ALL_TOUCHED rasterization option so that all pixels touched
by lines or polygons will be updated not just those one the line render path,
or whose center point is within the polygon. Defaults to disabled for normal
rendering rules.</dd>
<dt> <b>-burn</b> <em>value</em>: </dt><dd>
A fixed value to burn into a band for all objects. A list of -burn options
can be supplied, one per band being written to.</dd>
<dt> <b>-a</b> <em>attribute_name</em>: </dt><dd>
Identifies an attribute field on the features to be used for a burn in value.
The value will be burned into all output bands.</dd>
<dt> <b>-3d</b>: </dt><dd>
Indicates that a burn value should be extracted from the "Z" values of the
feature. These values are adjusted by the burn value given by "-burn value" or
"-a attribute_name" if provided. As of now, only points and lines are drawn in
3D.</dd>
<dt> <b>-l</b> <em>layername</em>: </dt><dd>
Indicates the layer(s) from the datasource that will be used for input
features. May be specified multiple times, but at least one layer name or a -sql option must be specified.</dd>
<dt> <b>-where</b> <em>expression</em>: </dt><dd>
An optional SQL WHERE style query expression to be applied to select features
to burn in from the input layer(s). </dd>
<dt> <b>-sql</b> <em>select_statement</em>: </dt><dd>
An SQL statement to be evaluated against the datasource to produce a
virtual layer of features to be burned in.</dd>
<dt> <b>-of</b> <i>format</i>:</dt><dd> (GDAL >= 1.8.0) Select the output format. The default
is GeoTIFF (GTiff). Use the short format name.</dd>
<dt> <b>-a_nodata</b> <i>value</i>:</dt><dd> (GDAL >= 1.8.0)
Assign a specified nodata value to output bands.</dd>
<dt> <b>-init</b> <i>value</i>:</dt><dd> (GDAL >= 1.8.0)
Pre-initialize the output image bands with these values. However, it is not
marked as the nodata value in the output file. If only one value is given, the
same value is used in all the bands.</dd>
<dt> <b>-a_srs</b> <i>srs_def</i>:</dt><dd> (GDAL >= 1.8.0) Override the projection for the
output file. If not specified, the projection of the input vector file will be used if available.
If incompatible projections between input and output files, no attempt will be made to reproject features.
The <i>srs_def</i> may be any of the usual GDAL/OGR forms,
complete WKT, PROJ.4, EPSG:n or a file containing the WKT. </dd>
<dt> <b>-co</b> <i>"NAME=VALUE"</i>:</dt><dd> (GDAL >= 1.8.0) Passes a creation option to the
output format driver. Multiple <b>-co</b> options may be listed. See format
specific documentation for legal creation options for each format.</dd>
<dt> <b>-te</b> <em>xmin ymin xmax ymax</em> :</dt><dd> (GDAL >= 1.8.0)
set georeferenced extents. The values must be expressed in georeferenced units.
If not specified, the extent of the output file will be the extent of the vector layers.
</dd>
<dt> <b>-tr</b> <em>xres yres</em> :</dt><dd> (GDAL >= 1.8.0)
set target resolution. The values must be expressed in georeferenced units.
Both must be positive values.
</dd>
<dt> <b>-tap</b>:</dt><dd> (GDAL >= 1.8.0) (target aligned pixels) align
the coordinates of the extent of the output file to the values of the -tr,
such that the aligned extent includes the minimum extent.</dd>
<dt> <b>-ts</b> <em>width height</em>:</dt><dd> (GDAL >= 1.8.0) set output file size in
pixels and lines. Note that -ts cannot be used with -tr</dd>
<dt> <b>-ot</b> <i>type</i>:</dt><dd> (GDAL >= 1.8.0) For the output bands to be of the
indicated data type. Defaults to Float64</dd>
<dt> <b>-q</b>:</dt><dd> (GDAL >= 1.8.0) Suppress progress monitor and other non-error
output.</dd>
<dt> <em>src_datasource</em>: </dt><dd>
Any OGR supported readable datasource.</dd>
<dt> <em>dst_filename</em>: </dt><dd>
The GDAL supported output file. Must support update mode access.
Before GDAL 1.8.0, gdal_rasterize could not create new output files.</dd>
</dl>
\section gdal_rasterize_example EXAMPLE
The following would burn all polygons from mask.shp into the RGB TIFF
file work.tif with the color red (RGB = 255,0,0).
\verbatim
gdal_rasterize -b 1 -b 2 -b 3 -burn 255 -burn 0 -burn 0 -l mask mask.shp work.tif
\endverbatim
The following would burn all "class A" buildings into the output elevation
file, pulling the top elevation from the ROOF_H attribute.
\verbatim
gdal_rasterize -a ROOF_H -where 'class="A"' -l footprints footprints.shp city_dem.tif
\endverbatim
\if man
\section gdal_rasterize_author AUTHORS
Frank Warmerdam <warmerdam@pobox.com>
\endif
*/
*******************************************************************************
/*! \page rgb2pct rgb2pct.py
Convert a 24bit RGB image to 8bit paletted
\section rgb2pct_synopsis SYNOPSIS
\verbatim
rgb2pct.py [-n colors | -pct palette_file] [-of format] source_file dest_file
\endverbatim
\section rgb2pct_description DESCRIPTION
This utility will compute an optimal pseudo-color table for a given RGB image
using a median cut algorithm on a downsampled RGB histogram. Then it
converts the image into a pseudo-colored image using the color table.
This conversion utilizes Floyd-Steinberg dithering (error diffusion) to
maximize output image visual quality.
<dl>
<dt> <b>-n</b> <i>colors</i>:</dt><dd> Select the number of colors in the generated
color table. Defaults to 256. Must be between 2 and 256. </dd>
<dt> <b>-pct</b> <i>palette_file</i>:</dt><dd> Extract the color table from
<i>palette_file</i> instead of computing it. Can be used to have a consistent
color table for multiple files. The <i>palette_file</i> must be a raster file
in a GDAL supported format with a palette.</dd>
<dt> <b>-of</b> <i>format</i>:</dt><dd> Format to generated (defaults to GeoTIFF). Same
semantics as the <b>-of</b> flag for gdal_translate. Only output formats
supporting pseudocolor tables should be used. </dd>
<dt> <i>source_file</i>:</dt><dd> The input RGB file. </dd>
<dt> <i>dest_file</i>:</dt><dd> The output pseudo-colored file that will be
created.</dd>
</dl>
NOTE: rgb2pct.py is a Python script, and will only work if GDAL was built
with Python support.
\section rgb2pct_example EXAMPLE
If it is desired to hand create the palette, likely the simplest text format
is the GDAL VRT format. In the following example a VRT was created in a
text editor with a small 4 color palette with the RGBA colors 238/238/238/255,
237/237/237/255, 236/236/236/255 and 229/229/229/255.
\verbatim
% rgb2pct.py -pct palette.vrt rgb.tif pseudo-colored.tif
% more < palette.vrt
<VRTDataset rasterXSize="226" rasterYSize="271">
<VRTRasterBand dataType="Byte" band="1">
<ColorInterp>Palette</ColorInterp>
<ColorTable>
<Entry c1="238" c2="238" c3="238" c4="255"/>
<Entry c1="237" c2="237" c3="237" c4="255"/>
<Entry c1="236" c2="236" c3="236" c4="255"/>
<Entry c1="229" c2="229" c3="229" c4="255"/>
</ColorTable>
</VRTRasterBand>
</VRTDataset>
\endverbatim
\if man
\section rgb2pct_author AUTHOR
Frank Warmerdam <warmerdam@pobox.com>
\endif
*/
*******************************************************************************
/*! \page pct2rgb pct2rgb.py
Convert an 8bit paletted image to 24bit RGB
\section pct2rgb_synopsis SYNOPSIS
\htmlonly
Usage:
\endhtmlonly
\verbatim
pct2rgb.py [-of format] [-b band] [-rgba] source_file dest_file
\endverbatim
\section pct2rgb_description DESCRIPTION
This utility will convert a pseudocolor band on the input file into an output
RGB file of the desired format.
<dl>
<dt> <b>-of</b> <i>format</i>:</dt><dd> Format to generated (defaults to GeoTIFF).</dd>
<dt> <b>-b</b> <i>band</i>:</dt><dd>
Band to convert to RGB, defaults to 1.</dd>
<dt> <b>-rgba:</b></dt><dd> Generate a RGBA file (instead of a RGB file by default).</dd>
<dt> <i>source_file</i>:</dt><dd> The input file. </dd>
<dt> <i>dest_file</i>:</dt><dd> The output RGB file that will be
created.</dd>
</dl>
NOTE: pct2rgb.py is a Python script, and will only work if GDAL was built
with Python support.
The new '-expand rgb|rgba' option of gdal_translate obsoletes that utility.
\if man
\section pct2rgb_author AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de>
\endif
*/
*******************************************************************************
/*! \page gdaltransform gdaltransform
transforms coordinates
\section gdaltransform_synopsis SYNOPSIS
\verbatim
gdaltransform [--help-general]
[-i] [-s_srs srs_def] [-t_srs srs_def] [-to "NAME=VALUE"]
[-order n] [-tps] [-rpc] [-geoloc]
[-gcp pixel line easting northing [elevation]]*
[srcfile [dstfile]]
\endverbatim
\section gdaltransform_description DESCRIPTION
The gdaltransform utility reprojects a list of coordinates into any supported
projection,including GCP-based transformations.
<dl>
<dt> <b>-s_srs</b> <em>srs def</em>:</dt><dd> source spatial reference set.
The coordinate systems that can be passed are anything supported by the
OGRSpatialReference.SetFromUserInput() call, which includes EPSG PCS and GCSes
(ie. EPSG:4296), PROJ.4 declarations (as above), or the name of a .prf file
containing well known text.</dd>
<dt> <b>-t_srs</b> <em>srs_def</em>:</dt><dd> target spatial reference set.
The coordinate systems that can be passed are anything supported by the
OGRSpatialReference.SetFromUserInput() call, which includes EPSG PCS and GCSes
(ie. EPSG:4296), PROJ.4 declarations (as above), or the name of a .prf file
containing well known text.</dd>
<dt> <b>-to</b> <em>NAME=VALUE</em>:</dt><dd> set a transformer option suitable
to pass to GDALCreateGenImgProjTransformer2(). </dd>
<dt> <b>-order</b> <em>n</em>:</dt><dd> order of polynomial used for warping
(1 to 3). The default is to select a polynomial order based on the number of
GCPs.</dd>
<dt> <b>-tps</b>:</dt><dd>Force use of thin plate spline transformer based on
available GCPs.</dd>
<dt> <b>-rpc</b>:</dt> <dd>Force use of RPCs.</dd>
<dt> <b>-geoloc</b>:</dt><dd>Force use of Geolocation Arrays.</dd>
<dt> <b>-i</b></dt><dd>Inverse transformation: from destination to source.</dd>
<dt> <b>-gcp</b><em>pixel line easting northing [elevation]</em>:</dt> <dd>Provide a GCP to be used for transformation (generally three or more are required)</dd>
<dt> <em>srcfile</em>:</dt><dd> File with source projection definition or GCP's. If
not given, source projection is read from the command-line -s_srs or -gcp parameters </dd>
<dt> <em>dstfile</em>:</dt><dd> File with destination projection definition. </dd>
</dl>
Coordinates are read as pairs (or triples) of numbers per line from standard
input, transformed, and written out to standard output in the same way. All
transformations offered by gdalwarp are handled, including gcp-based ones.
Note that input and output must always be in decimal form. There is currently
no support for DMS input or output.
If an input image file is provided, input is in pixel/line coordinates on that
image. If an output file is provided, output is in pixel/line coordinates
on that image.
\section gdaltransform_example Reprojection Example
Simple reprojection from one projected coordinate system to another:
\verbatim
gdaltransform -s_srs EPSG:28992 -t_srs EPSG:31370
177502 311865
\endverbatim
Produces the following output in meters in the "Belge 1972 / Belgian Lambert
72" projection:
\verbatim
244510.77404604 166154.532871342 -1046.79270555763
\endverbatim
\section gdaltransform_example Image RPC Example
The following command requests an RPC based transformation using the RPC
model associated with the named file. Because the -i (inverse) flag is
used, the transformation is from output georeferenced (WGS84) coordinates
back to image coordinates.
\verbatim
gdaltransform -i -rpc 06OCT20025052-P2AS-005553965230_01_P001.TIF
125.67206 39.85307 50
\endverbatim
Produces this output measured in pixels and lines on the image:
\verbatim
3499.49282422381 2910.83892848414 50
\endverbatim
\if man
\section gdaltransform_author AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Jan Hartmann <j.l.h.hartmann@uva.nl>
\endif
*/
*******************************************************************************
/*! \page nearblack nearblack
convert nearly black/white borders to black
\section nearblack_synopsis SYNOPSIS
\verbatim
nearblack [-of format] [-white | [-color c1,c2,c3...cn]*] [-near dist] [-nb non_black_pixels]
[-setalpha] [-setmask] [-o outfile] [-q] [-co "NAME=VALUE"]* infile
\endverbatim
\section nearblack_description DESCRIPTION
This utility will scan an image and try to set all pixels that are nearly or exactly
black, white or one or more custom colors around the collar to black or white. This
is often used to "fix up" lossy compressed airphotos so that color pixels
can be treated as transparent when mosaicking.
<dl>
<dt> <b>-o</b> <i>outfile</i>:</dt><dd> The name of the output file to be
created. Newly created files are created with the HFA driver by default
(Erdas Imagine - .img)</dd>
<dt> <b>-of</b> <i>format</i>:</dt><dd> (GDAL 1.8.0 or later) Select the output format.
Use the short format name (GTiff for GeoTIFF for examle).</dd>
<dt> <b>-co</b> <i>"NAME=VALUE"</i>:</dt><dd> (GDAL 1.8.0 or later) Passes a creation option to the
output format driver. Multiple <b>-co</b> options may be listed. See format
specific documentation for legal creation options for each format. Only valid when creating a new file</dd>
<dt> <b>-white</b>:</dt><dd>
Search for nearly white (255) pixels instead of nearly black pixels.
</dd>
<dt> <b>-color</b> <i>c1,c2,c3...cn</i>:</dt><dd> (GDAL >= 1.9.0)
Search for pixels near the specified color. May be specified multiple times.
When -color is specified, the pixels that are considered as the collar are set to 0.
</dd>
<dt> <b>-near</b> <i>dist</i>:</dt><dd>
Select how far from black, white or custom colors the pixel values can be and still considered near black, white or custom color. Defaults to 15.
</dd>
<dt> <b>-nb</b> <i>non_black_pixels</i>:</dt><dd>
number of non-black pixels that can be encountered before the giving up search inwards. Defaults to 2.
</dd>
<dt> <b>-setalpha</b>:</dt><dd> (GDAL 1.8.0 or later)
Adds an alpha band if the output file is specified and the input file has 3 bands,
or sets the alpha band of the output file if it is specified and the input file has 4 bands,
or sets the alpha band of the input file if it has 4 bands and no output file is specified.
The alpha band is set to 0 in the image collar and to 255 elsewhere.
</dd>
<dt> <b>-setmask</b>:</dt><dd> (GDAL 1.8.0 or later)
Adds a mask band to the output file,
or adds a mask band to the input file if it does not already have one and no output file is specified.
The mask band is set to 0 in the image collar and to 255 elsewhere.
</dd>
<dt> <b>-q</b>:</dt><dd> (GDAL 1.8.0 or later) Suppress progress monitor and other non-error
output.</dd>
<dt> <i>infile</i>:</dt><dd>
The input file. Any GDAL supported format, any number of bands, normally 8bit
Byte bands.
</dd>
</dl>
The algorithm processes the image one scanline at a time. A scan "in" is done
from either end setting pixels to black or white until at least
"non_black_pixels" pixels that are more than "dist" gray levels away from
black, white or custom colors have been encountered at which point the scan stops. The nearly
black, white or custom color pixels are set to black or white. The algorithm also scans from
top to bottom and from bottom to top to identify indentations in the top or bottom.
The processing is all done in 8bit (Bytes).
If the output file is omitted, the processed results will be written back
to the input file - which must support update.
\if man
\section nearblack_author AUTHORS
Frank Warmerdam <warmerdam@pobox.com>
\endif
*/
*******************************************************************************
/*! \page gdal_merge gdal_merge.py
mosaics a set of images
\section gdal_merge_synopsis SYNOPSIS
\verbatim
gdal_merge.py [-o out_filename] [-of out_format] [-co NAME=VALUE]*
[-ps pixelsize_x pixelsize_y] [-tap] [-separate] [-v] [-pct]
[-ul_lr ulx uly lrx lry] [-n nodata_value] [-init "value [value...]"]
[-ot datatype] [-createonly] input_files
\endverbatim
\section gdal_merge_description DESCRIPTION
This utility will automatically mosaic a set of images. All the images must
be in the same coordinate system and have a matching number of bands, but
they may be overlapping, and at different resolutions. In areas of overlap,
the last image will be copied over earlier ones.
<dl>
<dt> <b>-o</b> <i>out_filename</i>:</dt><dd> The name of the output file,
which will be created if it does not already exist (defaults to "out.tif").</dd>
<dt> <b>-of</b> <i>format</i>:</dt><dd>
Output format, defaults to GeoTIFF (GTiff).
</dd>
<dt> <b>-co</b> <i>NAME=VALUE</i>:</dt><dd>
Creation option for output file. Multiple options can be specified.
</dd>
<dt> <b>-ot</b> <i>datatype</i>:</dt><dd>
Force the output image bands to have a specific type. Use type names (ie. Byte, Int16,...)
</dd>
<dt> <b>-ps</b> <i>pixelsize_x pixelsize_y</i>:</dt><dd> Pixel size to be used for the
output file. If not specified the resolution of the first input file will
be used.</dd>
<dt> <b>-tap</b>:</dt><dd> (GDAL >= 1.8.0) (target aligned pixels) align
the coordinates of the extent of the output file to the values of the -tr,
such that the aligned extent includes the minimum extent.</dd>
<dt> <b>-ul_lr</b> <i>ulx uly lrx lry</i>:</dt><dd> The extents of the output file.
If not specified the aggregate extents of all input files will be
used.</dd>
<dt>
<dt> <b>-v</b>:</dt><dd> Generate verbose output of mosaicing operations as they are done.</dd>
<dt> <b>-separate</b>:</dt><dd>
Place each input file into a separate <i>stacked</i> band.
</dd>
<dt> <b>-pct</b>:</dt><dd>
Grab a pseudocolor table from the first input image, and use it for the output.
Merging pseudocolored images this way assumes that all input files use the same
color table.
</dd>
<dt> <b>-n</b> <i>nodata_value</i>:</dt><dd>
Ignore pixels from files being merged in with this pixel value.
</dd>
<dt> <b>-a_nodata</b> <i>output_nodata_value</i>:</dt><dd>
(GDAL >= 1.9.0) Assign a specified nodata value to output bands.</dd>
<dt> <b>-init</b> <i>"value(s)"</i>:</dt><dd>
Pre-initialize the output image bands with these values. However, it is not
marked as the nodata value in the output file. If only one value is given, the
same value is used in all the bands.
</dd>
<dt> <b>-createonly</b>:</dt><dd>
The output file is created (and potentially pre-initialized) but no input
image data is copied into it.
</dd>
</dl>
NOTE: gdal_merge.py is a Python script, and will only work if GDAL was built
with Python support.
\section gdal_merge_example EXAMPLE
Create an image with the pixels in all bands initialized to 255.
\verbatim
% gdal_merge.py -init 255 -o out.tif in1.tif in2.tif
\endverbatim
Create an RGB image that shows blue in pixels with no data. The first two bands
will be initialized to 0 and the third band will be initialized to 255.
\verbatim
% gdal_merge.py -init "0 0 255" -o out.tif in1.tif in2.tif
\endverbatim
\if man
\section gdal_merge_author AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Silke Reimer <silke@intevation.de>
\endif
*/
*******************************************************************************
/*! \page gdal2tiles gdal2tiles.py
generates directory with TMS tiles, KMLs and simple web viewers
\section gdal2tiles_synopsis SYNOPSIS
\verbatim
gdal2tiles.py [-p profile] [-r resampling] [-s srs] [-z zoom]
[-e] [-a nodata] [-v] [-h] [-k] [-n] [-u url]
[-w webviewer] [-t title] [-c copyright]
[-g googlekey] [-b bingkey] input_file [output_dir]
\endverbatim
\section gdal2tiles_description DESCRIPTION
This utility generates a directory with small tiles and metadata, following
the OSGeo Tile Map Service Specification. Simple web pages with viewers based on
Google Maps and OpenLayers are generated as well - so anybody can comfortably
explore your maps on-line and you do not need to install or configure any
special software (like MapServer) and the map displays very fast in the
web browser. You only need to upload the generated directory onto a web server.
GDAL2Tiles also creates the necessary metadata for Google Earth (KML
SuperOverlay), in case the supplied map uses EPSG:4326 projection.
World files and embedded georeferencing is used during tile generation, but you
can publish a picture without proper georeferencing too.
<dl>
<dt> <b>-p</b> <i>PROFILE</i>, --profile=<i>PROFILE</i>:</dt>
<dd>Tile cutting profile (mercator,geodetic,raster) - default 'mercator' (Google Maps compatible).</dd>
<dt> <b>-r</b> <i>RESAMPLING</i>, --resampling=<i>RESAMPLING</i>:</dt>
<dd>Resampling method (average,near,bilinear,cubic,cubicspline,lanczos,antialias) - default 'average'.</dd>
<dt> <b>-s</b> <i>SRS</i>, --s_srs=<i>SRS</i>:</dt>
<dd>The spatial reference system used for the source input data.</dd>
<dt> <b>-z</b> <i>ZOOM</i>, --zoom=<i>ZOOM</i>:</dt>
<dd>Zoom levels to render (format:'2-5' or '10').</dd>
<dt> <b>-e</b>, --resume:</dt>
<dd>Resume mode. Generate only missing files.</dd>
<dt> <b>-a</b> <i>NODATA</i>, --srcnodata=<i>NODATA</i>:</dt>
<dd>NODATA transparency value to assign to the input data.</dd>
<dt> <b>-v, --verbose</b></dt>
<dd>Generate verbose output of tile generation.</dd>
<dt> <b>-h, --help</b></dt>
<dd>Show help message and exit.</dd>
<dt> <b>--version</b></dt>
<dd>Show program's version number and exit.</dd>
</dl>
<b>KML (Google Earth) options:</b>
Options for generated Google Earth SuperOverlay metadata
<dl>
<dt> <b>-k, --force-kml</b></dt>
<dd>Generate KML for Google Earth - default for 'geodetic' profile and 'raster' in EPSG:4326. For a dataset with different projection use with caution!</dd>
<dt> <b>-n, --no-kml</b>:</dt>
<dd>Avoid automatic generation of KML files for EPSG:4326.</dd>
<dt> <b>-u</b> <i>URL</i>, --url=<i>URL</i>:</dt>
<dd>URL address where the generated tiles are going to be published.</dd>
</dl>
<b>Web viewer options:</b>
Options for generated HTML viewers a la Google Maps
<dl>
<dt> <b>-w</b> <i>WEBVIEWER</i>, --webviewer=<i>WEBVIEWER</i>:</dt>
<dd>Web viewer to generate (all,google,openlayers,none) - default 'all'.</dd>
<dt> <b>-t</b> <i>TITLE</i>, --title=<i>TITLE</i>:</dt>
<dd>Title of the map.</dd>
<dt> <b>-c</b> <i>COPYRIGHT</i>, --copyright=<i>COPYRIGHT</i>:</dt>
<dd>Copyright for the map.</dd>
<dt> <b>-g</b> <i>GOOGLEKEY</i>, --googlekey=<i>GOOGLEKEY</i>:</dt>
<dd>Google Maps API key from http://code.google.com/apis/maps/signup.html.</dd>
<dt> <b>-b</b> <i>BINGKEY</i>, --bingkey=<i>BINGKEY</i>:</dt>
<dd>Bing Maps API key from https://www.bingmapsportal.com/</dd>
</dl>
NOTE: gdal2tiles.py is a Python script that needs to be run against "new generation" Python GDAL binding.
\if man
\section gdal2tiles_author AUTHORS
Klokan Petr Pridal <klokan@klokan.cz> as a Google SoC 2007 Project.
\endif
*/
*******************************************************************************
/*! \page gdal-config gdal-config
determines various information about a GDAL installation
\section gdal_config_synopsis SYNOPSIS
\verbatim
gdal-config [OPTIONS]
Options:
[--prefix[=DIR]]
[--libs]
[--cflags]
[--version]
[--ogr-enabled]
[--formats]
\endverbatim
\section gdal_config_description DESCRIPTION
This utility script (available on Unix systems) can be used to determine
various information about a GDAL installation. It is normally just used
by configure scripts for applications using GDAL but can be queried by an
end user.
<dl>
<dt> <b>--prefix</b>:</dt><dd> the top level directory for the GDAL
installation.</dd>
<dt> <b>--libs</b>:</dt><dd> The libraries and link directives required to
use GDAL.</dd>
<dt> <b>--cflags</b>:</dt><dd> The include and macro definition required to compiled
modules using GDAL.</dd>
<dt> <b>--version</b>:</dt><dd> Reports the GDAL version.</dd>
<dt> <b>--ogr-enabled</b>:</dt><dd> Reports "yes" or "no" to standard output depending
on whether OGR is built into GDAL.</dd>
<dt> <b>--formats</b>:</dt><dd> Reports which formats are configured into GDAL
to stdout.
</dd>
</dl>
*/
*******************************************************************************
/*! \page gdal_retile gdal_retile.py
gdal_retile.py retiles a set of tiles and/or build tiled pyramid levels
\if man
\section retile_synopsis SYNOPSIS
\endif
\htmlonly
Usage:
\endhtmlonly
\verbatim
gdal_retile.py [-v] [-co NAME=VALUE]* [-of out_format] [-ps pixelWidth pixelHeight]
[-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/
CInt16/CInt32/CFloat32/CFloat64}]'
[ -tileIndex tileIndexName [-tileIndexField tileIndexFieldName]]
[ -csv fileName [-csvDelim delimiter]]
[-s_srs srs_def] [-pyramidOnly]
[-r {near/bilinear/cubic/cubicspline/lanczos}]
-levels numberoflevels
[-useDirForEachRow]
-targetDir TileDirectory input_files
\endverbatim
\if man
\section retile_description DESCRIPTION
\endif
This utility will retile a set of input tile(s). All the input tile(s) must
be georeferenced in the same coordinate system and have a matching number of bands.
Optionally pyramid levels are generated. It is possible to generate shape file(s) for the tiled output.
If your number of input tiles exhausts the command line buffer, use the general --optfile option
<dl>
<dt> <b>-targetDir</b> <i>directory</i>:</dt><dd>
The directory where the tile result is created. Pyramids are stored
in subdirectories numbered from 1. Created tile names have a numbering
schema and contain the name of the source tiles(s)
</dd>
<dt> <b>-of</b> <i>format</i>:</dt><dd>
Output format, defaults to GeoTIFF (GTiff).
</dd>
<dt> <b>-co</b> <i>NAME=VALUE</i>:</dt><dd>
Creation option for output file. Multiple options can be specified.
</dd>
<dt> <b>-ot</b> <i>datatype</i>:</dt><dd>
Force the output image bands to have a specific type. Use type names (ie. Byte, Int16,...)
</dd>
<dt> <b>-ps</b> <i>pixelsize_x pixelsize_y</i>:</dt><dd> Pixel size to be used for the
output file. If not specified, 256 x 256 is the default
</dd>
<dt> <b>-levels</b> <i>numberOfLevels</i>:</dt><dd>
Number of pyramids levels to build.
</dd>
<dt> <b>-v</b>:</dt><dd>
Generate verbose output of tile operations as they are done.
</dd>
<dt> <b>-pyramidOnly</b>:</dt><dd>
No retiling, build only the pyramids
</dd>
<dt> <b>-r</b> <i>algorithm</i>:</dt><dd>
Resampling algorithm, default is near
</dd>
<dt> <b>-s_srs</b> <i>srs_def</i>:</dt><dd>
Source spatial reference to use. The coordinate systems that can be
passed are anything supported by the OGRSpatialReference.SetFro‐mUserInput() call,
which includes EPSG PCS and GCSes (ie.EPSG:4296), PROJ.4 declarations (as above),
or the name of a .prf file containing well known text.
If no srs_def is given, the srs_def of the source tiles is used (if there is any).
The srs_def will be propagated to created tiles (if possible) and to the optional
shape file(s)
</dd>
<dt> <b>-tileIndex</b> <i>tileIndexName</i>:</dt><dd>
The name of shape file containing the result tile(s) index
</dd>
<dt> <b>-tileIndexField</b> <i>tileIndexFieldName</i>:</dt><dd>
The name of the attribute containing the tile name
</dd>
<dt> <b>-csv</b> <i>csvFileName</i>:</dt><dd>
The name of the csv file containing the tile(s) georeferencing information.
The file contains 5 columns: tilename,minx,maxx,miny,maxy
</dd>
<dt> <b>-csvDelim</b> <i>column delimiter</i>:</dt><dd>
The column delimter used in the csv file, default value is a semicolon ";"
</dd>
<dt> <b>-useDirForEachRow</b>:</dt><dd>
Normally the tiles of the base image are stored as described in <b>-targetDir</b>.
For large images, some file systems have performance problems if the number of files
in a directory is to big, causing gdal_retile not to finish in reasonable time.
Using this parameter creates a different output structure. The tiles of the base image
are stored in a subdirectory called 0, the pyramids in subdirectories numbered 1,2,....
Within each of these directories another level of subdirectories is created, numbered from
0...n, depending of how many tile rows are needed for each level. Finally, a directory contains
only the the tiles for one row for a specific level. For large images a performance improvement
of a factor N could be achieved.
</dd>
</dl>
NOTE: gdal_retile.py is a Python script, and will only work if GDAL was built
with Python support.
\if man
\section retile_author AUTHORS
Christian Mueller <christian.mueller@nvoe.at>
\endif
*/
*******************************************************************************
/*! \page gdal_grid gdal_grid
creates regular grid from the scattered data
\section gdal_grid_synopsis SYNOPSIS
\verbatim
gdal_grid [-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/
CInt16/CInt32/CFloat32/CFloat64}]
[-of format] [-co "NAME=VALUE"]
[-zfield field_name]
[-a_srs srs_def] [-spat xmin ymin xmax ymax]
[-clipsrc <xmin ymin xmax ymax>|WKT|datasource|spat_extent]
[-clipsrcsql sql_statement] [-clipsrclayer layer]
[-clipsrcwhere expression]
[-l layername]* [-where expression] [-sql select_statement]
[-txe xmin xmax] [-tye ymin ymax] [-outsize xsize ysize]
[-a algorithm[:parameter1=value1]*] [-q]
<src_datasource> <dst_filename>
\endverbatim
\section gdal_grid_description DESCRIPTION
This program creates regular grid (raster) from the scattered data read from
the OGR datasource. Input data will be interpolated to fill grid nodes with
values, you can choose from various interpolation methods.
Starting with GDAL 1.10, it is possible to set the <b>GDAL_NUM_THREADS</b>
configuration option to parallelize the processing. The value to specify is
the number of worker threads, or <i>ALL_CPUS</i> to use all the cores/CPUs of the
computer.
<dl>
<dt> <b>-ot</b> <i>type</i>:</dt><dd> For the output bands to be of the
indicated data type.</dd>
<dt> <b>-of</b> <i>format</i>:</dt><dd> Select the output format. The default
is GeoTIFF (GTiff). Use the short format name.</dd>
<dt> <b>-txe</b> <em>xmin xmax</em>:</dt><dd> Set georeferenced
X extents of output file to be created.</dd>
<dt> <b>-tye</b> <em>ymin ymax</em>:</dt><dd> Set georeferenced
Y extents of output file to be created.</dd>
<dt> <b>-outsize</b> <i>xsize ysize</i>:</dt><dd> Set the size of the
output file in pixels and lines.</dd>
<dt> <b>-a_srs</b> <i>srs_def</i>:</dt><dd> Override the projection for the
output file. The <i>srs_def</i> may be any of the usual GDAL/OGR forms,
complete WKT, PROJ.4, EPSG:n or a file containing the WKT. </dd>
<dt> <b>-zfield</b> <i>field_name</i>:</dt><dd> Identifies an attribute field
on the features to be used to get a Z value from. This value overrides Z value
read from feature geometry record (naturally, if you have a Z value in
geometry, otherwise you have no choice and should specify a field name
containing Z value).</dd>
<dt> <b>-a</b> <i>[algorithm[:parameter1=value1][:parameter2=value2]...]</i>:
</dt><dd> Set the interpolation algorithm or data metric name and (optionally)
its parameters. See \ref gdal_grid_algorithms and \ref gdal_grid_metrics
sections for further discussion of available options.</dd>
<dt> <b>-spat</b> <i>xmin ymin xmax ymax</i>:</dt><dd> Adds a spatial filter
to select only features contained within the bounding box described by
(xmin, ymin) - (xmax, ymax).</dd>
<dt> <b>-clipsrc</b><em> [xmin ymin xmax ymax]|WKT|datasource|spat_extent</em>:
</dt><dd> Adds a spatial filter to select only features contained within the
specified bounding box (expressed in source SRS), WKT geometry (POLYGON or
MULTIPOLYGON), from a datasource or to the spatial extent of the <b>-spat</b>
option if you use the <em>spat_extent</em> keyword. When specifying a
datasource, you will generally want to use it in combination of the
<b>-clipsrclayer</b>, <b>-clipsrcwhere</b> or <b>-clipsrcsql</b>
options.</dd>
<dt> <b>-clipsrcsql</b> <em>sql_statement</em>:</dt><dd>Select desired
geometries using an SQL query instead.</dd>
<dt> <b>-clipsrclayer</b> <em>layername</em>:</dt><dd>Select the named layer
from the source clip datasource.</dd>
<dt> <b>-clipsrcwhere</b> <em>expression</em>:</dt><dd>Restrict desired
geometries based on attribute query.</dd>
<dt> <b>-l</b> <em>layername</em>: </dt><dd> Indicates the layer(s) from the
datasource that will be used for input features. May be specified multiple
times, but at least one layer name or a <b>-sql</b> option must be
specified.</dd>
<dt> <b>-where</b> <em>expression</em>: </dt><dd>
An optional SQL WHERE style query expression to be applied to select features
to process from the input layer(s). </dd>
<dt> <b>-sql</b> <em>select_statement</em>: </dt><dd>
An SQL statement to be evaluated against the datasource to produce a
virtual layer of features to be processed.</dd>
<dt> <b>-co</b> <i>"NAME=VALUE"</i>:</dt><dd> Passes a creation option to the
output format driver. Multiple <b>-co</b> options may be listed. See format
specific documentation for legal creation options for each format.</dd>
<dt> <b>-q</b>:</dt><dd> Suppress progress monitor and other non-error
output.</dd>
<dt> <em>src_datasource</em>: </dt><dd>
Any OGR supported readable datasource.</dd>
<dt> <em>dst_filename</em>: </dt><dd>
The GDAL supported output file.</dd>
</dl>
\section gdal_grid_algorithms INTERPOLATION ALGORITHMS
There are number of interpolation algorithms to choose from.
\subsection gdal_grid_algorithms_invdist invdist
Inverse distance to a power. This is default algorithm. It has following
parameters:
<dl>
<dt><i>power</i>:</dt> <dd>Weighting power (default 2.0).</dd>
<dt><i>smoothing</i>:</dt> <dd>Smoothing parameter (default 0.0).</dd>
<dt><i>radius1</i>:</dt> <dd>The first radius (X axis if rotation angle is 0)
of search ellipse. Set this parameter to zero to use whole point array.
Default is 0.0.</dd>
<dt><i>radius2</i>:</dt> <dd>The second radius (Y axis if rotation angle is 0)
of search ellipse. Set this parameter to zero to use whole point array.
Default is 0.0.</dd>
<dt><i>angle</i>:</dt> <dd>Angle of search ellipse rotation in degrees
(counter clockwise, default 0.0).</dd>
<dt><i>max_points</i>:</dt> <dd>Maximum number of data points to use. Do not
search for more points than this number. This is only used if search ellipse
is set (both radii are non-zero). Zero means that all found points should
be used. Default is 0.</dd>
<dt><i>min_points</i>:</dt> <dd>Minimum number of data points to use. If less
amount of points found the grid node considered empty and will be filled with
NODATA marker. This is only used if search ellipse is set (both radii are
non-zero). Default is 0.</dd>
<dt><i>nodata</i>:</dt> <dd>NODATA marker to fill empty points (default
0.0).</dd>
</dl>
\subsection gdal_grid_algorithms_average average
Moving average algorithm. It has following parameters:
<dl>
<dt><i>radius1</i>:</dt> <dd>The first radius (X axis if rotation angle is 0)
of search ellipse. Set this parameter to zero to use whole point array.
Default is 0.0.</dd>
<dt><i>radius2</i>:</dt> <dd>The second radius (Y axis if rotation angle is 0)
of search ellipse. Set this parameter to zero to use whole point array.
Default is 0.0.</dd>
<dt><i>angle</i>:</dt> <dd>Angle of search ellipse rotation in degrees
(counter clockwise, default 0.0).</dd>
<dt><i>min_points</i>:</dt> <dd>Minimum number of data points to use. If less
amount of points found the grid node considered empty and will be filled with
NODATA marker. Default is 0.</dd>
<dt><i>nodata</i>:</dt> <dd>NODATA marker to fill empty points (default
0.0).</dd>
</dl>
Note, that it is essential to set search ellipse for moving average method. It
is a window that will be averaged when computing grid nodes values.
\subsection gdal_grid_algorithms_nearest nearest
Nearest neighbor algorithm. It has following parameters:
<dl>
<dt><i>radius1</i>:</dt> <dd>The first radius (X axis if rotation angle is 0)
of search ellipse. Set this parameter to zero to use whole point array.
Default is 0.0.</dd>
<dt><i>radius2</i>:</dt> <dd>The second radius (Y axis if rotation angle is 0)
of search ellipse. Set this parameter to zero to use whole point array.
Default is 0.0.</dd>
<dt><i>angle</i>:</dt> <dd>Angle of search ellipse rotation in degrees
(counter clockwise, default 0.0).</dd>
<dt><i>nodata</i>:</dt> <dd>NODATA marker to fill empty points (default
0.0).</dd>
</dl>
\section gdal_grid_metrics DATA METRICS
Besides the interpolation functionality \ref gdal_grid can be used to compute
some data metrics using the specified window and output grid geometry. These
metrics are:
<dl>
<dt><i>minimum</i>:</dt> <dd>Minimum value found in grid node search
ellipse.</dd>
<dt><i>maximum</i>:</dt> <dd>Maximum value found in grid node search
ellipse.</dd>
<dt><i>range</i>:</dt> <dd>A difference between the minimum and maximum values
found in grid node search ellipse.</dd>
<dt><i>count</i>:</dt> <dd> A number of data points found in grid node search
ellipse.</dd>
<dt><i>average_distance</i>:</dt> <dd>An average distance between the grid
node (center of the search ellipse) and all of the data points found in grid
node search ellipse.</dd>
<dt><i>average_distance_pts</i>:</dt> <dd>An average distance between the data
points found in grid node search ellipse. The distance between each pair of
points within ellipse is calculated and average of all distances is set as a
grid node value.</dd>
</dl>
All the metrics have the same set of options:
<dl>
<dt><i>radius1</i>:</dt> <dd>The first radius (X axis if rotation angle is 0)
of search ellipse. Set this parameter to zero to use whole point array.
Default is 0.0.</dd>
<dt><i>radius2</i>:</dt> <dd>The second radius (Y axis if rotation angle is 0)
of search ellipse. Set this parameter to zero to use whole point array.
Default is 0.0.</dd>
<dt><i>angle</i>:</dt> <dd>Angle of search ellipse rotation in degrees
(counter clockwise, default 0.0).</dd>
<dt><i>min_points</i>:</dt> <dd>Minimum number of data points to use. If less
amount of points found the grid node considered empty and will be filled with
NODATA marker. This is only used if search ellipse is set (both radii are
non-zero). Default is 0.</dd>
<dt><i>nodata</i>:</dt> <dd>NODATA marker to fill empty points (default
0.0).</dd>
</dl>
\section gdal_grid_csv READING COMMA SEPARATED VALUES
Often you have a text file with a list of comma separated XYZ values to work
with (so called CSV file). You can easily use that kind of data source in \ref
gdal_grid. All you need is create a virtual dataset header (VRT) for you CSV
file and use it as input datasource for \ref gdal_grid. You can find details
on VRT format at <a href="ogr/drv_vrt.html">Virtual Format</a> description
page.
Here is a small example. Let we have a CSV file called <i>dem.csv</i>
containing
\verbatim
Easting,Northing,Elevation
86943.4,891957,139.13
87124.3,892075,135.01
86962.4,892321,182.04
87077.6,891995,135.01
...
\endverbatim
For above data we will create <i>dem.vrt</i> header with the following
content:
\verbatim
<OGRVRTDataSource>
<OGRVRTLayer name="dem">
<SrcDataSource>dem.csv</SrcDataSource>
<GeometryType>wkbPoint</GeometryType>
<GeometryField encoding="PointFromColumns" x="Easting" y="Northing" z="Elevation"/>
</OGRVRTLayer>
</OGRVRTDataSource>
\endverbatim
This description specifies so called 2.5D geometry with three coordinates X, Y
and Z. Z value will be used for interpolation. Now you can use <i>dem.vrt</i>
with all OGR programs (start with \ref ogrinfo to test that everything works
fine). The datasource will contain single layer called <i>"dem"</i> filled
with point features constructed from values in CSV file. Using this technique
you can handle CSV files with more than three columns, switch columns, etc.
If your CSV file does not contain column headers then it can be handled in the
following way:
\verbatim
<GeometryField encoding="PointFromColumns" x="field_1" y="field_2" z="field_3"/>
\endverbatim
<a href="ogr/drv_csv.html">Comma Separated Value</a> description page contains
details on CSV format supported by GDAL/OGR.
\section gdal_grid_example EXAMPLE
The following would create raster TIFF file from VRT datasource described in
\ref gdal_grid_csv section using the inverse distance to a power method.
Values to interpolate will be read from Z value of geometry record.
\verbatim
gdal_grid -a invdist:power=2.0:smoothing=1.0 -txe 85000 89000 -tye 894000 890000 -outsize 400 400 -of GTiff -ot Float64 -l dem dem.vrt dem.tiff
\endverbatim
The next command does the same thing as the previous one, but reads values to
interpolate from the attribute field specified with <b>-zfield</b> option
instead of geometry record. So in this case X and Y coordinates are being
taken from geometry and Z is being taken from the <i>"Elevation"</i> field.
The GDAL_NUM_THREADS is also set to parallelize the computation.
\verbatim
gdal_grid -zfield "Elevation" -a invdist:power=2.0:smoothing=1.0 -txe 85000 89000 -tye 894000 890000 -outsize 400 400 -of GTiff -ot Float64 -l dem dem.vrt dem.tiff --config GDAL_NUM_THREADS ALL_CPUS
\endverbatim
\if man
\section gdal_grid_author AUTHORS
Andrey Kiselev <dron@ak4719.spb.edu>
\endif
*/
*******************************************************************************
/*! \page gdaldem gdaldem
Tools to analyze and visualize DEMs. (since GDAL 1.7.0)
\section gdaldem_synopsis SYNOPSIS
\htmlonly
Usage:
\endhtmlonly
\verbatim
- To generate a shaded relief map from any GDAL-supported elevation raster :
gdaldem hillshade input_dem output_hillshade
[-z ZFactor (default=1)] [-s scale* (default=1)]"
[-az Azimuth (default=315)] [-alt Altitude (default=45)]
[-alg ZevenbergenThorne] [-combined]
[-compute_edges] [-b Band (default=1)] [-of format] [-co "NAME=VALUE"]* [-q]
- To generate a slope map from any GDAL-supported elevation raster :
gdaldem slope input_dem output_slope_map"
[-p use percent slope (default=degrees)] [-s scale* (default=1)]
[-alg ZevenbergenThorne]
[-compute_edges] [-b Band (default=1)] [-of format] [-co "NAME=VALUE"]* [-q]
- To generate an aspect map from any GDAL-supported elevation raster
Outputs a 32-bit float raster with pixel values from 0-360 indicating azimuth :
gdaldem aspect input_dem output_aspect_map"
[-trigonometric] [-zero_for_flat]
[-alg ZevenbergenThorne]
[-compute_edges] [-b Band (default=1)] [-of format] [-co "NAME=VALUE"]* [-q]
- To generate a color relief map from any GDAL-supported elevation raster
gdaldem color-relief input_dem color_text_file output_color_relief_map
[-alpha] [-exact_color_entry | -nearest_color_entry]
[-b Band (default=1)] [-of format] [-co "NAME=VALUE"]* [-q]
where color_text_file contains lines of the format "elevation_value red green blue"
- To generate a Terrain Ruggedness Index (TRI) map from any GDAL-supported elevation raster:
gdaldem TRI input_dem output_TRI_map
[-compute_edges] [-b Band (default=1)] [-of format] [-q]
- To generate a Topographic Position Index (TPI) map from any GDAL-supported elevation raster:
gdaldem TPI input_dem output_TPI_map
[-compute_edges] [-b Band (default=1)] [-of format] [-q]
- To generate a roughness map from any GDAL-supported elevation raster:
gdaldem roughness input_dem output_roughness_map
[-compute_edges] [-b Band (default=1)] [-of format] [-q]
Notes :
Scale is the ratio of vertical units to horizontal
for Feet:Latlong use scale=370400, for Meters:LatLong use scale=111120)
\endverbatim
\if man
\section gdaldem_description DESCRIPTION
\endif
This utility has 7 different modes :
<dl>
<dt>\ref gdaldem_hillshade</dt><dd>to generate a shaded relief map from any GDAL-supported elevation raster</dd>
<dt>\ref gdaldem_slope</dt><dd>to generate a slope map from any GDAL-supported elevation raster</dd>
<dt>\ref gdaldem_aspect</dt><dd>to generate an aspect map from any GDAL-supported elevation raster</dd>
<dt>\ref gdaldem_color_relief</dt><dd>to generate a color relief map from any GDAL-supported elevation raster</dd>
<dt>\ref gdaldem_TRI</dt><dd>to generate a map of Terrain Ruggedness Index from any GDAL-supported elevation raster</dd>
<dt>\ref gdaldem_TPI</dt><dd>to generate a map of Topographic Position Index from any GDAL-supported elevation raster</dd>
<dt>\ref gdaldem_roughness</dt><dd>to generate a map of roughness from any GDAL-supported elevation raster</dd>
</dl>
The following general options are available :
<dl>
<dt> <i>input_dem</i>:</dt><dd> The input DEM raster to be processed</dd>
<dt> <i>output_xxx_map</i>:</dt><dd> The output raster produced</dd>
<dt> <b>-of</b> <i>format</i>:</dt><dd> Select the output format. The default
is GeoTIFF (GTiff). Use the short format name.</dd>
<dt> <b>-compute_edges</b>:</dt><dd> (GDAL >= 1.8.0) Do the computation at raster edges and near nodata values</dd>
<dt> <b>-alg</b> <i>ZevenbergenThorne</i>:</dt><dd> (GDAL >= 1.8.0) Use Zevenbergen & Thorne formula, instead of Horn's formula, to compute slope & aspect. The litterature suggests Zevenbergen & Thorne to be more suited to smooth landscapes, whereas Horn's formula to perform better on rougher terrain.</dd>
<dt> <b>-b</b> <i>band</i>:</dt><dd> Select an input <i>band</i> to be processed. Bands are numbered from 1.</dd>
<dt> <b>-co</b> <i>"NAME=VALUE"</i>:</dt><dd> Passes a creation option to the
output format driver. Multiple <b>-co</b> options may be listed. See format
specific documentation for legal creation options for each format.</dd>
<dt> <b>-q</b>:</dt><dd> Suppress progress monitor and other non-error
output.</dd>
</dl>
For all algorithms, except color-relief, a nodata value in the target dataset will be emitted if
at least one pixel set to the nodata value is found in the 3x3 window centered around each source pixel.
The consequence is that there will be a 1-pixel border around each image set with nodata value.
From GDAL 1.8.0, if -compute_edges is specified, gdaldem will compute values at image edges
or if a nodata value is found in the 3x3 window, by interpolating missing values.
\section gdaldem_modes Modes
\subsection gdaldem_hillshade hillshade
This command outputs an 8-bit raster with a nice shaded relief effect.
It’s very useful for visualizing the terrain.
You can optionally specify the azimuth and altitude of the light source,
a vertical exaggeration factor and a scaling factor to account for differences between vertical and horizontal units.
The value 0 is used as the output nodata value.
The following specific options are available :
<dl>
<dt> <b>-z</b> <i>zFactor</i>:</dt><dd>vertical exaggeration used to pre-multiply the elevations</dd>
<dt> <b>-s</b> <i>scale</i>:</dt><dd>ratio of vertical units to horizontal. If the horizontal unit of the source DEM is degrees (e.g Lat/Long WGS84 projection), you can use scale=111120 if the vertical units are meters (or scale=370400 if they are in feet)</dd>
<dt> <b>-az</b> <i>azimuth</i>:</dt><dd>azimuth of the light, in degrees. 0 if it comes from the top of the raster, 90 from the east, ... The default value, 315, should rarely be changed as it is the value generally used to generate shaded maps.</dd>
<dt> <b>-alt</b> <i>altitude</i>:</dt><dd>altitude of the light, in degrees. 90 if the light comes from above the DEM, 0 if it is raking light.</dd>
<dt> <b>-combined</b> <i>combined shading</i>:</dt><dd>(starting with GDAL 1.10) a combination of slope and oblique shading.</dd>
</dl>
\subsection gdaldem_slope slope
This command will take a DEM raster and output a 32-bit float raster with slope values.
You have the option of specifying the type of slope value you want: degrees or percent slope.
In cases where the horizontal units differ from the vertical units, you can also supply a scaling factor.
The value -9999 is used as the output nodata value.
The following specific options are available :
<dl>
<dt> <b>-p</b> :</dt><dd>if specified, the slope will be expressed as percent slope. Otherwise, it is expressed as degrees</dd>
<dt> <b>-s</b> <i>scale</i>:</dt><dd>ratio of vertical units to horizontal. If the horizontal unit of the source DEM is degrees (e.g Lat/Long WGS84 projection), you can use scale=111120 if the vertical units are meters (or scale=370400 if they are in feet)</dd>
</dl>
\subsection gdaldem_aspect aspect
This command outputs a 32-bit float raster with values between 0° and 360° representing the azimuth that slopes are facing.
The definition of the azimuth is such that : 0° means that the slope is facing the North, 90° it's facing the East, 180° it's facing the South and
270° it's facing the West (provided that the top of your input raster is north oriented). The aspect value -9999 is used as the nodata value
to indicate undefined aspect in flat areas with slope=0.
The following specifics options are available :
<dl>
<dt> <b>-trigonometric</b>:</dt><dd> return trigonometric angle instead of azimuth. Thus 0° means East, 90° North, 180° West, 270° South</dd>
<dt> <b>-zero_for_flat</b>:</dt><dd> return 0 for flat areas with slope=0, instead of -9999</dd>
</dl>
By using those 2 options, the aspect returned by gdaldem aspect should be identical to the one of GRASS r.slope.aspect. Otherwise, it's identical
to the one of Matthew Perry's aspect.cpp utility.
\subsection gdaldem_color_relief color-relief
This command outputs a 3-band (RGB) or 4-band (RGBA) raster with values are computed from the elevation
and a text-based color configuration file, containing the association between various elevation
values and the corresponding wished color. By default, the colors between the given elevation values
are blended smoothly and the result is a nice colorized DEM. The -exact_color_entry or
-nearest_color_entry options can be used to avoid that linear interpolation for values that don't match an index
of the color configuration file.
The following specifics options are available :
<dl>
<dt> <i>color_text_file</i>:</dt><dd> text-based color configuration file</dd>
<dt> <b>-alpha</b> :</dt><dd>add an alpha channel to the output raster</dd>
<dt> <b>-exact_color_entry</b> :</dt><dd>use strict matching when searching in the color configuration file.
If none matching color entry is found, the "0,0,0,0" RGBA quadruplet will be used</dd>
<dt> <b>-nearest_color_entry</b> :</dt><dd></dd>use the RGBA quadruplet corresponding to the closest entry in the color configuration file.</dd>
</dl>
The color-relief mode is the only mode that supports VRT as output format. In that case, it will translate the color configuration file into appropriate LUT elements. Note that elevations specified as percentage will be translated as absolute values, which must be taken into account when the statistics of the source raster differ from the one that was used when building the VRT.
The text-based color configuration file generally contains 4 columns per line : the elevation value and the
corresponding Red, Green, Blue component (between 0 and 255).
The elevation value can be any floating point value, or the <i>nv</i> keyword for the nodata value..
The elevation can also be expressed as a percentage : 0% being the minimum value found in the raster, 100% the maximum value.
An extra column can be optionally added for the alpha component. If it is not specified, full opacity (255) is assumed.
Various field separators are accepted : comma, tabulation, spaces, ':'.
Common colors used by GRASS can also be specified by using their name, instead of the RGB triplet. The supported list is :
white, black, red, green, blue, yellow, magenta, cyan, aqua, grey/gray, orange, brown, purple/violet and indigo.
Since GDAL 1.8.0, GMT .cpt palette files are also supported (COLOR_MODEL = RGB only).
Note: the syntax of the color configuration file is derived from the one supported by GRASS r.colors utility.
ESRI HDR color table files (.clr) also match that syntax.
The alpha component and the support of tab and comma as separators are GDAL specific extensions.
For example :
\verbatim
3500 white
2500 235:220:175
50% 190 185 135
700 240 250 150
0 50 180 50
nv 0 0 0 0
\endverbatim
\subsection gdaldem_TRI TRI
This command outputs a single-band raster with values computed from the elevation.
TRI stands for Terrain Ruggedness Index, which is defined as the mean difference between a central pixel and its surrounding cells (see Wilson et al 2007, Marine Geodesy 30:3-35).
The value -9999 is used as the output nodata value.
There are no specific options.
\subsection gdaldem_TPI TPI
This command outputs a single-band raster with values computed from the elevation.
TPI stands for Topographic Position Index, which is defined as the difference between a central pixel and the mean of its surrounding cells (see Wilson et al 2007, Marine Geodesy 30:3-35).
The value -9999 is used as the output nodata value.
There are no specific options.
\subsection gdaldem_roughness roughness
This command outputs a single-band raster with values computed from the elevation.
Roughness is the largest inter-cell difference of a central pixel and its surrounding cell, as defined in Wilson et al (2007, Marine Geodesy 30:3-35).
The value -9999 is used as the output nodata value.
There are no specific options.
\section gdaldem_author AUTHORS
Matthew Perry <perrygeo@gmail.com>, Even Rouault <even.rouault@mines-paris.org>, Howard Butler <hobu.inc@gmail.com>, Chris Yesson <chris.yesson@ioz.ac.uk>
Derived from code by Michael Shapiro, Olga Waupotitsch, Marjorie Larson, Jim Westervelt :
U.S. Army CERL, 1993. GRASS 4.1 Reference Manual. U.S. Army Corps of Engineers,
Construction Engineering Research Laboratories, Champaign, Illinois, 1-425.
\section gdaldem_seealso See also
Documentation of related GRASS utilities :
http://grass.osgeo.org/grass64/manuals/html64_user/r.slope.aspect.html
http://grass.osgeo.org/grass64/manuals/html64_user/r.shaded.relief.html
http://grass.osgeo.org/grass64/manuals/html64_user/r.colors.html
*/
*******************************************************************************
/*! \page gdalsrsinfo gdalsrsinfo
lists info about a given SRS in number of formats (WKT, PROJ.4, etc.)
\section gdalsrsinfo_synopsis SYNOPSIS
\verbatim
Usage: gdalsrsinfo [options] srs_def
srs_def may be the filename of a dataset supported by GDAL/OGR from which to extract SRS information
OR any of the usual GDAL/OGR forms (complete WKT, PROJ.4, EPSG:n or a file containing the SRS)
Options:
[--help-general] [-h] Show help and exit
[-p] Pretty-print where applicable (e.g. WKT)
[-V] Validate SRS
[-o out_type] Output type { default, all, wkt_all, proj4,
wkt, wkt_simple, wkt_noct, wkt_esri,
mapinfo, xml }
\endverbatim
\section gdalsrsinfo_description DESCRIPTION
The gdalsrsinfo utility reports information about a given SRS from one of the following:
- The filename of a dataset supported by GDAL/OGR which contains SRS information
- Any of the usual GDAL/OGR forms (complete WKT, PROJ.4, EPSG:n or a file containing the SRS)
Output types:
- <b>default</b> proj4 and wkt (default option)
- <b>all</b> all options available
- <b>wkt_all</b> all wkt options available
- <b>proj4</b> PROJ.4 string
- <b>wkt</b> OGC WKT format (full)
- <b>wkt_simple</b> OGC WKT (simplified)
- <b>wkt_noct</b> OGC WKT (without OGC CT params)
- <b>wkt_esri</b> ESRI WKT format
- <b>mapinfo</b> Mapinfo style CoordSys format
- <b>xml</b> XML format (GML based)
\n
\section gdal_grid_example EXAMPLE
\verbatim
$ gdalsrsinfo "EPSG:4326"
PROJ.4 : '+proj=longlat +datum=WGS84 +no_defs '
OGC WKT :
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]]
\endverbatim
\n
\verbatim
$ gdalsrsinfo -o proj4 osr/data/lcc_esri.prj
'+proj=lcc +lat_1=34.33333333333334 +lat_2=36.16666666666666 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +datum=NAD83 +units=m +no_defs '
\endverbatim
\n
\verbatim
$ gdalsrsinfo -o proj4 landsat.tif
PROJ.4 : '+proj=utm +zone=19 +south +datum=WGS84 +units=m +no_defs '
\endverbatim
\n
\verbatim
$ gdalsrsinfo -o wkt -p "EPSG:32722"
PROJCS["WGS 84 / UTM zone 22S",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",-51],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",10000000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AXIS["Easting",EAST],
AXIS["Northing",NORTH],
AUTHORITY["EPSG","32722"]]
\endverbatim
\n
\verbatim
$ gdalsrsinfo -o wkt_all "EPSG:4618"
OGC WKT :
GEOGCS["SAD69",
DATUM["South_American_Datum_1969",
SPHEROID["GRS 1967 Modified",6378160,298.25,
AUTHORITY["EPSG","7050"]],
TOWGS84[-57,1,-41,0,0,0,0],
AUTHORITY["EPSG","6618"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4618"]]
OGC WKT (simple) :
GEOGCS["SAD69",
DATUM["South_American_Datum_1969",
SPHEROID["GRS 1967 Modified",6378160,298.25],
TOWGS84[-57,1,-41,0,0,0,0]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433]]
OGC WKT (no CT) :
GEOGCS["SAD69",
DATUM["South_American_Datum_1969",
SPHEROID["GRS 1967 Modified",6378160,298.25]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433]]
ESRI WKT :
GEOGCS["SAD69",
DATUM["D_South_American_1969",
SPHEROID["GRS_1967_Truncated",6378160,298.25]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]]
\endverbatim
\if man
\section gdalsrsinfo_author AUTHORS
Frank Warmerdam <warmerdam@pobox.com>, Etienne Tourigny <etourigny.dev-at-gmail-dot-com>
\endif
*/
*******************************************************************************
/*! \page gdalmanage gdalmanage
Identify, delete, rename and copy raster data files
\section gdalmanage_synopsis SYNOPSIS
\verbatim
Usage: gdalmanage mode [-r] [-u] [-f format]
datasetname [newdatasetname]
\endverbatim
\section gdalmanage_description DESCRIPTION
The gdalmanage program can perform various operations on raster data files, depending on the chosen <i>mode</i>. This includes identifying raster data types and deleting, renaming or copying the files.
<dl>
<dt> <i>mode</i>:</dt><dd>Mode of operation</dd>
<dl>
<dt> <b>identify</b> <i>datasetname</i>:</dt><dd>List data format of file.</dd>
<dt> <b>copy</b> <i>datasetname newdatasetname</i>:</dt><dd>Create a copy of the raster file with a new name.</dd>
<dt> <b>rename</b> <i>datasetname newdatasetname</i>:</dt><dd>Change the name of the raster file.</dd>
<dt> <b>delete</b> <i>datasetname</i>:</dt><dd>Delete raster file.</dd>
</dl>
<dt> <b>-r</b>:</dt><dd>Recursively scan files/folders for raster files.</dd>
<dt> <b>-u</b>:</dt><dd>Report failures if file type is unidentified.</dd>
<dt> <b>-f</b> <i>format</i>:</dt><dd>Specify format of raster file if unknown by the application. Uses short data format name (e.g. <i>GTiff</i>).</dd>
<dt> <i>datasetname</i>:</dt><dd>Raster file to operate on.</dd>
<dt> <i>newdatasetname</i>:</dt><dd>For copy and rename modes, you provide a <i>source</i> filename and a <i>target</i> filename, just like copy and move commands in an operating system.</dd>
</dl>
\section gdalmanage_exampes EXAMPLES
\subsection gdalmanage_example_identify Using identify mode
Report the data format of the raster file by using the <i>identify</i> mode and specifying a data file name:
\verbatim
$ gdalmanage identify NE1_50M_SR_W.tif
NE1_50M_SR_W.tif: GTiff
\endverbatim
Recursive mode will scan subfolders and report the data format:
\verbatim
$ gdalmanage identify -r 50m_raster/
NE1_50M_SR_W/ne1_50m.jpg: JPEG
NE1_50M_SR_W/ne1_50m.png: PNG
NE1_50M_SR_W/ne1_50m_20pct.tif: GTiff
NE1_50M_SR_W/ne1_50m_band1.tif: GTiff
NE1_50M_SR_W/ne1_50m_print.png: PNG
NE1_50M_SR_W/NE1_50M_SR_W.aux: HFA
NE1_50M_SR_W/NE1_50M_SR_W.tif: GTiff
NE1_50M_SR_W/ne1_50m_sub.tif: GTiff
NE1_50M_SR_W/ne1_50m_sub2.tif: GTiff
\endverbatim
\subsection gdalmanage_example_copy Using copy mode
Copy the raster data:
\verbatim
$ gdalmanage copy NE1_50M_SR_W.tif ne1_copy.tif
\endverbatim
\subsection gdalmanage_example_rename Using rename mode
Rename raster data:
\verbatim
$ gdalmanage rename NE1_50M_SR_W.tif ne1_rename.tif
\endverbatim
\subsection gdalmanage_example_delete Using delete mode
Delete the raster data:
\verbatim
gdalmanage delete NE1_50M_SR_W.tif
\endverbatim
\if man
\section gdalmanage_author AUTHORS
Tyler Mitchell <spatialguru@shaw.ca>
\endif
*/
|