1# SOME DESCRIPTIVE TITLE. 2# 3# Translators: 4# pibinko <pibinko@gmail.com>, 2014 5msgid "" 6msgstr "" 7"Project-Id-Version: PostGIS\n" 8"Report-Msgid-Bugs-To: http://bugs.kde.org\n" 9"POT-Creation-Date: 2018-08-19 21:47+0000\n" 10"PO-Revision-Date: 2015-09-29 12:24+0000\n" 11"Last-Translator: Sandro Santilli <strk@kbt.io>\n" 12"Language-Team: Italian (Italy) (http://www.transifex.com/postgis/postgis/" 13"language/it_IT/)\n" 14"Language: it_IT\n" 15"MIME-Version: 1.0\n" 16"Content-Type: text/plain; charset=UTF-8\n" 17"Content-Transfer-Encoding: 8bit\n" 18"Plural-Forms: nplurals=2; plural=(n != 1);\n" 19 20#. Tag: title 21#: reference_raster.xml:3 22#, no-c-format 23msgid "Raster Reference" 24msgstr "" 25 26#. Tag: para 27#: reference_raster.xml:5 28#, no-c-format 29msgid "" 30"The functions given below are the ones which a user of PostGIS Raster is " 31"likely to need and which are currently available in PostGIS Raster. There " 32"are other functions which are required support functions to the raster " 33"objects which are not of use to a general user." 34msgstr "" 35"Le funzioni riportate sotto sono quelle che un utente di PostGIS Raster si " 36"troverà a utilizzare più frequentemente e che sono disponibili in PostGIS " 37"Raster. Esistono altre funzioni che sono di supporto agli oggetti raster e " 38"che non servono a un utilizzo generale." 39 40#. Tag: para 41#: reference_raster.xml:9 42#, no-c-format 43msgid "" 44"<varname>raster</varname> is a new PostGIS type for storing and analyzing " 45"raster data." 46msgstr "" 47"Il tipo <varname>raster</varname> è un nuovo tipo di dati PostGIS per " 48"archiviare e analizzare dati raster." 49 50#. Tag: para 51#: reference_raster.xml:10 52#, no-c-format 53msgid "" 54"For loading rasters from raster files please refer to <xref linkend=" 55"\"RT_Loading_Rasters\"/>" 56msgstr "" 57 58#. Tag: para 59#: reference_raster.xml:12 60#, no-c-format 61msgid "" 62"For the examples in this reference we will be using a raster table of dummy " 63"rasters - Formed with the following code" 64msgstr "" 65 66#. Tag: programlisting 67#: reference_raster.xml:13 68#, fuzzy, no-c-format 69msgid "" 70"CREATE TABLE dummy_rast(rid integer, rast raster);\n" 71"INSERT INTO dummy_rast(rid, rast)\n" 72"VALUES (1,\n" 73"('01' -- little endian (uint8 ndr)\n" 74"||\n" 75"'0000' -- version (uint16 0)\n" 76"||\n" 77"'0000' -- nBands (uint16 0)\n" 78"||\n" 79"'0000000000000040' -- scaleX (float64 2)\n" 80"||\n" 81"'0000000000000840' -- scaleY (float64 3)\n" 82"||\n" 83"'000000000000E03F' -- ipX (float64 0.5)\n" 84"||\n" 85"'000000000000E03F' -- ipY (float64 0.5)\n" 86"||\n" 87"'0000000000000000' -- skewX (float64 0)\n" 88"||\n" 89"'0000000000000000' -- skewY (float64 0)\n" 90"||\n" 91"'00000000' -- SRID (int32 0)\n" 92"||\n" 93"'0A00' -- width (uint16 10)\n" 94"||\n" 95"'1400' -- height (uint16 20)\n" 96")::raster\n" 97"),\n" 98"-- Raster: 5 x 5 pixels, 3 bands, PT_8BUI pixel type, NODATA = 0\n" 99"(2, ('01000003009A9999999999A93F9A9999999999A9BF000000E02B274A' ||\n" 100"'41000000007719564100000000000000000000000000000000FFFFFFFF050005000400FDFEFDFEFEFDFEFEFDF9FAFEF' " 101"||\n" 102"'EFCF9FBFDFEFEFDFCFAFEFEFE04004E627AADD16076B4F9FE6370A9F5FE59637AB0E54F58617087040046566487A1506CA2E3FA5A6CAFFBFE4D566DA4CB3E454C5665')::" 103"raster);" 104msgstr "" 105"CREATE TABLE dummy_rast(rid integer, rast raster);\n" 106"INSERT INTO dummy_rast(rid, rast)\n" 107"VALUES (1,\n" 108"('01' -- little endian (uint8 ndr)\n" 109"|| \n" 110"'0000' -- version (uint16 0)\n" 111"||\n" 112"'0000' -- nBands (uint16 0)\n" 113"||\n" 114"'0000000000000040' -- scaleX (float64 2)\n" 115"||\n" 116"'0000000000000840' -- scaleY (float64 3)\n" 117"||\n" 118"'000000000000E03F' -- ipX (float64 0.5)\n" 119"||\n" 120"'000000000000E03F' -- ipY (float64 0.5)\n" 121"||\n" 122"'0000000000000000' -- skewX (float64 0)\n" 123"||\n" 124"'0000000000000000' -- skewY (float64 0)\n" 125"||\n" 126"'00000000' -- SRID (int32 0)\n" 127"||\n" 128"'0A00' -- width (uint16 10)\n" 129"||\n" 130"'1400' -- height (uint16 20)\n" 131")::raster\n" 132"),\n" 133"-- Raster: 5 x 5 pixels, 3 bands, PT_8BUI pixel type, NODATA = 0\n" 134"(2, ('01000003009A9999999999A93F9A9999999999A9BF000000E02B274A' ||\n" 135"'41000000007719564100000000000000000000000000000000FFFFFFFF050005000400FDFEFDFEFEFDFEFEFDF9FAFEF' " 136"||\n" 137"'EFCF9FBFDFEFEFDFCFAFEFEFE04004E627AADD16076B4F9FE6370A9F5FE59637AB0E54F58617087040046566487A1506CA2E3FA5A6CAFFBFE4D566DA4CB3E454C5665')::" 138"raster);" 139 140#. Tag: para 141#: reference_raster.xml:17 142#, no-c-format 143msgid "" 144"This section lists the PostgreSQL data types specifically created to support " 145"raster functionality." 146msgstr "" 147 148#. Tag: title 149#: reference_raster.xml:20 150#, no-c-format 151msgid "Raster Support Data types" 152msgstr "" 153 154#. Tag: refname 155#: reference_raster.xml:24 156#, no-c-format 157msgid "geomval" 158msgstr "geomval" 159 160#. Tag: refpurpose 161#: reference_raster.xml:25 162#, no-c-format 163msgid "" 164"A spatial datatype with two fields - geom (holding a geometry object) and " 165"val (holding a double precision pixel value from a raster band)." 166msgstr "" 167 168#. Tag: title 169#: reference_raster.xml:30 reference_raster.xml:49 reference_raster.xml:121 170#: reference_raster.xml:171 reference_raster.xml:211 reference_raster.xml:257 171#: reference_raster.xml:354 reference_raster.xml:536 reference_raster.xml:710 172#: reference_raster.xml:777 reference_raster.xml:846 reference_raster.xml:889 173#: reference_raster.xml:924 reference_raster.xml:961 reference_raster.xml:1004 174#: reference_raster.xml:1065 reference_raster.xml:1110 175#: reference_raster.xml:1225 reference_raster.xml:1434 176#: reference_raster.xml:1521 reference_raster.xml:1607 177#: reference_raster.xml:1664 reference_raster.xml:1731 178#: reference_raster.xml:1796 reference_raster.xml:1838 179#: reference_raster.xml:1888 reference_raster.xml:1927 180#: reference_raster.xml:1961 reference_raster.xml:1998 181#: reference_raster.xml:2041 reference_raster.xml:2076 182#: reference_raster.xml:2110 reference_raster.xml:2160 183#: reference_raster.xml:2214 reference_raster.xml:2251 184#: reference_raster.xml:2291 reference_raster.xml:2346 185#: reference_raster.xml:2401 reference_raster.xml:2447 186#: reference_raster.xml:2482 reference_raster.xml:2518 187#: reference_raster.xml:2554 reference_raster.xml:2589 188#: reference_raster.xml:2628 reference_raster.xml:2662 189#: reference_raster.xml:2696 reference_raster.xml:2740 190#: reference_raster.xml:2802 reference_raster.xml:2857 191#: reference_raster.xml:2903 reference_raster.xml:2965 192#: reference_raster.xml:3007 reference_raster.xml:3058 193#: reference_raster.xml:3093 reference_raster.xml:3129 194#: reference_raster.xml:3163 reference_raster.xml:3238 195#: reference_raster.xml:3281 reference_raster.xml:3327 196#: reference_raster.xml:3389 reference_raster.xml:3432 197#: reference_raster.xml:3487 reference_raster.xml:3530 198#: reference_raster.xml:3606 reference_raster.xml:3693 199#: reference_raster.xml:3780 reference_raster.xml:3868 200#: reference_raster.xml:3953 reference_raster.xml:4079 201#: reference_raster.xml:4176 reference_raster.xml:4228 202#: reference_raster.xml:4276 reference_raster.xml:4319 203#: reference_raster.xml:4366 reference_raster.xml:4410 204#: reference_raster.xml:4448 reference_raster.xml:4523 205#: reference_raster.xml:4592 reference_raster.xml:4660 206#: reference_raster.xml:4737 reference_raster.xml:4809 207#: reference_raster.xml:4888 reference_raster.xml:4996 208#: reference_raster.xml:5031 reference_raster.xml:5078 209#: reference_raster.xml:5131 reference_raster.xml:5206 210#: reference_raster.xml:5271 reference_raster.xml:5384 211#: reference_raster.xml:5505 reference_raster.xml:5571 212#: reference_raster.xml:5650 reference_raster.xml:5796 213#: reference_raster.xml:5838 reference_raster.xml:5881 214#: reference_raster.xml:5935 reference_raster.xml:5988 215#: reference_raster.xml:6040 reference_raster.xml:6135 216#: reference_raster.xml:6226 reference_raster.xml:6314 217#: reference_raster.xml:6425 reference_raster.xml:6618 218#: reference_raster.xml:6857 reference_raster.xml:7000 219#: reference_raster.xml:7149 reference_raster.xml:7479 220#: reference_raster.xml:7685 reference_raster.xml:7809 221#: reference_raster.xml:8135 reference_raster.xml:8253 222#: reference_raster.xml:8366 reference_raster.xml:8508 223#: reference_raster.xml:8594 reference_raster.xml:8666 224#: reference_raster.xml:8730 reference_raster.xml:8801 225#: reference_raster.xml:8876 reference_raster.xml:8959 226#: reference_raster.xml:9030 reference_raster.xml:9086 227#: reference_raster.xml:9161 reference_raster.xml:9232 228#: reference_raster.xml:9316 reference_raster.xml:9408 229#: reference_raster.xml:9490 reference_raster.xml:9544 230#: reference_raster.xml:9618 reference_raster.xml:9666 231#: reference_raster.xml:9718 reference_raster.xml:9760 232#: reference_raster.xml:9808 reference_raster.xml:9859 233#: reference_raster.xml:9907 reference_raster.xml:9949 234#: reference_raster.xml:10023 reference_raster.xml:10068 235#: reference_raster.xml:10112 reference_raster.xml:10157 236#: reference_raster.xml:10226 reference_raster.xml:10273 237#: reference_raster.xml:10346 reference_raster.xml:10414 238#: reference_raster.xml:10503 reference_raster.xml:10588 239#: reference_raster.xml:10669 reference_raster.xml:10750 240#: reference_raster.xml:10879 reference_raster.xml:10963 241#: reference_raster.xml:11043 reference_raster.xml:11162 242#: reference_raster.xml:11209 reference_raster.xml:11281 243#: reference_raster.xml:11378 reference_raster.xml:11471 244#, no-c-format 245msgid "Description" 246msgstr "Descrizione" 247 248#. Tag: para 249#: reference_raster.xml:31 250#, no-c-format 251msgid "" 252"geomval is a compound data type consisting of a geometry object referenced " 253"by the .geom field and val, a double precision value that represents the " 254"pixel value at a particular geometric location in a raster band. It is used " 255"by the ST_DumpAsPolygon and Raster intersection family of functions as an " 256"output type to explode a raster band into geometry polygons." 257msgstr "" 258 259#. Tag: title 260#: reference_raster.xml:37 reference_raster.xml:107 reference_raster.xml:157 261#: reference_raster.xml:200 reference_raster.xml:245 reference_raster.xml:340 262#: reference_raster.xml:389 reference_raster.xml:584 reference_raster.xml:725 263#: reference_raster.xml:803 reference_raster.xml:863 reference_raster.xml:899 264#: reference_raster.xml:936 reference_raster.xml:974 reference_raster.xml:1029 265#: reference_raster.xml:1080 reference_raster.xml:1139 266#: reference_raster.xml:1269 reference_raster.xml:1486 267#: reference_raster.xml:1576 reference_raster.xml:1621 268#: reference_raster.xml:1684 reference_raster.xml:1760 269#: reference_raster.xml:1811 reference_raster.xml:1859 270#: reference_raster.xml:1906 reference_raster.xml:1940 271#: reference_raster.xml:1976 reference_raster.xml:2019 272#: reference_raster.xml:2055 reference_raster.xml:2089 273#: reference_raster.xml:2133 reference_raster.xml:2193 274#: reference_raster.xml:2230 reference_raster.xml:2268 275#: reference_raster.xml:2313 reference_raster.xml:2372 276#: reference_raster.xml:2426 reference_raster.xml:2461 277#: reference_raster.xml:2497 reference_raster.xml:2533 278#: reference_raster.xml:2568 reference_raster.xml:2602 279#: reference_raster.xml:2641 reference_raster.xml:2675 280#: reference_raster.xml:2710 reference_raster.xml:2760 281#: reference_raster.xml:2817 reference_raster.xml:2872 282#: reference_raster.xml:2943 reference_raster.xml:2978 283#: reference_raster.xml:3033 reference_raster.xml:3071 284#: reference_raster.xml:3216 reference_raster.xml:3253 285#: reference_raster.xml:3295 reference_raster.xml:3357 286#: reference_raster.xml:3400 reference_raster.xml:3455 287#: reference_raster.xml:3498 reference_raster.xml:3553 288#: reference_raster.xml:3628 reference_raster.xml:3718 289#: reference_raster.xml:3812 reference_raster.xml:3883 290#: reference_raster.xml:4032 reference_raster.xml:4098 291#: reference_raster.xml:4254 reference_raster.xml:4289 292#: reference_raster.xml:4338 reference_raster.xml:4383 293#: reference_raster.xml:4423 reference_raster.xml:4461 294#: reference_raster.xml:4553 reference_raster.xml:4618 295#: reference_raster.xml:4687 reference_raster.xml:4765 296#: reference_raster.xml:4839 reference_raster.xml:4961 297#: reference_raster.xml:5009 reference_raster.xml:5050 298#: reference_raster.xml:5103 reference_raster.xml:5156 299#: reference_raster.xml:5227 reference_raster.xml:5288 300#: reference_raster.xml:5419 reference_raster.xml:5520 301#: reference_raster.xml:5607 reference_raster.xml:5667 302#: reference_raster.xml:5814 reference_raster.xml:5855 303#: reference_raster.xml:5898 reference_raster.xml:5963 304#: reference_raster.xml:6011 reference_raster.xml:6089 305#: reference_raster.xml:6180 reference_raster.xml:6271 306#: reference_raster.xml:6351 reference_raster.xml:6581 307#: reference_raster.xml:6815 reference_raster.xml:6924 308#: reference_raster.xml:7059 reference_raster.xml:7410 309#: reference_raster.xml:7646 reference_raster.xml:7759 310#: reference_raster.xml:8051 reference_raster.xml:8210 311#: reference_raster.xml:8333 reference_raster.xml:8466 312#: reference_raster.xml:8537 reference_raster.xml:8625 313#: reference_raster.xml:8698 reference_raster.xml:8768 314#: reference_raster.xml:8837 reference_raster.xml:8919 315#: reference_raster.xml:8998 reference_raster.xml:9053 316#: reference_raster.xml:9122 reference_raster.xml:9193 317#: reference_raster.xml:9268 reference_raster.xml:9361 318#: reference_raster.xml:9458 reference_raster.xml:9501 319#: reference_raster.xml:9586 reference_raster.xml:9634 320#: reference_raster.xml:9685 reference_raster.xml:9735 321#: reference_raster.xml:9780 reference_raster.xml:9833 322#: reference_raster.xml:9879 reference_raster.xml:9922 323#: reference_raster.xml:9961 reference_raster.xml:10171 324#: reference_raster.xml:10239 reference_raster.xml:10292 325#: reference_raster.xml:10358 reference_raster.xml:10449 326#: reference_raster.xml:10534 reference_raster.xml:10615 327#: reference_raster.xml:10696 reference_raster.xml:10780 328#: reference_raster.xml:10909 reference_raster.xml:10990 329#: reference_raster.xml:11070 reference_raster.xml:11183 330#: reference_raster.xml:11227 reference_raster.xml:11314 331#: reference_raster.xml:11409 reference_raster.xml:11502 332#, no-c-format 333msgid "See Also" 334msgstr "Si veda anche" 335 336#. Tag: refname 337#: reference_raster.xml:44 338#, no-c-format 339msgid "addbandarg" 340msgstr "addbandarg" 341 342#. Tag: refpurpose 343#: reference_raster.xml:45 344#, no-c-format 345msgid "" 346"<refpurpose>A composite type used as input into the ST_AddBand function " 347"defining the attributes and initial value of the new band.</refpurpose>" 348msgstr "" 349 350#. Tag: para 351#: reference_raster.xml:50 352#, no-c-format 353msgid "" 354"<para>A composite type used as input into the ST_AddBand function defining " 355"the attributes and initial value of the new band.</para>" 356msgstr "" 357 358#. Tag: term 359#: reference_raster.xml:55 360#, no-c-format 361msgid "<parameter>index </parameter> <type>integer</type>" 362msgstr "<parameter>index </parameter> <type>integer</type>" 363 364#. Tag: para 365#: reference_raster.xml:60 366#, no-c-format 367msgid "" 368"1-based value indicating the position where the new band will be added " 369"amongst the raster's bands. If NULL, the new band will be added at the end " 370"of the raster's bands." 371msgstr "" 372 373#. Tag: term 374#: reference_raster.xml:67 375#, no-c-format 376msgid "<parameter>pixeltype </parameter> <type>text</type>" 377msgstr "<parameter>pixeltype </parameter> <type>text</type>" 378 379#. Tag: para 380#: reference_raster.xml:72 381#, no-c-format 382msgid "" 383"Pixel type of the new band. One of defined pixel types as described in <xref " 384"linkend=\"RT_ST_BandPixelType\"/>." 385msgstr "" 386 387#. Tag: term 388#: reference_raster.xml:79 389#, no-c-format 390msgid "<parameter>initialvalue </parameter> <type>double precision</type>" 391msgstr "<parameter>initialvalue </parameter> <type>double precision</type>" 392 393#. Tag: para 394#: reference_raster.xml:84 395#, no-c-format 396msgid "Initial value that all pixels of new band will be set to." 397msgstr "" 398 399#. Tag: term 400#: reference_raster.xml:91 401#, no-c-format 402msgid "<parameter>nodataval </parameter> <type>double precision</type>" 403msgstr "<parameter>nodataval </parameter> <type>double precision</type>" 404 405#. Tag: para 406#: reference_raster.xml:96 407#, no-c-format 408msgid "" 409"NODATA value of the new band. If NULL, the new band will not have a NODATA " 410"value assigned." 411msgstr "" 412 413#. Tag: refname 414#: reference_raster.xml:116 415#, no-c-format 416msgid "rastbandarg" 417msgstr "rastbandarg" 418 419#. Tag: refpurpose 420#: reference_raster.xml:117 421#, no-c-format 422msgid "" 423"<refpurpose>A composite type for use when needing to express a raster and a " 424"band index of that raster.</refpurpose>" 425msgstr "" 426 427#. Tag: para 428#: reference_raster.xml:122 429#, no-c-format 430msgid "" 431"<para>A composite type for use when needing to express a raster and a band " 432"index of that raster.</para>" 433msgstr "" 434 435#. Tag: term 436#: reference_raster.xml:128 437#, no-c-format 438msgid "<parameter>rast </parameter> <type>raster</type>" 439msgstr "<parameter>rast </parameter> <type>raster</type>" 440 441#. Tag: para 442#: reference_raster.xml:133 443#, no-c-format 444msgid "The raster in question/" 445msgstr "" 446 447#. Tag: term 448#: reference_raster.xml:140 reference_raster.xml:360 449#, no-c-format 450msgid "<parameter>nband </parameter> <type>integer</type>" 451msgstr "<parameter>nband </parameter> <type>integer</type>" 452 453#. Tag: para 454#: reference_raster.xml:145 455#, no-c-format 456msgid "1-based value indicating the band of raster" 457msgstr "" 458 459#. Tag: refname 460#: reference_raster.xml:166 461#, no-c-format 462msgid "raster" 463msgstr "raster" 464 465#. Tag: refpurpose 466#: reference_raster.xml:167 467#, no-c-format 468msgid "raster spatial data type." 469msgstr "" 470 471#. Tag: para 472#: reference_raster.xml:172 473#, no-c-format 474msgid "" 475"raster is a spatial data type used to represent raster data such as those " 476"imported from JPEGs, TIFFs, PNGs, digital elevation models. Each raster has " 477"1 or more bands each having a set of pixel values. Rasters can be " 478"georeferenced." 479msgstr "" 480 481#. Tag: para 482#: reference_raster.xml:175 483#, no-c-format 484msgid "" 485"Requires PostGIS be compiled with GDAL support. Currently rasters can be " 486"implicitly converted to geometry type, but the conversion returns the <xref " 487"linkend=\"RT_ST_ConvexHull\"/> of the raster. This auto casting may be " 488"removed in the near future so don't rely on it." 489msgstr "" 490 491#. Tag: title 492#: reference_raster.xml:181 493#, no-c-format 494msgid "Casting Behavior" 495msgstr "" 496 497#. Tag: para 498#: reference_raster.xml:182 499#, no-c-format 500msgid "" 501"This section lists the automatic as well as explicit casts allowed for this " 502"data type" 503msgstr "" 504 505#. Tag: entry 506#: reference_raster.xml:187 507#, no-c-format 508msgid "Cast To" 509msgstr "" 510 511#. Tag: entry 512#: reference_raster.xml:188 513#, no-c-format 514msgid "Behavior" 515msgstr "" 516 517#. Tag: entry 518#: reference_raster.xml:191 519#, no-c-format 520msgid "geometry" 521msgstr "" 522 523#. Tag: entry 524#: reference_raster.xml:192 525#, no-c-format 526msgid "automatic" 527msgstr "" 528 529#. Tag: refname 530#: reference_raster.xml:207 531#, no-c-format 532msgid "reclassarg" 533msgstr "" 534 535#. Tag: refpurpose 536#: reference_raster.xml:208 537#, no-c-format 538msgid "" 539"<refpurpose>A composite type used as input into the ST_Reclass function " 540"defining the behavior of reclassification.</refpurpose>" 541msgstr "" 542 543#. Tag: para 544#: reference_raster.xml:212 545#, no-c-format 546msgid "" 547"<para>A composite type used as input into the ST_Reclass function defining " 548"the behavior of reclassification.</para>" 549msgstr "" 550 551#. Tag: term 552#: reference_raster.xml:215 553#, no-c-format 554msgid "<parameter>nband </parameter><type>integer</type>" 555msgstr "<parameter>nband </parameter><type>integer</type>" 556 557#. Tag: para 558#: reference_raster.xml:216 559#, no-c-format 560msgid "The band number of band to reclassify." 561msgstr "" 562 563#. Tag: term 564#: reference_raster.xml:219 565#, no-c-format 566msgid "<parameter>reclassexpr </parameter><type>text</type>" 567msgstr "<parameter>reclassexpr </parameter><type>text</type>" 568 569#. Tag: para 570#: reference_raster.xml:220 571#, no-c-format 572msgid "" 573"range expression consisting of comma delimited range:map_range mappings. : " 574"to define mapping that defines how to map old band values to new band " 575"values. ( means >, ) means less than, ] < or equal, [ means > or " 576"equal" 577msgstr "" 578 579#. Tag: programlisting 580#: reference_raster.xml:221 581#, no-c-format 582msgid "" 583"1. [a-b] = a <= x <= b\n" 584"\n" 585"2. (a-b] = a < x <= b\n" 586"\n" 587"3. [a-b) = a <= x < b\n" 588"\n" 589"4. (a-b) = a < x < b" 590msgstr "" 591"1. [a-b] = a <= x <= b\n" 592"\n" 593"2. (a-b] = a < x <= b\n" 594"\n" 595"3. [a-b) = a <= x < b\n" 596"\n" 597"4. (a-b) = a < x < b" 598 599#. Tag: para 600#: reference_raster.xml:222 601#, no-c-format 602msgid "( notation is optional so a-b means the same as (a-b)" 603msgstr "" 604 605#. Tag: term 606#: reference_raster.xml:227 607#, no-c-format 608msgid "<parameter>pixeltype </parameter><type>text</type>" 609msgstr "<parameter>pixeltype </parameter><type>text</type>" 610 611#. Tag: para 612#: reference_raster.xml:228 613#, no-c-format 614msgid "" 615"One of defined pixel types as described in <xref linkend=" 616"\"RT_ST_BandPixelType\"/>" 617msgstr "" 618 619#. Tag: term 620#: reference_raster.xml:231 621#, no-c-format 622msgid "<parameter>nodataval </parameter><type>double precision</type>" 623msgstr "<parameter>nodataval </parameter><type>double precision</type>" 624 625#. Tag: para 626#: reference_raster.xml:232 627#, no-c-format 628msgid "" 629"Value to treat as no data. For image outputs that support transparency, " 630"these will be blank." 631msgstr "" 632 633#. Tag: title 634#: reference_raster.xml:237 635#, no-c-format 636msgid "Example: Reclassify band 2 as an 8BUI where 255 is nodata value" 637msgstr "" 638 639#. Tag: programlisting 640#: reference_raster.xml:238 641#, no-c-format 642msgid "" 643"SELECT ROW(2, '0-100:1-10, 101-500:11-150,501 - 10000: 151-254', '8BUI', " 644"255)::reclassarg;" 645msgstr "" 646"SELECT ROW(2, '0-100:1-10, 101-500:11-150,501 - 10000: 151-254', '8BUI', " 647"255)::reclassarg;" 648 649#. Tag: title 650#: reference_raster.xml:241 651#, no-c-format 652msgid "Example: Reclassify band 1 as an 1BB and no nodata value defined" 653msgstr "" 654 655#. Tag: programlisting 656#: reference_raster.xml:242 657#, no-c-format 658msgid "SELECT ROW(1, '0-100]:0, (100-255:1', '1BB', NULL)::reclassarg;" 659msgstr "SELECT ROW(1, '0-100]:0, (100-255:1', '1BB', NULL)::reclassarg;" 660 661#. Tag: refname 662#: reference_raster.xml:252 663#, no-c-format 664msgid "summarystats" 665msgstr "" 666 667#. Tag: refpurpose 668#: reference_raster.xml:253 669#, no-c-format 670msgid "" 671"A composite type returned by the ST_SummaryStats and ST_SummaryStatsAgg " 672"functions." 673msgstr "" 674 675#. Tag: para 676#: reference_raster.xml:258 677#, no-c-format 678msgid "" 679"A composite type returned by the <xref linkend=\"RT_ST_SummaryStats\"/> and " 680"<xref linkend=\"RT_ST_SummaryStatsAgg\"/> functions." 681msgstr "" 682 683#. Tag: term 684#: reference_raster.xml:263 685#, no-c-format 686msgid "<parameter>count </parameter> <type>integer</type>" 687msgstr "" 688 689#. Tag: para 690#: reference_raster.xml:268 691#, no-c-format 692msgid "Number of pixels counted for the summary statistics." 693msgstr "" 694 695#. Tag: term 696#: reference_raster.xml:275 697#, no-c-format 698msgid "<parameter>sum </parameter> <type>double precision</type>" 699msgstr "" 700 701#. Tag: para 702#: reference_raster.xml:280 703#, no-c-format 704msgid "Sum of all counted pixel values." 705msgstr "" 706 707#. Tag: term 708#: reference_raster.xml:287 709#, no-c-format 710msgid "<parameter>mean </parameter> <type>double precision</type>" 711msgstr "" 712 713#. Tag: para 714#: reference_raster.xml:292 715#, no-c-format 716msgid "Arithmetic mean of all counted pixel values." 717msgstr "" 718 719#. Tag: term 720#: reference_raster.xml:299 721#, no-c-format 722msgid "<parameter>stddev </parameter> <type>double precision</type>" 723msgstr "" 724 725#. Tag: para 726#: reference_raster.xml:304 727#, no-c-format 728msgid "Standard deviation of all counted pixel values." 729msgstr "" 730 731#. Tag: term 732#: reference_raster.xml:311 733#, no-c-format 734msgid "<parameter>min </parameter> <type>double precision</type>" 735msgstr "" 736 737#. Tag: para 738#: reference_raster.xml:316 739#, no-c-format 740msgid "Minimum value of counted pixel values." 741msgstr "" 742 743#. Tag: term 744#: reference_raster.xml:323 745#, no-c-format 746msgid "<parameter>max </parameter> <type>double precision</type>" 747msgstr "" 748 749#. Tag: para 750#: reference_raster.xml:328 751#, no-c-format 752msgid "Maximum value of counted pixel values." 753msgstr "" 754 755#. Tag: para 756#: reference_raster.xml:341 757#, no-c-format 758msgid ", <xref linkend=\"RT_ST_SummaryStatsAgg\"/>" 759msgstr "" 760 761#. Tag: refname 762#: reference_raster.xml:349 763#, no-c-format 764msgid "unionarg" 765msgstr "unionarg" 766 767#. Tag: refpurpose 768#: reference_raster.xml:350 769#, no-c-format 770msgid "" 771"<refpurpose>A composite type used as input into the ST_Union function " 772"defining the bands to be processed and behavior of the UNION operation.</" 773"refpurpose>" 774msgstr "" 775 776#. Tag: para 777#: reference_raster.xml:355 778#, no-c-format 779msgid "" 780"<para>A composite type used as input into the ST_Union function defining the " 781"bands to be processed and behavior of the UNION operation.</para>" 782msgstr "" 783 784#. Tag: para 785#: reference_raster.xml:365 786#, no-c-format 787msgid "1-based value indicating the band of each input raster to be processed." 788msgstr "" 789 790#. Tag: term 791#: reference_raster.xml:372 792#, no-c-format 793msgid "<parameter>uniontype </parameter> <type>text</type>" 794msgstr "<parameter>uniontype </parameter> <type>text</type>" 795 796#. Tag: para 797#: reference_raster.xml:377 798#, no-c-format 799msgid "" 800"Type of UNION operation. One of defined types as described in <xref linkend=" 801"\"RT_ST_Union\"/>." 802msgstr "" 803 804#. Tag: title 805#: reference_raster.xml:399 806#, no-c-format 807msgid "Raster Management" 808msgstr "" 809 810#. Tag: refname 811#: reference_raster.xml:402 812#, no-c-format 813msgid "AddRasterConstraints" 814msgstr "AddRasterConstraints" 815 816#. Tag: refpurpose 817#: reference_raster.xml:404 818#, no-c-format 819msgid "" 820"Adds raster constraints to a loaded raster table for a specific column that " 821"constrains spatial ref, scaling, blocksize, alignment, bands, band type and " 822"a flag to denote if raster column is regularly blocked. The table must be " 823"loaded with data for the constraints to be inferred. Returns true if the " 824"constraint setting was accomplished and issues a notice otherwise." 825msgstr "" 826 827#. Tag: funcsynopsis 828#: reference_raster.xml:408 829#, no-c-format 830msgid "" 831"<funcprototype> <funcdef>boolean <function>AddRasterConstraints</function></" 832"funcdef> <paramdef><type>name </type> <parameter>rasttable</parameter></" 833"paramdef> <paramdef><type>name </type> <parameter>rastcolumn</parameter></" 834"paramdef> <paramdef><type>boolean </type> <parameter>srid</parameter></" 835"paramdef> <paramdef><type>boolean </type> <parameter>scale_x</parameter></" 836"paramdef> <paramdef><type>boolean </type> <parameter>scale_y</parameter></" 837"paramdef> <paramdef><type>boolean </type> <parameter>blocksize_x</" 838"parameter></paramdef> <paramdef><type>boolean </type> " 839"<parameter>blocksize_y</parameter></paramdef> <paramdef><type>boolean </" 840"type> <parameter>same_alignment</parameter></paramdef> " 841"<paramdef><type>boolean </type> <parameter>regular_blocking</parameter></" 842"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 843"<parameter>num_bands=true</parameter> </paramdef> <paramdef choice=\"opt" 844"\"><type>boolean </type> <parameter>pixel_types=true</parameter> </paramdef> " 845"<paramdef choice=\"opt\"><type>boolean </type> " 846"<parameter>nodata_values=true</parameter> </paramdef> <paramdef choice=\"opt" 847"\"><type>boolean </type> <parameter>out_db=true</parameter> </paramdef> " 848"<paramdef choice=\"opt\"><type>boolean </type> <parameter>extent=true</" 849"parameter> </paramdef> </funcprototype> <funcprototype> <funcdef>boolean " 850"<function>AddRasterConstraints</function></funcdef> <paramdef><type>name </" 851"type> <parameter>rasttable</parameter></paramdef> <paramdef><type>name </" 852"type> <parameter>rastcolumn</parameter></paramdef> <paramdef><type>text[] </" 853"type> <parameter>VARIADIC constraints</parameter></paramdef> </" 854"funcprototype> <funcprototype> <funcdef>boolean " 855"<function>AddRasterConstraints</function></funcdef> <paramdef><type>name </" 856"type> <parameter>rastschema</parameter></paramdef> <paramdef><type>name </" 857"type> <parameter>rasttable</parameter></paramdef> <paramdef><type>name </" 858"type> <parameter>rastcolumn</parameter></paramdef> <paramdef><type>text[] </" 859"type> <parameter>VARIADIC constraints</parameter></paramdef> </" 860"funcprototype> <funcprototype> <funcdef>boolean " 861"<function>AddRasterConstraints</function></funcdef> <paramdef><type>name </" 862"type> <parameter>rastschema</parameter></paramdef> <paramdef><type>name </" 863"type> <parameter>rasttable</parameter></paramdef> <paramdef><type>name </" 864"type> <parameter>rastcolumn</parameter></paramdef> <paramdef choice=\"opt" 865"\"><type>boolean </type> <parameter>srid=true</parameter></paramdef> " 866"<paramdef choice=\"opt\"><type>boolean </type> <parameter>scale_x=true</" 867"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 868"<parameter>scale_y=true</parameter></paramdef> <paramdef choice=\"opt" 869"\"><type>boolean </type> <parameter>blocksize_x=true</parameter></paramdef> " 870"<paramdef choice=\"opt\"><type>boolean </type> <parameter>blocksize_y=true</" 871"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 872"<parameter>same_alignment=true</parameter></paramdef> <paramdef choice=\"opt" 873"\"><type>boolean </type> <parameter>regular_blocking=false</parameter></" 874"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 875"<parameter>num_bands=true</parameter></paramdef> <paramdef choice=\"opt" 876"\"><type>boolean </type> <parameter>pixel_types=true</parameter></paramdef> " 877"<paramdef choice=\"opt\"><type>boolean </type> " 878"<parameter>nodata_values=true</parameter> </paramdef> <paramdef choice=\"opt" 879"\"><type>boolean </type> <parameter>out_db=true</parameter> </paramdef> " 880"<paramdef choice=\"opt\"><type>boolean </type> <parameter>extent=true</" 881"parameter> </paramdef> </funcprototype>" 882msgstr "" 883 884#. Tag: para 885#: reference_raster.xml:538 886#, no-c-format 887msgid "" 888"Generates constraints on a raster column that are used to display " 889"information in the <varname>raster_columns</varname> raster catalog. The " 890"<varname>rastschema</varname> is the name of the table schema the table " 891"resides in. The <varname>srid</varname> must be an integer value reference " 892"to an entry in the SPATIAL_REF_SYS table." 893msgstr "" 894 895#. Tag: para 896#: reference_raster.xml:543 897#, no-c-format 898msgid "" 899"<varname>raster2pgsql</varname> loader uses this function to register raster " 900"tables" 901msgstr "" 902 903#. Tag: para 904#: reference_raster.xml:544 905#, no-c-format 906msgid "" 907"Valid constraint names to pass in: refer to <xref linkend=\"RT_Raster_Columns" 908"\"/> for more details." 909msgstr "" 910 911#. Tag: para 912#: reference_raster.xml:546 913#, no-c-format 914msgid "<varname>blocksize</varname> sets both X and Y blocksize" 915msgstr "" 916 917#. Tag: para 918#: reference_raster.xml:547 919#, no-c-format 920msgid "" 921"<varname>blocksize_x</varname> sets X tile (width in pixels of each tile)" 922msgstr "" 923 924#. Tag: para 925#: reference_raster.xml:548 926#, no-c-format 927msgid "" 928"<varname>blocksize_y</varname> sets Y tile (height in pixels of each tile)" 929msgstr "" 930 931#. Tag: para 932#: reference_raster.xml:549 933#, no-c-format 934msgid "" 935"<varname>extent</varname> computes extent of whole table and applys " 936"constraint all rasters must be within that extent" 937msgstr "" 938 939#. Tag: para 940#: reference_raster.xml:551 941#, no-c-format 942msgid "<varname>num_bands</varname> number of bands" 943msgstr "" 944 945#. Tag: para 946#: reference_raster.xml:552 947#, no-c-format 948msgid "" 949"<varname>pixel_types</varname> reads array of pixel types for each band " 950"ensure all band n have same pixel type" 951msgstr "" 952 953#. Tag: para 954#: reference_raster.xml:553 955#, no-c-format 956msgid "" 957"<varname>regular_blocking</varname> sets spatially unique (no two rasters " 958"can be spatially the same) and coverage tile (raster is aligned to a " 959"coverage) constraints" 960msgstr "" 961 962#. Tag: para 963#: reference_raster.xml:554 964#, no-c-format 965msgid "" 966"<varname>same_alignment</varname> ensures they all have same alignment " 967"meaning any two tiles you compare will return true for. Refer to <xref " 968"linkend=\"RT_ST_SameAlignment\"/>." 969msgstr "" 970 971#. Tag: para 972#: reference_raster.xml:555 973#, no-c-format 974msgid "<varname>srid</varname> ensures all have same srid" 975msgstr "" 976 977#. Tag: para 978#: reference_raster.xml:556 979#, no-c-format 980msgid "More -- any listed as inputs into the above functions" 981msgstr "" 982 983#. Tag: para 984#: reference_raster.xml:559 985#, no-c-format 986msgid "" 987"This function infers the constraints from the data already present in the " 988"table. As such for it to work, you must create the raster column first and " 989"then load it with data." 990msgstr "" 991 992#. Tag: para 993#: reference_raster.xml:564 994#, no-c-format 995msgid "" 996"If you need to load more data in your tables after you have already applied " 997"constraints, you may want to run the DropRasterConstraints if the extent of " 998"your data has changed." 999msgstr "" 1000 1001#. Tag: para 1002#: reference_raster.xml:568 reference_raster.xml:717 reference_raster.xml:793 1003#: reference_raster.xml:859 reference_raster.xml:1527 reference_raster.xml:1965 1004#: reference_raster.xml:3015 reference_raster.xml:3242 1005#: reference_raster.xml:3285 reference_raster.xml:3346 1006#: reference_raster.xml:5039 reference_raster.xml:5210 1007#: reference_raster.xml:5405 reference_raster.xml:5509 1008#: reference_raster.xml:5579 reference_raster.xml:5801 1009#: reference_raster.xml:6439 reference_raster.xml:7705 1010#: reference_raster.xml:7904 reference_raster.xml:8168 1011#: reference_raster.xml:8287 reference_raster.xml:8416 1012#: reference_raster.xml:8514 reference_raster.xml:8602 1013#: reference_raster.xml:8686 reference_raster.xml:8825 1014#: reference_raster.xml:8900 reference_raster.xml:8987 1015#: reference_raster.xml:9110 reference_raster.xml:9181 1016#: reference_raster.xml:9256 reference_raster.xml:9342 1017#: reference_raster.xml:9438 reference_raster.xml:9566 1018#: reference_raster.xml:10030 reference_raster.xml:10281 1019#: reference_raster.xml:10353 reference_raster.xml:11172 1020#, no-c-format 1021msgid "Availability: 2.0.0" 1022msgstr "Disponibilità: 2.0" 1023 1024#. Tag: title 1025#: reference_raster.xml:572 1026#, no-c-format 1027msgid "Examples: Apply all possible constraints on column based on data" 1028msgstr "" 1029 1030#. Tag: programlisting 1031#: reference_raster.xml:574 1032#, no-c-format 1033msgid "" 1034"CREATE TABLE myrasters(rid SERIAL primary key, rast raster);\n" 1035"INSERT INTO myrasters(rast)\n" 1036"SELECT ST_AddBand(ST_MakeEmptyRaster(1000, 1000, 0.3, -0.3, 2, 2, 0, " 1037"0,4326), 1, '8BSI'::text, -129, NULL);\n" 1038"\n" 1039"SELECT AddRasterConstraints('myrasters'::name, 'rast'::name);\n" 1040"\n" 1041"\n" 1042"-- verify if registered correctly in the raster_columns view --\n" 1043"SELECT srid, scale_x, scale_y, blocksize_x, blocksize_y, num_bands, " 1044"pixel_types, nodata_values\n" 1045" FROM raster_columns\n" 1046" WHERE r_table_name = 'myrasters';\n" 1047"\n" 1048" srid | scale_x | scale_y | blocksize_x | blocksize_y | num_bands | " 1049"pixel_types| nodata_values\n" 1050"------+---------+---------+-------------+-------------+-----------" 1051"+-------------+---------------\n" 1052" 4326 | 2 | 2 | 1000 | 1000 | 1 | " 1053"{8BSI} | {0}" 1054msgstr "" 1055 1056#. Tag: title 1057#: reference_raster.xml:578 1058#, no-c-format 1059msgid "Examples: Apply single constraint" 1060msgstr "" 1061 1062#. Tag: programlisting 1063#: reference_raster.xml:580 1064#, no-c-format 1065msgid "" 1066"CREATE TABLE public.myrasters2(rid SERIAL primary key, rast raster);\n" 1067"INSERT INTO myrasters2(rast)\n" 1068"SELECT ST_AddBand(ST_MakeEmptyRaster(1000, 1000, 0.3, -0.3, 2, 2, 0, " 1069"0,4326), 1, '8BSI'::text, -129, NULL);\n" 1070"\n" 1071"SELECT AddRasterConstraints('public'::name, 'myrasters2'::name, 'rast'::" 1072"name,'regular_blocking', 'blocksize');\n" 1073"-- get notice--\n" 1074"NOTICE: Adding regular blocking constraint\n" 1075"NOTICE: Adding blocksize-X constraint\n" 1076"NOTICE: Adding blocksize-Y constraint" 1077msgstr "" 1078 1079#. Tag: para 1080#: reference_raster.xml:586 1081#, no-c-format 1082msgid "" 1083", <xref linkend=\"RT_ST_AddBand\"/>, <xref linkend=\"RT_ST_MakeEmptyRaster\"/" 1084">, <xref linkend=\"RT_DropRasterConstraints\"/>, <xref linkend=" 1085"\"RT_ST_BandPixelType\"/>, <xref linkend=\"RT_ST_SRID\"/>" 1086msgstr "" 1087", <xref linkend=\"RT_ST_AddBand\"/>, <xref linkend=\"RT_ST_MakeEmptyRaster\"/" 1088">, <xref linkend=\"RT_DropRasterConstraints\"/>, <xref linkend=" 1089"\"RT_ST_BandPixelType\"/>, <xref linkend=\"RT_ST_SRID\"/>" 1090 1091#. Tag: refname 1092#: reference_raster.xml:592 1093#, no-c-format 1094msgid "DropRasterConstraints" 1095msgstr "DropRasterConstraints" 1096 1097#. Tag: refpurpose 1098#: reference_raster.xml:594 1099#, no-c-format 1100msgid "" 1101"Drops PostGIS raster constraints that refer to a raster table column. Useful " 1102"if you need to reload data or update your raster column data." 1103msgstr "" 1104 1105#. Tag: funcsynopsis 1106#: reference_raster.xml:598 1107#, no-c-format 1108msgid "" 1109"<funcprototype> <funcdef>boolean <function>DropRasterConstraints</function></" 1110"funcdef> <paramdef><type>name </type> <parameter>rasttable</parameter></" 1111"paramdef> <paramdef><type>name </type> <parameter>rastcolumn</parameter></" 1112"paramdef> <paramdef><type>boolean </type> <parameter>srid</parameter></" 1113"paramdef> <paramdef><type>boolean </type> <parameter>scale_x</parameter></" 1114"paramdef> <paramdef><type>boolean </type> <parameter>scale_y</parameter></" 1115"paramdef> <paramdef><type>boolean </type> <parameter>blocksize_x</" 1116"parameter></paramdef> <paramdef><type>boolean </type> " 1117"<parameter>blocksize_y</parameter></paramdef> <paramdef><type>boolean </" 1118"type> <parameter>same_alignment</parameter></paramdef> " 1119"<paramdef><type>boolean </type> <parameter>regular_blocking</parameter></" 1120"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 1121"<parameter>num_bands=true</parameter></paramdef> <paramdef choice=\"opt" 1122"\"><type>boolean </type> <parameter>pixel_types=true</parameter></paramdef> " 1123"<paramdef choice=\"opt\"><type>boolean </type> " 1124"<parameter>nodata_values=true</parameter></paramdef> <paramdef choice=\"opt" 1125"\"><type>boolean </type> <parameter>out_db=true</parameter> </paramdef> " 1126"<paramdef choice=\"opt\"><type>boolean </type> <parameter>extent=true</" 1127"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>boolean " 1128"<function>DropRasterConstraints</function></funcdef> <paramdef><type>name </" 1129"type> <parameter>rastschema</parameter></paramdef> <paramdef><type>name </" 1130"type> <parameter>rasttable</parameter></paramdef> <paramdef><type>name </" 1131"type> <parameter>rastcolumn</parameter></paramdef> <paramdef choice=\"opt" 1132"\"><type>boolean </type> <parameter>srid=true</parameter></paramdef> " 1133"<paramdef><type>boolean </type> <parameter>scale_x=true</parameter></" 1134"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 1135"<parameter>scale_y=true</parameter></paramdef> <paramdef choice=\"opt" 1136"\"><type>boolean </type> <parameter>blocksize_x=true</parameter></paramdef> " 1137"<paramdef choice=\"opt\"><type>boolean </type> <parameter>blocksize_y=true</" 1138"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 1139"<parameter>same_alignment=true</parameter></paramdef> <paramdef choice=\"opt" 1140"\"><type>boolean </type> <parameter>regular_blocking=false</parameter></" 1141"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 1142"<parameter>num_bands=true</parameter></paramdef> <paramdef choice=\"opt" 1143"\"><type>boolean </type> <parameter>pixel_types=true</parameter></paramdef> " 1144"<paramdef choice=\"opt\"><type>boolean </type> " 1145"<parameter>nodata_values=true</parameter></paramdef> <paramdef choice=\"opt" 1146"\"><type>boolean </type> <parameter>out_db=true</parameter> </paramdef> " 1147"<paramdef choice=\"opt\"><type>boolean </type> <parameter>extent=true</" 1148"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>boolean " 1149"<function>DropRasterConstraints</function></funcdef> <paramdef><type>name </" 1150"type> <parameter>rastschema</parameter></paramdef> <paramdef><type>name </" 1151"type> <parameter>rasttable</parameter></paramdef> <paramdef><type>name </" 1152"type> <parameter>rastcolumn</parameter></paramdef> <paramdef><type>text[] </" 1153"type> <parameter>constraints</parameter></paramdef> </funcprototype>" 1154msgstr "" 1155 1156#. Tag: para 1157#: reference_raster.xml:711 1158#, no-c-format 1159msgid "" 1160"Drops PostGIS raster constraints that refer to a raster table column that " 1161"were added by <xref linkend=\"RT_AddRasterConstraints\"/>. Useful if you " 1162"need to load more data or update your raster column data. You do not need to " 1163"do this if you want to get rid of a raster table or a raster column." 1164msgstr "" 1165 1166#. Tag: para 1167#: reference_raster.xml:713 1168#, no-c-format 1169msgid "To drop a raster table use the standard" 1170msgstr "" 1171 1172#. Tag: programlisting 1173#: reference_raster.xml:713 1174#, no-c-format 1175msgid "DROP TABLE mytable" 1176msgstr "DROP TABLE mytable" 1177 1178#. Tag: para 1179#: reference_raster.xml:714 1180#, no-c-format 1181msgid "" 1182"To drop just a raster column and leave the rest of the table, use standard " 1183"SQL" 1184msgstr "" 1185 1186#. Tag: programlisting 1187#: reference_raster.xml:714 1188#, no-c-format 1189msgid "ALTER TABLE mytable DROP COLUMN rast" 1190msgstr "" 1191 1192#. Tag: para 1193#: reference_raster.xml:715 1194#, no-c-format 1195msgid "" 1196"the table will disappear from the <varname>raster_columns</varname> catalog " 1197"if the column or table is dropped. However if only the constraints are " 1198"dropped, the raster column will still be listed in the " 1199"<varname>raster_columns</varname> catalog, but there will be no other " 1200"information about it aside from the column name and table." 1201msgstr "" 1202 1203#. Tag: title 1204#: reference_raster.xml:720 reference_raster.xml:797 reference_raster.xml:894 1205#: reference_raster.xml:930 reference_raster.xml:968 reference_raster.xml:1531 1206#: reference_raster.xml:1677 reference_raster.xml:1751 1207#: reference_raster.xml:1852 reference_raster.xml:1900 1208#: reference_raster.xml:1933 reference_raster.xml:1969 1209#: reference_raster.xml:2012 reference_raster.xml:2048 1210#: reference_raster.xml:2082 reference_raster.xml:2222 1211#: reference_raster.xml:2260 reference_raster.xml:2303 1212#: reference_raster.xml:2362 reference_raster.xml:2416 1213#: reference_raster.xml:2454 reference_raster.xml:2489 1214#: reference_raster.xml:2525 reference_raster.xml:2561 1215#: reference_raster.xml:2597 reference_raster.xml:2634 1216#: reference_raster.xml:2668 reference_raster.xml:2702 1217#: reference_raster.xml:2753 reference_raster.xml:2810 1218#: reference_raster.xml:2865 reference_raster.xml:2971 1219#: reference_raster.xml:3026 reference_raster.xml:3064 1220#: reference_raster.xml:3104 reference_raster.xml:3139 1221#: reference_raster.xml:3209 reference_raster.xml:3246 1222#: reference_raster.xml:3290 reference_raster.xml:3352 1223#: reference_raster.xml:3395 reference_raster.xml:3450 1224#: reference_raster.xml:3493 reference_raster.xml:3548 1225#: reference_raster.xml:3615 reference_raster.xml:3709 1226#: reference_raster.xml:3801 reference_raster.xml:3876 1227#: reference_raster.xml:4089 reference_raster.xml:4185 1228#: reference_raster.xml:4248 reference_raster.xml:4282 1229#: reference_raster.xml:4330 reference_raster.xml:4373 1230#: reference_raster.xml:4454 reference_raster.xml:4547 1231#: reference_raster.xml:4611 reference_raster.xml:4679 1232#: reference_raster.xml:4757 reference_raster.xml:4834 1233#: reference_raster.xml:4913 reference_raster.xml:5002 1234#: reference_raster.xml:5043 reference_raster.xml:5098 1235#: reference_raster.xml:5151 reference_raster.xml:5221 1236#: reference_raster.xml:5283 reference_raster.xml:5513 1237#: reference_raster.xml:5662 reference_raster.xml:5805 1238#: reference_raster.xml:5848 reference_raster.xml:5891 1239#: reference_raster.xml:5956 reference_raster.xml:6004 1240#: reference_raster.xml:6263 reference_raster.xml:6704 1241#: reference_raster.xml:7709 reference_raster.xml:8172 1242#: reference_raster.xml:8420 reference_raster.xml:8691 1243#: reference_raster.xml:8763 reference_raster.xml:8830 1244#: reference_raster.xml:8992 reference_raster.xml:9048 1245#: reference_raster.xml:9115 reference_raster.xml:9186 1246#: reference_raster.xml:9261 reference_raster.xml:9496 1247#: reference_raster.xml:9629 reference_raster.xml:9680 1248#: reference_raster.xml:9729 reference_raster.xml:9772 1249#: reference_raster.xml:9828 reference_raster.xml:9873 1250#: reference_raster.xml:9917 reference_raster.xml:9956 1251#: reference_raster.xml:10034 reference_raster.xml:10078 1252#: reference_raster.xml:10123 reference_raster.xml:10286 1253#: reference_raster.xml:10442 reference_raster.xml:10529 1254#: reference_raster.xml:10610 reference_raster.xml:10691 1255#: reference_raster.xml:10772 reference_raster.xml:10904 1256#: reference_raster.xml:10985 reference_raster.xml:11065 1257#: reference_raster.xml:11222 reference_raster.xml:11309 1258#: reference_raster.xml:11404 reference_raster.xml:11497 1259#, no-c-format 1260msgid "Examples" 1261msgstr "Esempi" 1262 1263#. Tag: programlisting 1264#: reference_raster.xml:722 1265#, no-c-format 1266msgid "" 1267"SELECT DropRasterConstraints ('myrasters','rast');\n" 1268"----RESULT output ---\n" 1269"t\n" 1270"\n" 1271"-- verify change in raster_columns --\n" 1272"SELECT srid, scale_x, scale_y, blocksize_x, blocksize_y, num_bands, " 1273"pixel_types, nodata_values\n" 1274" FROM raster_columns\n" 1275" WHERE r_table_name = 'myrasters';\n" 1276"\n" 1277" srid | scale_x | scale_y | blocksize_x | blocksize_y | num_bands | " 1278"pixel_types| nodata_values\n" 1279"------+---------+---------+-------------+-------------+-----------" 1280"+-------------+---------------\n" 1281" 0 | | | | | " 1282"| |" 1283msgstr "" 1284 1285#. Tag: refname 1286#: reference_raster.xml:733 1287#, no-c-format 1288msgid "AddOverviewConstraints" 1289msgstr "" 1290 1291#. Tag: refpurpose 1292#: reference_raster.xml:735 1293#, no-c-format 1294msgid "Tag a raster column as being an overview of another." 1295msgstr "" 1296 1297#. Tag: funcsynopsis 1298#: reference_raster.xml:739 1299#, no-c-format 1300msgid "" 1301"<funcprototype> <funcdef>boolean <function>AddOverviewConstraints</" 1302"function></funcdef> <paramdef><type>name </type> <parameter>ovschema</" 1303"parameter></paramdef> <paramdef><type>name </type> <parameter>ovtable</" 1304"parameter></paramdef> <paramdef><type>name </type> <parameter>ovcolumn</" 1305"parameter></paramdef> <paramdef><type>name </type> <parameter>refschema</" 1306"parameter></paramdef> <paramdef><type>name </type> <parameter>reftable</" 1307"parameter></paramdef> <paramdef><type>name </type> <parameter>refcolumn</" 1308"parameter></paramdef> <paramdef><type>int </type> <parameter>ovfactor</" 1309"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>boolean " 1310"<function>AddOverviewConstraints</function></funcdef> <paramdef><type>name </" 1311"type> <parameter>ovtable</parameter></paramdef> <paramdef><type>name </type> " 1312"<parameter>ovcolumn</parameter></paramdef> <paramdef><type>name </type> " 1313"<parameter>reftable</parameter></paramdef> <paramdef><type>name </type> " 1314"<parameter>refcolumn</parameter></paramdef> <paramdef><type>int </type> " 1315"<parameter>ovfactor</parameter></paramdef> </funcprototype>" 1316msgstr "" 1317 1318#. Tag: para 1319#: reference_raster.xml:779 1320#, no-c-format 1321msgid "" 1322"Adds constraints on a raster column that are used to display information in " 1323"the <varname>raster_overviews</varname> raster catalog." 1324msgstr "" 1325 1326#. Tag: para 1327#: reference_raster.xml:783 1328#, no-c-format 1329msgid "" 1330"The <varname>ovfactor</varname> parameter represents the scale multiplier in " 1331"the overview column: higher overview factors have lower resolution." 1332msgstr "" 1333 1334#. Tag: para 1335#: reference_raster.xml:787 1336#, no-c-format 1337msgid "" 1338"When the <varname>ovschema</varname> and <varname>refschema</varname> " 1339"parameters are omitted, the first table found scanning the " 1340"<varname>search_path</varname> will be used." 1341msgstr "" 1342 1343#. Tag: programlisting 1344#: reference_raster.xml:799 1345#, no-c-format 1346msgid "" 1347"CREATE TABLE res1 AS SELECT\n" 1348"ST_AddBand(\n" 1349" ST_MakeEmptyRaster(1000, 1000, 0, 0, 2),\n" 1350" 1, '8BSI'::text, -129, NULL\n" 1351") r1;\n" 1352"\n" 1353"CREATE TABLE res2 AS SELECT\n" 1354"ST_AddBand(\n" 1355" ST_MakeEmptyRaster(500, 500, 0, 0, 4),\n" 1356" 1, '8BSI'::text, -129, NULL\n" 1357") r2;\n" 1358"\n" 1359"SELECT AddOverviewConstraints('res2', 'r2', 'res1', 'r1', 2);\n" 1360"\n" 1361"-- verify if registered correctly in the raster_overviews view --\n" 1362"SELECT o_table_name ot, o_raster_column oc,\n" 1363" r_table_name rt, r_raster_column rc,\n" 1364" overview_factor f\n" 1365"FROM raster_overviews WHERE o_table_name = 'res2';\n" 1366" ot | oc | rt | rc | f\n" 1367"------+----+------+----+---\n" 1368" res2 | r2 | res1 | r1 | 2\n" 1369"(1 row)" 1370msgstr "" 1371 1372#. Tag: para 1373#: reference_raster.xml:805 1374#, no-c-format 1375msgid "" 1376", <xref linkend=\"RT_DropOverviewConstraints\"/>, <xref linkend=" 1377"\"RT_CreateOverview\"/>, <xref linkend=\"RT_AddRasterConstraints\"/>" 1378msgstr "" 1379 1380#. Tag: refname 1381#: reference_raster.xml:816 1382#, no-c-format 1383msgid "DropOverviewConstraints" 1384msgstr "" 1385 1386#. Tag: refpurpose 1387#: reference_raster.xml:818 1388#, no-c-format 1389msgid "Untag a raster column from being an overview of another." 1390msgstr "" 1391 1392#. Tag: funcsynopsis 1393#: reference_raster.xml:822 1394#, no-c-format 1395msgid "" 1396"<funcprototype> <funcdef>boolean <function>DropOverviewConstraints</" 1397"function></funcdef> <paramdef><type>name </type> <parameter>ovschema</" 1398"parameter></paramdef> <paramdef><type>name </type> <parameter>ovtable</" 1399"parameter></paramdef> <paramdef><type>name </type> <parameter>ovcolumn</" 1400"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>boolean " 1401"<function>DropOverviewConstraints</function></funcdef> <paramdef><type>name " 1402"</type> <parameter>ovtable</parameter></paramdef> <paramdef><type>name </" 1403"type> <parameter>ovcolumn</parameter></paramdef> </funcprototype>" 1404msgstr "" 1405 1406#. Tag: para 1407#: reference_raster.xml:848 1408#, no-c-format 1409msgid "" 1410"Remove from a raster column the constraints used to show it as being an " 1411"overview of another in the <varname>raster_overviews</varname> raster " 1412"catalog." 1413msgstr "" 1414 1415#. Tag: para 1416#: reference_raster.xml:853 1417#, no-c-format 1418msgid "" 1419"When the <varname>ovschema</varname> parameter is omitted, the first table " 1420"found scanning the <varname>search_path</varname> will be used." 1421msgstr "" 1422 1423#. Tag: para 1424#: reference_raster.xml:865 1425#, no-c-format 1426msgid "" 1427", <xref linkend=\"RT_AddOverviewConstraints\"/>, <xref linkend=" 1428"\"RT_DropRasterConstraints\"/>" 1429msgstr "" 1430 1431#. Tag: refname 1432#: reference_raster.xml:875 1433#, no-c-format 1434msgid "PostGIS_GDAL_Version" 1435msgstr "" 1436 1437#. Tag: refpurpose 1438#: reference_raster.xml:876 1439#, no-c-format 1440msgid "Reports the version of the GDAL library in use by PostGIS." 1441msgstr "" 1442 1443#. Tag: funcprototype 1444#: reference_raster.xml:881 1445#, no-c-format 1446msgid "" 1447"<funcdef>text <function>PostGIS_GDAL_Version</function></funcdef> " 1448"<paramdef></paramdef>" 1449msgstr "" 1450 1451#. Tag: para 1452#: reference_raster.xml:890 1453#, no-c-format 1454msgid "" 1455"Reports the version of the GDAL library in use by PostGIS. Will also check " 1456"and report if GDAL can find its data files." 1457msgstr "" 1458 1459#. Tag: programlisting 1460#: reference_raster.xml:895 1461#, fuzzy, no-c-format 1462msgid "" 1463"SELECT PostGIS_GDAL_Version();\n" 1464" postgis_gdal_version\n" 1465"-----------------------------------\n" 1466" GDAL 1.11dev, released 2013/04/13" 1467msgstr "" 1468"SELECT PostGIS_Raster_Lib_Version();\n" 1469"postgis_raster_lib_version\n" 1470"-----------------------------\n" 1471" 2.0.0" 1472 1473#. Tag: refname 1474#: reference_raster.xml:908 1475#, no-c-format 1476msgid "PostGIS_Raster_Lib_Build_Date" 1477msgstr "PostGIS_Raster_Lib_Build_Date" 1478 1479#. Tag: refpurpose 1480#: reference_raster.xml:910 1481#, no-c-format 1482msgid "Reports full raster library build date." 1483msgstr "" 1484 1485#. Tag: funcprototype 1486#: reference_raster.xml:915 1487#, no-c-format 1488msgid "" 1489"<funcdef>text <function>PostGIS_Raster_Lib_Build_Date</function></funcdef> " 1490"<paramdef></paramdef>" 1491msgstr "" 1492"<funcdef>text <function>PostGIS_Raster_Lib_Build_Date</function></funcdef> " 1493"<paramdef></paramdef>" 1494 1495#. Tag: para 1496#: reference_raster.xml:926 1497#, no-c-format 1498msgid "Reports raster build date" 1499msgstr "" 1500 1501#. Tag: programlisting 1502#: reference_raster.xml:932 1503#, no-c-format 1504msgid "" 1505"SELECT PostGIS_Raster_Lib_Build_Date();\n" 1506"postgis_raster_lib_build_date\n" 1507"-----------------------------\n" 1508"2010-04-28 21:15:10" 1509msgstr "" 1510"SELECT PostGIS_Raster_Lib_Build_Date();\n" 1511"postgis_raster_lib_build_date\n" 1512"-----------------------------\n" 1513"2010-04-28 21:15:10" 1514 1515#. Tag: refname 1516#: reference_raster.xml:944 1517#, no-c-format 1518msgid "PostGIS_Raster_Lib_Version" 1519msgstr "PostGIS_Raster_Lib_Version" 1520 1521#. Tag: refpurpose 1522#: reference_raster.xml:946 1523#, no-c-format 1524msgid "" 1525"<refpurpose>Reports full raster version and build configuration infos.</" 1526"refpurpose>" 1527msgstr "" 1528 1529#. Tag: funcprototype 1530#: reference_raster.xml:952 1531#, no-c-format 1532msgid "" 1533"<funcdef>text <function>PostGIS_Raster_Lib_Version</function></funcdef> " 1534"<paramdef></paramdef>" 1535msgstr "" 1536"<funcdef>text <function>PostGIS_Raster_Lib_Version</function></funcdef> " 1537"<paramdef></paramdef>" 1538 1539#. Tag: para 1540#: reference_raster.xml:963 1541#, no-c-format 1542msgid "<para>Reports full raster version and build configuration infos.</para>" 1543msgstr "" 1544 1545#. Tag: programlisting 1546#: reference_raster.xml:970 1547#, no-c-format 1548msgid "" 1549"SELECT PostGIS_Raster_Lib_Version();\n" 1550"postgis_raster_lib_version\n" 1551"-----------------------------\n" 1552" 2.0.0" 1553msgstr "" 1554"SELECT PostGIS_Raster_Lib_Version();\n" 1555"postgis_raster_lib_version\n" 1556"-----------------------------\n" 1557" 2.0.0" 1558 1559#. Tag: refname 1560#: reference_raster.xml:984 1561#, no-c-format 1562msgid "ST_GDALDrivers" 1563msgstr "ST_GDALDrivers" 1564 1565#. Tag: refpurpose 1566#: reference_raster.xml:986 1567#, no-c-format 1568msgid "" 1569"Returns a list of raster formats supported by PostGIS through GDAL. Only " 1570"those formats with can_write=True can be used by ST_AsGDALRaster" 1571msgstr "" 1572 1573#. Tag: funcprototype 1574#: reference_raster.xml:991 1575#, fuzzy, no-c-format 1576msgid "" 1577"<funcdef>setof record <function>ST_GDALDrivers</function></funcdef> " 1578"<paramdef><type>integer </type> <parameter>OUT idx</parameter></paramdef> " 1579"<paramdef><type>text </type> <parameter>OUT short_name</parameter></" 1580"paramdef> <paramdef><type>text </type> <parameter>OUT long_name</parameter></" 1581"paramdef> <paramdef><type>text </type> <parameter>OUT can_read</parameter></" 1582"paramdef> <paramdef><type>text </type> <parameter>OUT can_write</parameter></" 1583"paramdef> <paramdef><type>text </type> <parameter>OUT create_options</" 1584"parameter></paramdef>" 1585msgstr "" 1586"<funcdef>setof record <function>ST_GDALDrivers</function></funcdef> " 1587"<paramdef><type>integer </type> <parameter>OUT idx</parameter></paramdef> " 1588"<paramdef><type>text </type> <parameter>OUT short_name</parameter></" 1589"paramdef> <paramdef><type>text </type> <parameter>OUT long_name</parameter></" 1590"paramdef> <paramdef><type>text </type> <parameter>OUT create_options</" 1591"parameter></paramdef>" 1592 1593#. Tag: para 1594#: reference_raster.xml:1006 1595#, no-c-format 1596msgid "" 1597"Returns a list of raster formats short_name,long_name and creator options of " 1598"each format supported by GDAL. Use the short_name as input in the " 1599"<varname>format</varname> parameter of <xref linkend=\"RT_ST_AsGDALRaster\"/" 1600">. Options vary depending on what drivers your libgdal was compiled with. " 1601"<varname>create_options</varname> returns an xml formatted set of " 1602"CreationOptionList/Option consisting of name and optional <varname>type</" 1603"varname>, <varname>description</varname> and set of <varname>VALUE</varname> " 1604"for each creator option for the specific driver." 1605msgstr "" 1606 1607#. Tag: para 1608#: reference_raster.xml:1011 1609#, no-c-format 1610msgid "Changed: 2.5.0 - add can_read and can_write columns." 1611msgstr "" 1612 1613#. Tag: para 1614#: reference_raster.xml:1012 1615#, no-c-format 1616msgid "" 1617"Changed: 2.0.6, 2.1.3 - by default no drivers are enabled, unless GUC or " 1618"Environment variable gdal_enabled_drivers is set." 1619msgstr "" 1620 1621#. Tag: para 1622#: reference_raster.xml:1013 reference_raster.xml:1454 1623#: reference_raster.xml:6060 reference_raster.xml:6168 1624#: reference_raster.xml:6259 reference_raster.xml:6339 1625#, no-c-format 1626msgid "Availability: 2.0.0 - requires GDAL >= 1.6.0." 1627msgstr "" 1628 1629#. Tag: title 1630#: reference_raster.xml:1018 1631#, no-c-format 1632msgid "Examples: List of Drivers" 1633msgstr "" 1634 1635#. Tag: programlisting 1636#: reference_raster.xml:1020 1637#, no-c-format 1638msgid "" 1639"SET postgis.gdal_enabled_drivers = 'ENABLE_ALL';\n" 1640"SELECT short_name, long_name, can_write\n" 1641"FROM st_gdaldrivers()\n" 1642"ORDER BY short_name;\n" 1643"\n" 1644" short_name | " 1645"long_name | can_write\n" 1646"-----------------" 1647"+-------------------------------------------------------------+-----------\n" 1648" AAIGrid | Arc/Info ASCII " 1649"Grid | t\n" 1650" ACE2 | " 1651"ACE2 | f\n" 1652" ADRG | ARC Digitized Raster " 1653"Graphics | f\n" 1654" AIG | Arc/Info Binary " 1655"Grid | f\n" 1656" AirSAR | AirSAR Polarimetric " 1657"Image | f\n" 1658" ARG | Azavea Raster Grid " 1659"format | t\n" 1660" BAG | Bathymetry Attributed " 1661"Grid | f\n" 1662" BIGGIF | Graphics Interchange Format (." 1663"gif) | f\n" 1664" BLX | Magellan topo (." 1665"blx) | t\n" 1666" BMP | MS Windows Device Independent " 1667"Bitmap | f\n" 1668" BSB | Maptech BSB Nautical " 1669"Charts | f\n" 1670" PAux | PCI .aux " 1671"Labelled | f\n" 1672" PCIDSK | PCIDSK Database " 1673"File | f\n" 1674" PCRaster | PCRaster Raster " 1675"File | f\n" 1676" PDF | Geospatial " 1677"PDF | f\n" 1678" PDS | NASA Planetary Data " 1679"System | f\n" 1680" PDS4 | NASA Planetary Data System " 1681"4 | t\n" 1682" PLMOSAIC | Planet Labs Mosaics " 1683"API | f\n" 1684" PLSCENES | Planet Labs Scenes " 1685"API | f\n" 1686" PNG | Portable Network " 1687"Graphics | t\n" 1688" PNM | Portable Pixmap Format " 1689"(netpbm) | f\n" 1690" PRF | Racurs PHOTOMOD " 1691"PRF | f\n" 1692" R | R Object Data " 1693"Store | t\n" 1694" Rasterlite | " 1695"Rasterlite | t\n" 1696" RDA | DigitalGlobe Raster Data Access " 1697"driver | f\n" 1698" RIK | Swedish Grid RIK (." 1699"rik) | f\n" 1700" RMF | Raster Matrix " 1701"Format | f\n" 1702" ROI_PAC | ROI_PAC " 1703"raster | f\n" 1704" RPFTOC | Raster Product Format TOC " 1705"format | f\n" 1706" RRASTER | R " 1707"Raster | f\n" 1708" RS2 | RadarSat 2 XML " 1709"Product | f\n" 1710" RST | Idrisi Raster " 1711"A.1 | t\n" 1712" SAFE | Sentinel-1 SAR SAFE " 1713"Product | f\n" 1714" SAGA | SAGA GIS Binary Grid (.sdat, .sg-grd-" 1715"z) | t\n" 1716" SAR_CEOS | CEOS SAR " 1717"Image | f\n" 1718" SDTS | SDTS " 1719"Raster | f\n" 1720" SENTINEL2 | Sentinel " 1721"2 | f\n" 1722" SGI | SGI Image File Format " 1723"1.0 | f\n" 1724" SNODAS | Snow Data Assimilation " 1725"System | f\n" 1726" SRP | Standard Raster Product (ASRP/" 1727"USRP) | f\n" 1728" SRTMHGT | SRTMHGT File " 1729"Format | t\n" 1730" Terragen | Terragen " 1731"heightfield | f\n" 1732" TIL | EarthWatch ." 1733"TIL | f\n" 1734" TSX | TerraSAR-X " 1735"Product | f\n" 1736" USGSDEM | USGS Optional ASCII DEM (and " 1737"CDED) | t\n" 1738" VICAR | MIPL VICAR " 1739"file | f\n" 1740" VRT | Virtual " 1741"Raster | t\n" 1742" WCS | OGC Web Coverage " 1743"Service | f\n" 1744" WMS | OGC Web Map " 1745"Service | t\n" 1746" WMTS | OGC Web Map Tile " 1747"Service | t\n" 1748" XPM | X11 PixMap " 1749"Format | t\n" 1750" XYZ | ASCII Gridded " 1751"XYZ | t\n" 1752" ZMap | ZMap Plus " 1753"Grid | t" 1754msgstr "" 1755 1756#. Tag: title 1757#: reference_raster.xml:1022 1758#, no-c-format 1759msgid "Example: List of options for each driver" 1760msgstr "" 1761 1762#. Tag: programlisting 1763#: reference_raster.xml:1023 1764#, no-c-format 1765msgid "" 1766"-- Output the create options XML column of JPEG as a table --\n" 1767"-- Note you can use these creator options in ST_AsGDALRaster options " 1768"argument\n" 1769"SELECT (xpath('@name', g.opt))[1]::text As oname,\n" 1770" (xpath('@type', g.opt))[1]::text As otype,\n" 1771" (xpath('@description', g.opt))[1]::text As descrip\n" 1772"FROM (SELECT unnest(xpath('/CreationOptionList/Option', create_options::" 1773"xml)) As opt\n" 1774"FROM st_gdaldrivers()\n" 1775"WHERE short_name = 'JPEG') As g;\n" 1776"\n" 1777" oname | otype | descrip\n" 1778"--------------------+---------" 1779"+-------------------------------------------------\n" 1780" PROGRESSIVE | boolean | whether to generate a progressive JPEG\n" 1781" QUALITY | int | good=100, bad=0, default=75\n" 1782" WORLDFILE | boolean | whether to geneate a worldfile\n" 1783" INTERNAL_MASK | boolean | whether to generate a validity mask\n" 1784" COMMENT | string | Comment\n" 1785" SOURCE_ICC_PROFILE | string | ICC profile encoded in Base64\n" 1786" EXIF_THUMBNAIL | boolean | whether to generate an EXIF " 1787"thumbnail(overview).\n" 1788" By default its max dimension will be 128\n" 1789" THUMBNAIL_WIDTH | int | Forced thumbnail width\n" 1790" THUMBNAIL_HEIGHT | int | Forced thumbnail height\n" 1791"(9 rows)" 1792msgstr "" 1793 1794#. Tag: programlisting 1795#: reference_raster.xml:1025 1796#, no-c-format 1797msgid "" 1798"-- raw xml output for creator options for GeoTiff --\n" 1799"SELECT create_options\n" 1800"FROM st_gdaldrivers()\n" 1801"WHERE short_name = 'GTiff';\n" 1802"\n" 1803"<![CDATA[<CreationOptionList>\n" 1804" <Option name=\"COMPRESS\" type=\"string-select\">\n" 1805" <Value>NONE</Value>\n" 1806" <Value>LZW</Value>\n" 1807" <Value>PACKBITS</Value>\n" 1808" <Value>JPEG</Value>\n" 1809" <Value>CCITTRLE</Value>\n" 1810" <Value>CCITTFAX3</Value>\n" 1811" <Value>CCITTFAX4</Value>\n" 1812" <Value>DEFLATE</Value>\n" 1813" </Option>\n" 1814" <Option name=\"PREDICTOR\" type=\"int\" description=\"Predictor Type\"/" 1815">\n" 1816" <Option name=\"JPEG_QUALITY\" type=\"int\" description=\"JPEG quality " 1817"1-100\" default=\"75\"/>\n" 1818" <Option name=\"ZLEVEL\" type=\"int\" description=\"DEFLATE compression " 1819"level 1-9\" default=\"6\"/>\n" 1820" <Option name=\"NBITS\" type=\"int\" description=\"BITS for sub-byte " 1821"files (1-7), sub-uint16 (9-15), sub-uint32 (17-31)\"/>\n" 1822" <Option name=\"INTERLEAVE\" type=\"string-select\" default=\"PIXEL\">\n" 1823" <Value>BAND</Value>\n" 1824" <Value>PIXEL</Value>\n" 1825" </Option>\n" 1826" <Option name=\"TILED\" type=\"boolean\" description=\"Switch to tiled " 1827"format\"/>\n" 1828" <Option name=\"TFW\" type=\"boolean\" description=\"Write out world file" 1829"\"/>\n" 1830" <Option name=\"RPB\" type=\"boolean\" description=\"Write out .RPB (RPC) " 1831"file\"/>\n" 1832" <Option name=\"BLOCKXSIZE\" type=\"int\" description=\"Tile Width\"/>\n" 1833" <Option name=\"BLOCKYSIZE\" type=\"int\" description=\"Tile/Strip Height" 1834"\"/>\n" 1835" <Option name=\"PHOTOMETRIC\" type=\"string-select\">\n" 1836" <Value>MINISBLACK</Value>\n" 1837" <Value>MINISWHITE</Value>\n" 1838" <Value>PALETTE</Value>\n" 1839" <Value>RGB</Value>\n" 1840" <Value>CMYK</Value>\n" 1841" <Value>YCBCR</Value>\n" 1842" <Value>CIELAB</Value>\n" 1843" <Value>ICCLAB</Value>\n" 1844" <Value>ITULAB</Value>\n" 1845" </Option>\n" 1846" <Option name=\"SPARSE_OK\" type=\"boolean\" description=\"Can newly " 1847"created files have missing blocks?\" default=\"FALSE\"/>\n" 1848" <Option name=\"ALPHA\" type=\"boolean\" description=\"Mark first " 1849"extrasample as being alpha\"/>\n" 1850" <Option name=\"PROFILE\" type=\"string-select\" default=\"GDALGeoTIFF" 1851"\">\n" 1852" <Value>GDALGeoTIFF</Value>\n" 1853" <Value>GeoTIFF</Value>\n" 1854" <Value>BASELINE</Value>\n" 1855" </Option>\n" 1856" <Option name=\"PIXELTYPE\" type=\"string-select\">\n" 1857" <Value>DEFAULT</Value>\n" 1858" <Value>SIGNEDBYTE</Value>\n" 1859" </Option>\n" 1860" <Option name=\"BIGTIFF\" type=\"string-select\" description=\"Force " 1861"creation of BigTIFF file\">\n" 1862" <Value>YES</Value>\n" 1863" <Value>NO</Value>\n" 1864" <Value>IF_NEEDED</Value>\n" 1865" <Value>IF_SAFER</Value>\n" 1866" </Option>\n" 1867" <Option name=\"ENDIANNESS\" type=\"string-select\" default=\"NATIVE\" " 1868"description=\"Force endianness of created file. For DEBUG purpose mostly\">\n" 1869" <Value>NATIVE</Value>\n" 1870" <Value>INVERTED</Value>\n" 1871" <Value>LITTLE</Value>\n" 1872" <Value>BIG</Value>\n" 1873" </Option>\n" 1874" <Option name=\"COPY_SRC_OVERVIEWS\" type=\"boolean\" default=\"NO\" " 1875"description=\"Force copy of overviews of source dataset (CreateCopy())\"/>\n" 1876"</CreationOptionList>]]>\n" 1877"\n" 1878"-- Output the create options XML column for GTiff as a table --\n" 1879"SELECT (xpath('@name', g.opt))[1]::text As oname,\n" 1880" (xpath('@type', g.opt))[1]::text As otype,\n" 1881" (xpath('@description', g.opt))[1]::text As descrip,\n" 1882" array_to_string(xpath('Value/text()', g.opt),', ') As vals\n" 1883"FROM (SELECT unnest(xpath('/CreationOptionList/Option', create_options::" 1884"xml)) As opt\n" 1885"FROM st_gdaldrivers()\n" 1886"WHERE short_name = 'GTiff') As g;\n" 1887"\n" 1888" oname | otype | " 1889"descrip | " 1890"vals\n" 1891"--------------------+---------------" 1892"+----------------------------------------------------------------------" 1893"+---------------------------------------------------------------------------\n" 1894" COMPRESS | string-select " 1895"| | " 1896"NONE, LZW, PACKBITS, JPEG, CCITTRLE, CCITTFAX3, CCITTFAX4, DEFLATE\n" 1897" PREDICTOR | int | Predictor " 1898"Type |\n" 1899" JPEG_QUALITY | int | JPEG quality " 1900"1-100 |\n" 1901" ZLEVEL | int | DEFLATE compression level " 1902"1-9 |\n" 1903" NBITS | int | BITS for sub-byte files (1-7), sub-" 1904"uint16 (9-15), sub-uint32 (17-31) |\n" 1905" INTERLEAVE | string-select " 1906"| | " 1907"BAND, PIXEL\n" 1908" TILED | boolean | Switch to tiled " 1909"format |\n" 1910" TFW | boolean | Write out world " 1911"file |\n" 1912" RPB | boolean | Write out .RPB (RPC) " 1913"file |\n" 1914" BLOCKXSIZE | int | Tile " 1915"Width |\n" 1916" BLOCKYSIZE | int | Tile/Strip " 1917"Height |\n" 1918" PHOTOMETRIC | string-select " 1919"| | " 1920"MINISBLACK, MINISWHITE, PALETTE, RGB, CMYK, YCBCR, CIELAB, ICCLAB, ITULAB\n" 1921" SPARSE_OK | boolean | Can newly created files have missing " 1922"blocks? |\n" 1923" ALPHA | boolean | Mark first extrasample as being " 1924"alpha |\n" 1925" PROFILE | string-select " 1926"| | " 1927"GDALGeoTIFF, GeoTIFF, BASELINE\n" 1928" PIXELTYPE | string-select " 1929"| | " 1930"DEFAULT, SIGNEDBYTE\n" 1931" BIGTIFF | string-select | Force creation of BigTIFF " 1932"file | YES, NO, IF_NEEDED, IF_SAFER\n" 1933" ENDIANNESS | string-select | Force endianness of created file. For " 1934"DEBUG purpose mostly | NATIVE, INVERTED, LITTLE, BIG\n" 1935" COPY_SRC_OVERVIEWS | boolean | Force copy of overviews of source " 1936"dataset (CreateCopy()) |\n" 1937"(19 rows)" 1938msgstr "" 1939 1940#. Tag: para 1941#: reference_raster.xml:1031 1942#, no-c-format 1943msgid "" 1944", <xref linkend=\"ST_SRID\"/>, <xref linkend=\"postgis_gdal_enabled_drivers" 1945"\"/>" 1946msgstr "" 1947 1948#. Tag: refname 1949#: reference_raster.xml:1037 1950#, no-c-format 1951msgid "UpdateRasterSRID" 1952msgstr "" 1953 1954#. Tag: refpurpose 1955#: reference_raster.xml:1038 1956#, no-c-format 1957msgid "Change the SRID of all rasters in the user-specified column and table." 1958msgstr "" 1959 1960#. Tag: funcsynopsis 1961#: reference_raster.xml:1044 1962#, no-c-format 1963msgid "" 1964"<funcprototype> <funcdef>raster <function>UpdateRasterSRID</function></" 1965"funcdef> <paramdef><type>name </type> <parameter>schema_name</parameter></" 1966"paramdef> <paramdef><type>name </type> <parameter>table_name</parameter></" 1967"paramdef> <paramdef><type>name </type> <parameter>column_name</parameter></" 1968"paramdef> <paramdef><type>integer </type> <parameter>new_srid</parameter></" 1969"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 1970"<function>UpdateRasterSRID</function></funcdef> <paramdef><type>name </type> " 1971"<parameter>table_name</parameter></paramdef> <paramdef><type>name </type> " 1972"<parameter>column_name</parameter></paramdef> <paramdef><type>integer </" 1973"type> <parameter>new_srid</parameter></paramdef> </funcprototype>" 1974msgstr "" 1975 1976#. Tag: para 1977#: reference_raster.xml:1067 1978#, no-c-format 1979msgid "" 1980"Change the SRID of all rasters in the user-specified column and table. The " 1981"function will drop all appropriate column constraints (extent, alignment and " 1982"SRID) before changing the SRID of the specified column's rasters." 1983msgstr "" 1984 1985#. Tag: para 1986#: reference_raster.xml:1072 1987#, no-c-format 1988msgid "" 1989"The data (band pixel values) of the rasters are not touched by this " 1990"function. Only the raster's metadata is changed." 1991msgstr "" 1992 1993#. Tag: para 1994#: reference_raster.xml:1077 reference_raster.xml:1747 1995#: reference_raster.xml:1848 reference_raster.xml:2298 1996#: reference_raster.xml:2593 reference_raster.xml:2748 1997#: reference_raster.xml:3391 reference_raster.xml:3445 1998#: reference_raster.xml:3489 reference_raster.xml:3543 1999#: reference_raster.xml:3700 reference_raster.xml:3797 2000#: reference_raster.xml:3982 reference_raster.xml:4085 2001#: reference_raster.xml:4182 reference_raster.xml:6700 2002#: reference_raster.xml:7294 reference_raster.xml:7485 2003#: reference_raster.xml:8759 reference_raster.xml:9044 2004#: reference_raster.xml:9492 reference_raster.xml:9625 2005#: reference_raster.xml:9676 reference_raster.xml:9913 2006#: reference_raster.xml:10166 reference_raster.xml:10438 2007#: reference_raster.xml:10525 reference_raster.xml:10606 2008#: reference_raster.xml:10687 reference_raster.xml:10768 2009#: reference_raster.xml:10981 reference_raster.xml:11061 2010#: reference_raster.xml:11218 reference_raster.xml:11305 2011#: reference_raster.xml:11400 reference_raster.xml:11493 2012#, no-c-format 2013msgid "Availability: 2.1.0" 2014msgstr "" 2015 2016#. Tag: refname 2017#: reference_raster.xml:1089 2018#, no-c-format 2019msgid "ST_CreateOverview" 2020msgstr "" 2021 2022#. Tag: refpurpose 2023#: reference_raster.xml:1090 2024#, no-c-format 2025msgid "Create an reduced resolution version of a given raster coverage." 2026msgstr "" 2027 2028#. Tag: funcprototype 2029#: reference_raster.xml:1098 2030#, no-c-format 2031msgid "" 2032"<funcdef>regclass <function>ST_CreateOverview</function></funcdef> " 2033"<paramdef><type>regclass </type> <parameter>tab</parameter></paramdef> " 2034"<paramdef><type>name </type> <parameter>col</parameter></paramdef> " 2035"<paramdef><type>int </type> <parameter>factor</parameter></paramdef> " 2036"<paramdef choice=\"opt\"><type>text </type> " 2037"<parameter>algo='NearestNeighbor'</parameter></paramdef>" 2038msgstr "" 2039 2040#. Tag: para 2041#: reference_raster.xml:1112 2042#, no-c-format 2043msgid "" 2044"Create an overview table with resampled tiles from the source table. Output " 2045"tiles will have the same size of input tiles and cover the same spatial " 2046"extent with a lower resolution (pixel size will be 1/<varname>factor</" 2047"varname> of the original in both directions)." 2048msgstr "" 2049 2050#. Tag: para 2051#: reference_raster.xml:1119 2052#, no-c-format 2053msgid "" 2054"The overview table will be made available in the <varname>raster_overviews</" 2055"varname> catalog and will have raster constraints enforced." 2056msgstr "" 2057 2058#. Tag: para 2059#: reference_raster.xml:1125 reference_raster.xml:1806 2060#: reference_raster.xml:4892 2061#, no-c-format 2062msgid "" 2063"Algorithm options are: 'NearestNeighbor', 'Bilinear', 'Cubic', " 2064"'CubicSpline', and 'Lanczos'. Refer to: <ulink url=\"http://www.gdal.org/" 2065"gdalwarp.html\">GDAL Warp resampling methods</ulink> for more details." 2066msgstr "" 2067 2068#. Tag: para 2069#: reference_raster.xml:1127 reference_raster.xml:1808 2070#: reference_raster.xml:2007 reference_raster.xml:5279 2071#: reference_raster.xml:5658 2072#, no-c-format 2073msgid "Availability: 2.2.0" 2074msgstr "" 2075 2076#. Tag: title 2077#: reference_raster.xml:1130 2078#, fuzzy, no-c-format 2079msgid "Example" 2080msgstr "Esempi" 2081 2082#. Tag: para 2083#: reference_raster.xml:1131 2084#, no-c-format 2085msgid "Output to generally better quality but slower to product format" 2086msgstr "" 2087 2088#. Tag: programlisting 2089#: reference_raster.xml:1132 2090#, no-c-format 2091msgid "" 2092"SELECT ST_CreateOverview('mydata.mytable'::regclass, 'rast', 2, 'Lanczos');" 2093msgstr "" 2094 2095#. Tag: para 2096#: reference_raster.xml:1134 2097#, no-c-format 2098msgid "Output to faster to process default nearest neighbor" 2099msgstr "" 2100 2101#. Tag: programlisting 2102#: reference_raster.xml:1135 2103#, no-c-format 2104msgid "SELECT ST_CreateOverview('mydata.mytable'::regclass, 'rast', 2);" 2105msgstr "" 2106 2107#. Tag: para 2108#: reference_raster.xml:1140 2109#, no-c-format 2110msgid "" 2111", <xref linkend=\"RT_AddOverviewConstraints\"/>, <xref linkend=" 2112"\"RT_AddRasterConstraints\"/>, <xref linkend=\"RT_Raster_Overviews\"/>" 2113msgstr "" 2114 2115#. Tag: title 2116#: reference_raster.xml:1151 2117#, no-c-format 2118msgid "Raster Constructors" 2119msgstr "" 2120 2121#. Tag: refname 2122#: reference_raster.xml:1155 2123#, no-c-format 2124msgid "ST_AddBand" 2125msgstr "ST_AddBand" 2126 2127#. Tag: refpurpose 2128#: reference_raster.xml:1156 2129#, no-c-format 2130msgid "" 2131"Returns a raster with the new band(s) of given type added with given initial " 2132"value in the given index location. If no index is specified, the band is " 2133"added to the end." 2134msgstr "" 2135 2136#. Tag: funcsynopsis 2137#: reference_raster.xml:1162 2138#, no-c-format 2139msgid "" 2140"<funcprototype> <funcdef>(1) raster <function>ST_AddBand</function></" 2141"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 2142"paramdef> <paramdef><type>addbandarg[] </type> <parameter>addbandargset</" 2143"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>(2) raster " 2144"<function>ST_AddBand</function></funcdef> <paramdef><type>raster </type> " 2145"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 2146"<parameter>index</parameter></paramdef> <paramdef><type>text </type> " 2147"<parameter>pixeltype</parameter></paramdef> <paramdef choice=\"opt" 2148"\"><type>double precision </type> <parameter>initialvalue=0</parameter></" 2149"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 2150"<parameter>nodataval=NULL</parameter></paramdef> </funcprototype> " 2151"<funcprototype> <funcdef>(3) raster <function>ST_AddBand</function></" 2152"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 2153"paramdef> <paramdef><type>text </type> <parameter>pixeltype</parameter></" 2154"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 2155"<parameter>initialvalue=0</parameter></paramdef> <paramdef choice=\"opt" 2156"\"><type>double precision </type> <parameter>nodataval=NULL</parameter></" 2157"paramdef> </funcprototype> <funcprototype> <funcdef>(4) raster " 2158"<function>ST_AddBand</function></funcdef> <paramdef><type>raster </type> " 2159"<parameter>torast</parameter></paramdef> <paramdef><type>raster </type> " 2160"<parameter>fromrast</parameter></paramdef> <paramdef choice=\"opt" 2161"\"><type>integer </type> <parameter>fromband=1</parameter></paramdef> " 2162"<paramdef choice=\"opt\"><type>integer </type> " 2163"<parameter>torastindex=at_end</parameter></paramdef> </funcprototype> " 2164"<funcprototype> <funcdef>(5) raster <function>ST_AddBand</function></" 2165"funcdef> <paramdef><type>raster </type> <parameter>torast</parameter></" 2166"paramdef> <paramdef><type>raster[] </type> <parameter>fromrasts</parameter></" 2167"paramdef> <paramdef choice=\"opt\"><type>integer </type> " 2168"<parameter>fromband=1</parameter></paramdef> <paramdef choice=\"opt" 2169"\"><type>integer </type> <parameter>torastindex=at_end</parameter></" 2170"paramdef> </funcprototype> <funcprototype> <funcdef>(6) raster " 2171"<function>ST_AddBand</function></funcdef> <paramdef><type>raster </type> " 2172"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 2173"<parameter>index</parameter></paramdef> <paramdef><type>text </type> " 2174"<parameter>outdbfile</parameter></paramdef> <paramdef><type>integer[] </" 2175"type> <parameter>outdbindex</parameter></paramdef> <paramdef choice=\"opt" 2176"\"><type>double precision </type> <parameter>nodataval=NULL</parameter></" 2177"paramdef> </funcprototype> <funcprototype> <funcdef>(7) raster " 2178"<function>ST_AddBand</function></funcdef> <paramdef><type>raster </type> " 2179"<parameter>rast</parameter></paramdef> <paramdef><type>text </type> " 2180"<parameter>outdbfile</parameter></paramdef> <paramdef><type>integer[] </" 2181"type> <parameter>outdbindex</parameter></paramdef> <paramdef choice=\"opt" 2182"\"><type>integer </type> <parameter>index=at_end</parameter></paramdef> " 2183"<paramdef choice=\"opt\"><type>double precision </type> " 2184"<parameter>nodataval=NULL</parameter></paramdef> </funcprototype>" 2185msgstr "" 2186 2187#. Tag: para 2188#: reference_raster.xml:1227 2189#, no-c-format 2190msgid "" 2191"Returns a raster with a new band added in given position (index), of given " 2192"type, of given initial value, and of given nodata value. If no index is " 2193"specified, the band is added to the end. If no <varname>fromband</varname> " 2194"is specified, band 1 is assumed. Pixel type is a string representation of " 2195"one of the pixel types specified in <xref linkend=\"RT_ST_BandPixelType\"/>. " 2196"If an existing index is specified all subsequent bands >= that index are " 2197"incremented by 1. If an initial value greater than the max of the pixel type " 2198"is specified, then the initial value is set to the highest value allowed by " 2199"the pixel type." 2200msgstr "" 2201 2202#. Tag: para 2203#: reference_raster.xml:1231 2204#, no-c-format 2205msgid "" 2206"For the variant that takes an array of <xref linkend=\"addbandarg\"/> " 2207"(Variant 1), a specific addbandarg's index value is relative to the raster " 2208"at the time when the band described by that addbandarg is being added to the " 2209"raster. See the Multiple New Bands example below." 2210msgstr "" 2211 2212#. Tag: para 2213#: reference_raster.xml:1235 2214#, no-c-format 2215msgid "" 2216"For the variant that takes an array of rasters (Variant 5), if " 2217"<varname>torast</varname> is NULL then the <varname>fromband</varname> band " 2218"of each raster in the array is accumulated into a new raster." 2219msgstr "" 2220 2221#. Tag: para 2222#: reference_raster.xml:1239 2223#, no-c-format 2224msgid "" 2225"For the variants that take <varname>outdbfile</varname> (Variants 6 and 7), " 2226"the value must include the full path to the raster file. The file must also " 2227"be accessible to the postgres server process." 2228msgstr "" 2229 2230#. Tag: para 2231#: reference_raster.xml:1243 2232#, no-c-format 2233msgid "Enhanced: 2.1.0 support for addbandarg added." 2234msgstr "" 2235 2236#. Tag: para 2237#: reference_raster.xml:1244 2238#, no-c-format 2239msgid "Enhanced: 2.1.0 support for new out-db bands added." 2240msgstr "" 2241 2242#. Tag: title 2243#: reference_raster.xml:1248 2244#, no-c-format 2245msgid "Examples: Single New Band" 2246msgstr "" 2247 2248#. Tag: programlisting 2249#: reference_raster.xml:1250 2250#, no-c-format 2251msgid "" 2252"-- Add another band of type 8 bit unsigned integer with pixels initialized " 2253"to 200\n" 2254"UPDATE dummy_rast\n" 2255" SET rast = ST_AddBand(rast,'8BUI'::text,200)\n" 2256"WHERE rid = 1;" 2257msgstr "" 2258 2259#. Tag: programlisting 2260#: reference_raster.xml:1252 2261#, no-c-format 2262msgid "" 2263"-- Create an empty raster 100x100 units, with upper left right at 0, add 2 " 2264"bands (band 1 is 0/1 boolean bit switch, band2 allows values 0-15)\n" 2265"-- uses addbandargs\n" 2266"INSERT INTO dummy_rast(rid,rast)\n" 2267" VALUES(10, ST_AddBand(ST_MakeEmptyRaster(100, 100, 0, 0, 1, -1, 0, 0, " 2268"0),\n" 2269" ARRAY[\n" 2270" ROW(1, '1BB'::text, 0, NULL),\n" 2271" ROW(2, '4BUI'::text, 0, NULL)\n" 2272" ]::addbandarg[]\n" 2273" )\n" 2274" );\n" 2275"\n" 2276"-- output meta data of raster bands to verify all is right --\n" 2277"SELECT (bmd).*\n" 2278"FROM (SELECT ST_BandMetaData(rast,generate_series(1,2)) As bmd\n" 2279" FROM dummy_rast WHERE rid = 10) AS foo;\n" 2280" --result --\n" 2281" pixeltype | nodatavalue | isoutdb | path\n" 2282"-----------+----------------+-------------+---------+------\n" 2283" 1BB | | f |\n" 2284" 4BUI | | f |\n" 2285"\n" 2286"\n" 2287"-- output meta data of raster -\n" 2288"SELECT (rmd).width, (rmd).height, (rmd).numbands\n" 2289"FROM (SELECT ST_MetaData(rast) As rmd\n" 2290" FROM dummy_rast WHERE rid = 10) AS foo;\n" 2291"-- result --\n" 2292" upperleftx | upperlefty | width | height | scalex | scaley | skewx | skewy " 2293"| srid | numbands\n" 2294"------------+------------+-------+--------+------------+------------+-------" 2295"+-------+------+----------\n" 2296" 0 | 0 | 100 | 100 | 1 | -1 | 0 | 0 " 2297"| 0 | 2" 2298msgstr "" 2299 2300#. Tag: title 2301#: reference_raster.xml:1256 2302#, no-c-format 2303msgid "Examples: Multiple New Bands" 2304msgstr "" 2305 2306#. Tag: programlisting 2307#: reference_raster.xml:1258 2308#, fuzzy, no-c-format 2309msgid "" 2310"SELECT\n" 2311" *\n" 2312"FROM ST_BandMetadata(\n" 2313" ST_AddBand(\n" 2314" ST_MakeEmptyRaster(10, 10, 0, 0, 1, -1, 0, 0, 0),\n" 2315" ARRAY[\n" 2316" ROW(NULL, '8BUI', 255, 0),\n" 2317" ROW(NULL, '16BUI', 1, 2),\n" 2318" ROW(2, '32BUI', 100, 12),\n" 2319" ROW(2, '32BF', 3.14, -1)\n" 2320" ]::addbandarg[]\n" 2321" ),\n" 2322" ARRAY[]::integer[]\n" 2323");\n" 2324"\n" 2325" bandnum | pixeltype | nodatavalue | isoutdb | path\n" 2326"---------+-----------+-------------+---------+------\n" 2327" 1 | 8BUI | 0 | f |\n" 2328" 2 | 32BF | -1 | f |\n" 2329" 3 | 32BUI | 12 | f |\n" 2330" 4 | 16BUI | 2 | f |" 2331msgstr "" 2332"SELECT\n" 2333" *\n" 2334"FROM ST_BandMetadata(\n" 2335" ST_AddBand(\n" 2336" ST_MakeEmptyRaster(10, 10, 0, 0, 1, -1, 0, 0, 0),\n" 2337" ARRAY[\n" 2338" ROW(NULL, '8BUI', 255, 0),\n" 2339" ROW(NULL, '16BUI', 1, 2),\n" 2340" ROW(2, '32BUI', 100, 12),\n" 2341" ROW(2, '32BF', 3.14, -1)\n" 2342" ]::addbandarg[]\n" 2343" ),\n" 2344" ARRAY[]::integer[]\n" 2345");\n" 2346"\n" 2347" bandnum | pixeltype | nodatavalue | isoutdb | path \n" 2348"---------+-----------+-------------+---------+------\n" 2349" 1 | 8BUI | 0 | f | \n" 2350" 2 | 32BF | -1 | f | \n" 2351" 3 | 32BUI | 12 | f | \n" 2352" 4 | 16BUI | 2 | f |" 2353 2354#. Tag: programlisting 2355#: reference_raster.xml:1260 2356#, no-c-format 2357msgid "" 2358"-- Aggregate the 1st band of a table of like rasters into a single raster\n" 2359"-- with as many bands as there are test_types and as many rows (new rasters) " 2360"as there are mice\n" 2361"-- NOTE: The ORDER BY test_type is only supported in PostgreSQL 9.0+\n" 2362"-- for 8.4 and below it usually works to order your data in a subselect (but " 2363"not guaranteed)\n" 2364"-- The resulting raster will have a band for each test_type alphabetical by " 2365"test_type\n" 2366"-- For mouse lovers: No mice were harmed in this exercise\n" 2367"SELECT\n" 2368" mouse,\n" 2369" ST_AddBand(NULL, array_agg(rast ORDER BY test_type), 1) As rast\n" 2370"FROM mice_studies\n" 2371"GROUP BY mouse;" 2372msgstr "" 2373 2374#. Tag: title 2375#: reference_raster.xml:1264 2376#, no-c-format 2377msgid "Examples: New Out-db band" 2378msgstr "" 2379 2380#. Tag: programlisting 2381#: reference_raster.xml:1265 2382#, fuzzy, no-c-format 2383msgid "" 2384"SELECT\n" 2385" *\n" 2386"FROM ST_BandMetadata(\n" 2387" ST_AddBand(\n" 2388" ST_MakeEmptyRaster(10, 10, 0, 0, 1, -1, 0, 0, 0),\n" 2389" '/home/raster/mytestraster.tif'::text, NULL::int[]\n" 2390" ),\n" 2391" ARRAY[]::integer[]\n" 2392");\n" 2393"\n" 2394" bandnum | pixeltype | nodatavalue | isoutdb | path\n" 2395"---------+-----------+-------------+---------+------\n" 2396" 1 | 8BUI | | t | /home/raster/mytestraster." 2397"tif\n" 2398" 2 | 8BUI | | t | /home/raster/mytestraster." 2399"tif\n" 2400" 3 | 8BUI | | t | /home/raster/mytestraster.tif" 2401msgstr "" 2402"SELECT\n" 2403" *\n" 2404"FROM ST_BandMetadata(\n" 2405" ST_AddBand(\n" 2406" ST_MakeEmptyRaster(10, 10, 0, 0, 1, -1, 0, 0, 0),\n" 2407" ARRAY[\n" 2408" ROW(NULL, '8BUI', 255, 0),\n" 2409" ROW(NULL, '16BUI', 1, 2),\n" 2410" ROW(2, '32BUI', 100, 12),\n" 2411" ROW(2, '32BF', 3.14, -1)\n" 2412" ]::addbandarg[]\n" 2413" ),\n" 2414" ARRAY[]::integer[]\n" 2415");\n" 2416"\n" 2417" bandnum | pixeltype | nodatavalue | isoutdb | path \n" 2418"---------+-----------+-------------+---------+------\n" 2419" 1 | 8BUI | 0 | f | \n" 2420" 2 | 32BF | -1 | f | \n" 2421" 3 | 32BUI | 12 | f | \n" 2422" 4 | 16BUI | 2 | f |" 2423 2424#. Tag: para 2425#: reference_raster.xml:1270 2426#, no-c-format 2427msgid "" 2428", <xref linkend=\"RT_ST_BandPixelType\"/>, <xref linkend=" 2429"\"RT_ST_MakeEmptyRaster\"/>, <xref linkend=\"RT_ST_MetaData\"/>, <xref " 2430"linkend=\"RT_ST_NumBands\"/>, <xref linkend=\"RT_ST_Reclass\"/>" 2431msgstr "" 2432", <xref linkend=\"RT_ST_BandPixelType\"/>, <xref linkend=" 2433"\"RT_ST_MakeEmptyRaster\"/>, <xref linkend=\"RT_ST_MetaData\"/>, <xref " 2434"linkend=\"RT_ST_NumBands\"/>, <xref linkend=\"RT_ST_Reclass\"/>" 2435 2436#. Tag: refname 2437#: reference_raster.xml:1283 2438#, no-c-format 2439msgid "ST_AsRaster" 2440msgstr "ST_AsRaster" 2441 2442#. Tag: refpurpose 2443#: reference_raster.xml:1284 2444#, no-c-format 2445msgid "Converts a PostGIS geometry to a PostGIS raster." 2446msgstr "" 2447 2448#. Tag: funcsynopsis 2449#: reference_raster.xml:1288 2450#, no-c-format 2451msgid "" 2452"<funcprototype> <funcdef>raster <function>ST_AsRaster</function></funcdef> " 2453"<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef> " 2454"<paramdef><type>raster </type> <parameter>ref</parameter></paramdef> " 2455"<paramdef><type>text </type> <parameter>pixeltype</parameter></paramdef> " 2456"<paramdef choice=\"opt\"><type>double precision </type> <parameter>value=1</" 2457"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2458"type> <parameter>nodataval=0</parameter></paramdef> <paramdef choice=\"opt" 2459"\"><type>boolean </type> <parameter>touched=false</parameter></paramdef> </" 2460"funcprototype> <funcprototype> <funcdef>raster <function>ST_AsRaster</" 2461"function></funcdef> <paramdef><type>geometry </type> <parameter>geom</" 2462"parameter></paramdef> <paramdef><type>raster </type> <parameter>ref</" 2463"parameter></paramdef> <paramdef choice=\"opt\"><type>text[] </type> " 2464"<parameter>pixeltype=ARRAY['8BUI']</parameter></paramdef> <paramdef choice=" 2465"\"opt\"><type>double precision[] </type> <parameter>value=ARRAY[1]</" 2466"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision[] </" 2467"type> <parameter>nodataval=ARRAY[0]</parameter></paramdef> <paramdef choice=" 2468"\"opt\"><type>boolean </type> <parameter>touched=false</parameter></" 2469"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 2470"<function>ST_AsRaster</function></funcdef> <paramdef><type>geometry </type> " 2471"<parameter>geom</parameter></paramdef> <paramdef><type>double precision </" 2472"type> <parameter>scalex</parameter></paramdef> <paramdef><type>double " 2473"precision </type> <parameter>scaley</parameter></paramdef> " 2474"<paramdef><type>double precision </type> <parameter>gridx</parameter></" 2475"paramdef> <paramdef><type>double precision </type> <parameter>gridy</" 2476"parameter></paramdef> <paramdef><type>text </type> <parameter>pixeltype</" 2477"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2478"type> <parameter>value=1</parameter></paramdef> <paramdef choice=\"opt" 2479"\"><type>double precision </type> <parameter>nodataval=0</parameter></" 2480"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 2481"<parameter>skewx=0</parameter></paramdef> <paramdef choice=\"opt" 2482"\"><type>double precision </type> <parameter>skewy=0</parameter></paramdef> " 2483"<paramdef choice=\"opt\"><type>boolean </type> <parameter>touched=false</" 2484"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 2485"<function>ST_AsRaster</function></funcdef> <paramdef><type>geometry </type> " 2486"<parameter>geom</parameter></paramdef> <paramdef><type>double precision </" 2487"type> <parameter>scalex</parameter></paramdef> <paramdef><type>double " 2488"precision </type> <parameter>scaley</parameter></paramdef> <paramdef choice=" 2489"\"opt\"><type>double precision </type> <parameter>gridx=NULL</parameter></" 2490"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 2491"<parameter>gridy=NULL</parameter></paramdef> <paramdef choice=\"opt" 2492"\"><type>text[] </type> <parameter>pixeltype=ARRAY['8BUI']</parameter></" 2493"paramdef> <paramdef choice=\"opt\"><type>double precision[] </type> " 2494"<parameter>value=ARRAY[1]</parameter></paramdef> <paramdef choice=\"opt" 2495"\"><type>double precision[] </type> <parameter>nodataval=ARRAY[0]</" 2496"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2497"type> <parameter>skewx=0</parameter></paramdef> <paramdef choice=\"opt" 2498"\"><type>double precision </type> <parameter>skewy=0</parameter></paramdef> " 2499"<paramdef choice=\"opt\"><type>boolean </type> <parameter>touched=false</" 2500"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 2501"<function>ST_AsRaster</function></funcdef> <paramdef><type>geometry </type> " 2502"<parameter>geom</parameter></paramdef> <paramdef><type>double precision </" 2503"type> <parameter>scalex</parameter></paramdef> <paramdef><type>double " 2504"precision </type> <parameter>scaley</parameter></paramdef> " 2505"<paramdef><type>text </type> <parameter>pixeltype</parameter></paramdef> " 2506"<paramdef choice=\"opt\"><type>double precision </type> <parameter>value=1</" 2507"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2508"type> <parameter>nodataval=0</parameter></paramdef> <paramdef choice=\"opt" 2509"\"><type>double precision </type> <parameter>upperleftx=NULL</parameter></" 2510"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 2511"<parameter>upperlefty=NULL</parameter></paramdef> <paramdef choice=\"opt" 2512"\"><type>double precision </type> <parameter>skewx=0</parameter></paramdef> " 2513"<paramdef choice=\"opt\"><type>double precision </type> <parameter>skewy=0</" 2514"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 2515"<parameter>touched=false</parameter></paramdef> </funcprototype> " 2516"<funcprototype> <funcdef>raster <function>ST_AsRaster</function></funcdef> " 2517"<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef> " 2518"<paramdef><type>double precision </type> <parameter>scalex</parameter></" 2519"paramdef> <paramdef><type>double precision </type> <parameter>scaley</" 2520"parameter></paramdef> <paramdef><type>text[] </type> <parameter>pixeltype</" 2521"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision[] </" 2522"type> <parameter>value=ARRAY[1]</parameter></paramdef> <paramdef choice=\"opt" 2523"\"><type>double precision[] </type> <parameter>nodataval=ARRAY[0]</" 2524"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2525"type> <parameter>upperleftx=NULL</parameter></paramdef> <paramdef choice=" 2526"\"opt\"><type>double precision </type> <parameter>upperlefty=NULL</" 2527"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2528"type> <parameter>skewx=0</parameter></paramdef> <paramdef choice=\"opt" 2529"\"><type>double precision </type> <parameter>skewy=0</parameter></paramdef> " 2530"<paramdef choice=\"opt\"><type>boolean </type> <parameter>touched=false</" 2531"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 2532"<function>ST_AsRaster</function></funcdef> <paramdef><type>geometry </type> " 2533"<parameter>geom</parameter></paramdef> <paramdef><type>integer </type> " 2534"<parameter>width</parameter></paramdef> <paramdef><type>integer </type> " 2535"<parameter>height</parameter></paramdef> <paramdef><type>double precision </" 2536"type> <parameter>gridx</parameter></paramdef> <paramdef><type>double " 2537"precision </type> <parameter>gridy</parameter></paramdef> " 2538"<paramdef><type>text </type> <parameter>pixeltype</parameter></paramdef> " 2539"<paramdef choice=\"opt\"><type>double precision </type> <parameter>value=1</" 2540"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2541"type> <parameter>nodataval=0</parameter></paramdef> <paramdef choice=\"opt" 2542"\"><type>double precision </type> <parameter>skewx=0</parameter></paramdef> " 2543"<paramdef choice=\"opt\"><type>double precision </type> <parameter>skewy=0</" 2544"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 2545"<parameter>touched=false</parameter></paramdef> </funcprototype> " 2546"<funcprototype> <funcdef>raster <function>ST_AsRaster</function></funcdef> " 2547"<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef> " 2548"<paramdef><type>integer </type> <parameter>width</parameter></paramdef> " 2549"<paramdef><type>integer </type> <parameter>height</parameter></paramdef> " 2550"<paramdef choice=\"opt\"><type>double precision </type> " 2551"<parameter>gridx=NULL</parameter></paramdef> <paramdef choice=\"opt" 2552"\"><type>double precision </type> <parameter>gridy=NULL</parameter></" 2553"paramdef> <paramdef><type>text[] </type> <parameter>pixeltype=ARRAY['8BUI']</" 2554"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision[] </" 2555"type> <parameter>value=ARRAY[1]</parameter></paramdef> <paramdef choice=\"opt" 2556"\"><type>double precision[] </type> <parameter>nodataval=ARRAY[0]</" 2557"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2558"type> <parameter>skewx=0</parameter></paramdef> <paramdef choice=\"opt" 2559"\"><type>double precision </type> <parameter>skewy=0</parameter></paramdef> " 2560"<paramdef choice=\"opt\"><type>boolean </type> <parameter>touched=false</" 2561"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 2562"<function>ST_AsRaster</function></funcdef> <paramdef><type>geometry </type> " 2563"<parameter>geom</parameter></paramdef> <paramdef><type>integer </type> " 2564"<parameter>width</parameter></paramdef> <paramdef><type>integer </type> " 2565"<parameter>height</parameter></paramdef> <paramdef><type>text </type> " 2566"<parameter>pixeltype</parameter></paramdef> <paramdef choice=\"opt" 2567"\"><type>double precision </type> <parameter>value=1</parameter></paramdef> " 2568"<paramdef choice=\"opt\"><type>double precision </type> " 2569"<parameter>nodataval=0</parameter></paramdef> <paramdef choice=\"opt" 2570"\"><type>double precision </type> <parameter>upperleftx=NULL</parameter></" 2571"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 2572"<parameter>upperlefty=NULL</parameter></paramdef> <paramdef choice=\"opt" 2573"\"><type>double precision </type> <parameter>skewx=0</parameter></paramdef> " 2574"<paramdef choice=\"opt\"><type>double precision </type> <parameter>skewy=0</" 2575"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 2576"<parameter>touched=false</parameter></paramdef> </funcprototype> " 2577"<funcprototype> <funcdef>raster <function>ST_AsRaster</function></funcdef> " 2578"<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef> " 2579"<paramdef><type>integer </type> <parameter>width</parameter></paramdef> " 2580"<paramdef><type>integer </type> <parameter>height</parameter></paramdef> " 2581"<paramdef><type>text[] </type> <parameter>pixeltype</parameter></paramdef> " 2582"<paramdef><type>double precision[] </type> <parameter>value=ARRAY[1]</" 2583"parameter></paramdef> <paramdef><type>double precision[] </type> " 2584"<parameter>nodataval=ARRAY[0]</parameter></paramdef> <paramdef choice=\"opt" 2585"\"><type>double precision </type> <parameter>upperleftx=NULL</parameter></" 2586"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 2587"<parameter>upperlefty=NULL</parameter></paramdef> <paramdef choice=\"opt" 2588"\"><type>double precision </type> <parameter>skewx=0</parameter></paramdef> " 2589"<paramdef choice=\"opt\"><type>double precision </type> <parameter>skewy=0</" 2590"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 2591"<parameter>touched=false</parameter></paramdef> </funcprototype>" 2592msgstr "" 2593"<funcprototype> <funcdef>raster <function>ST_AsRaster</function></funcdef> " 2594"<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef> " 2595"<paramdef><type>raster </type> <parameter>ref</parameter></paramdef> " 2596"<paramdef><type>text </type> <parameter>pixeltype</parameter></paramdef> " 2597"<paramdef choice=\"opt\"><type>double precision </type> <parameter>value=1</" 2598"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2599"type> <parameter>nodataval=0</parameter></paramdef> <paramdef choice=\"opt" 2600"\"><type>boolean </type> <parameter>touched=false</parameter></paramdef> </" 2601"funcprototype> <funcprototype> <funcdef>raster <function>ST_AsRaster</" 2602"function></funcdef> <paramdef><type>geometry </type> <parameter>geom</" 2603"parameter></paramdef> <paramdef><type>raster </type> <parameter>ref</" 2604"parameter></paramdef> <paramdef choice=\"opt\"><type>text[] </type> " 2605"<parameter>pixeltype=ARRAY['8BUI']</parameter></paramdef> <paramdef choice=" 2606"\"opt\"><type>double precision[] </type> <parameter>value=ARRAY[1]</" 2607"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision[] </" 2608"type> <parameter>nodataval=ARRAY[0]</parameter></paramdef> <paramdef choice=" 2609"\"opt\"><type>boolean </type> <parameter>touched=false</parameter></" 2610"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 2611"<function>ST_AsRaster</function></funcdef> <paramdef><type>geometry </type> " 2612"<parameter>geom</parameter></paramdef> <paramdef><type>double precision </" 2613"type> <parameter>scalex</parameter></paramdef> <paramdef><type>double " 2614"precision </type> <parameter>scaley</parameter></paramdef> " 2615"<paramdef><type>double precision </type> <parameter>gridx</parameter></" 2616"paramdef> <paramdef><type>double precision </type> <parameter>gridy</" 2617"parameter></paramdef> <paramdef><type>text </type> <parameter>pixeltype</" 2618"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2619"type> <parameter>value=1</parameter></paramdef> <paramdef choice=\"opt" 2620"\"><type>double precision </type> <parameter>nodataval=0</parameter></" 2621"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 2622"<parameter>skewx=0</parameter></paramdef> <paramdef choice=\"opt" 2623"\"><type>double precision </type> <parameter>skewy=0</parameter></paramdef> " 2624"<paramdef choice=\"opt\"><type>boolean </type> <parameter>touched=false</" 2625"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 2626"<function>ST_AsRaster</function></funcdef> <paramdef><type>geometry </type> " 2627"<parameter>geom</parameter></paramdef> <paramdef><type>double precision </" 2628"type> <parameter>scalex</parameter></paramdef> <paramdef><type>double " 2629"precision </type> <parameter>scaley</parameter></paramdef> <paramdef choice=" 2630"\"opt\"><type>double precision </type> <parameter>gridx=NULL</parameter></" 2631"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 2632"<parameter>gridy=NULL</parameter></paramdef> <paramdef choice=\"opt" 2633"\"><type>text[] </type> <parameter>pixeltype=ARRAY['8BUI']</parameter></" 2634"paramdef> <paramdef choice=\"opt\"><type>double precision[] </type> " 2635"<parameter>value=ARRAY[1]</parameter></paramdef> <paramdef choice=\"opt" 2636"\"><type>double precision[] </type> <parameter>nodataval=ARRAY[0]</" 2637"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2638"type> <parameter>skewx=0</parameter></paramdef> <paramdef choice=\"opt" 2639"\"><type>double precision </type> <parameter>skewy=0</parameter></paramdef> " 2640"<paramdef choice=\"opt\"><type>boolean </type> <parameter>touched=false</" 2641"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 2642"<function>ST_AsRaster</function></funcdef> <paramdef><type>geometry </type> " 2643"<parameter>geom</parameter></paramdef> <paramdef><type>double precision </" 2644"type> <parameter>scalex</parameter></paramdef> <paramdef><type>double " 2645"precision </type> <parameter>scaley</parameter></paramdef> " 2646"<paramdef><type>text </type> <parameter>pixeltype</parameter></paramdef> " 2647"<paramdef choice=\"opt\"><type>double precision </type> <parameter>value=1</" 2648"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2649"type> <parameter>nodataval=0</parameter></paramdef> <paramdef choice=\"opt" 2650"\"><type>double precision </type> <parameter>upperleftx=NULL</parameter></" 2651"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 2652"<parameter>upperlefty=NULL</parameter></paramdef> <paramdef choice=\"opt" 2653"\"><type>double precision </type> <parameter>skewx=0</parameter></paramdef> " 2654"<paramdef choice=\"opt\"><type>double precision </type> <parameter>skewy=0</" 2655"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 2656"<parameter>touched=false</parameter></paramdef> </funcprototype> " 2657"<funcprototype> <funcdef>raster <function>ST_AsRaster</function></funcdef> " 2658"<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef> " 2659"<paramdef><type>double precision </type> <parameter>scalex</parameter></" 2660"paramdef> <paramdef><type>double precision </type> <parameter>scaley</" 2661"parameter></paramdef> <paramdef><type>text[] </type> <parameter>pixeltype</" 2662"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision[] </" 2663"type> <parameter>value=ARRAY[1]</parameter></paramdef> <paramdef choice=\"opt" 2664"\"><type>double precision[] </type> <parameter>nodataval=ARRAY[0]</" 2665"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2666"type> <parameter>upperleftx=NULL</parameter></paramdef> <paramdef choice=" 2667"\"opt\"><type>double precision </type> <parameter>upperlefty=NULL</" 2668"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2669"type> <parameter>skewx=0</parameter></paramdef> <paramdef choice=\"opt" 2670"\"><type>double precision </type> <parameter>skewy=0</parameter></paramdef> " 2671"<paramdef choice=\"opt\"><type>boolean </type> <parameter>touched=false</" 2672"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 2673"<function>ST_AsRaster</function></funcdef> <paramdef><type>geometry </type> " 2674"<parameter>geom</parameter></paramdef> <paramdef><type>integer </type> " 2675"<parameter>width</parameter></paramdef> <paramdef><type>integer </type> " 2676"<parameter>height</parameter></paramdef> <paramdef><type>double precision </" 2677"type> <parameter>gridx</parameter></paramdef> <paramdef><type>double " 2678"precision </type> <parameter>gridy</parameter></paramdef> " 2679"<paramdef><type>text </type> <parameter>pixeltype</parameter></paramdef> " 2680"<paramdef choice=\"opt\"><type>double precision </type> <parameter>value=1</" 2681"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2682"type> <parameter>nodataval=0</parameter></paramdef> <paramdef choice=\"opt" 2683"\"><type>double precision </type> <parameter>skewx=0</parameter></paramdef> " 2684"<paramdef choice=\"opt\"><type>double precision </type> <parameter>skewy=0</" 2685"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 2686"<parameter>touched=false</parameter></paramdef> </funcprototype> " 2687"<funcprototype> <funcdef>raster <function>ST_AsRaster</function></funcdef> " 2688"<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef> " 2689"<paramdef><type>integer </type> <parameter>width</parameter></paramdef> " 2690"<paramdef><type>integer </type> <parameter>height</parameter></paramdef> " 2691"<paramdef choice=\"opt\"><type>double precision </type> " 2692"<parameter>gridx=NULL</parameter></paramdef> <paramdef choice=\"opt" 2693"\"><type>double precision </type> <parameter>gridy=NULL</parameter></" 2694"paramdef> <paramdef><type>text[] </type> <parameter>pixeltype=ARRAY['8BUI']</" 2695"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision[] </" 2696"type> <parameter>value=ARRAY[1]</parameter></paramdef> <paramdef choice=\"opt" 2697"\"><type>double precision[] </type> <parameter>nodataval=ARRAY[0]</" 2698"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 2699"type> <parameter>skewx=0</parameter></paramdef> <paramdef choice=\"opt" 2700"\"><type>double precision </type> <parameter>skewy=0</parameter></paramdef> " 2701"<paramdef choice=\"opt\"><type>boolean </type> <parameter>touched=false</" 2702"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 2703"<function>ST_AsRaster</function></funcdef> <paramdef><type>geometry </type> " 2704"<parameter>geom</parameter></paramdef> <paramdef><type>integer </type> " 2705"<parameter>width</parameter></paramdef> <paramdef><type>integer </type> " 2706"<parameter>height</parameter></paramdef> <paramdef><type>text </type> " 2707"<parameter>pixeltype</parameter></paramdef> <paramdef choice=\"opt" 2708"\"><type>double precision </type> <parameter>value=1</parameter></paramdef> " 2709"<paramdef choice=\"opt\"><type>double precision </type> " 2710"<parameter>nodataval=0</parameter></paramdef> <paramdef choice=\"opt" 2711"\"><type>double precision </type> <parameter>upperleftx=NULL</parameter></" 2712"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 2713"<parameter>upperlefty=NULL</parameter></paramdef> <paramdef choice=\"opt" 2714"\"><type>double precision </type> <parameter>skewx=0</parameter></paramdef> " 2715"<paramdef choice=\"opt\"><type>double precision </type> <parameter>skewy=0</" 2716"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 2717"<parameter>touched=false</parameter></paramdef> </funcprototype> " 2718"<funcprototype> <funcdef>raster <function>ST_AsRaster</function></funcdef> " 2719"<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef> " 2720"<paramdef><type>integer </type> <parameter>width</parameter></paramdef> " 2721"<paramdef><type>integer </type> <parameter>height</parameter></paramdef> " 2722"<paramdef><type>text[] </type> <parameter>pixeltype</parameter></paramdef> " 2723"<paramdef><type>double precision[] </type> <parameter>value=ARRAY[1]</" 2724"parameter></paramdef> <paramdef><type>double precision[] </type> " 2725"<parameter>nodataval=ARRAY[0]</parameter></paramdef> <paramdef choice=\"opt" 2726"\"><type>double precision </type> <parameter>upperleftx=NULL</parameter></" 2727"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 2728"<parameter>upperlefty=NULL</parameter></paramdef> <paramdef choice=\"opt" 2729"\"><type>double precision </type> <parameter>skewx=0</parameter></paramdef> " 2730"<paramdef choice=\"opt\"><type>double precision </type> <parameter>skewy=0</" 2731"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 2732"<parameter>touched=false</parameter></paramdef> </funcprototype>" 2733 2734#. Tag: para 2735#: reference_raster.xml:1436 2736#, no-c-format 2737msgid "" 2738"Converts a PostGIS geometry to a PostGIS raster. The many variants offers " 2739"three groups of possibilities for setting the alignment and pixelsize of the " 2740"resulting raster." 2741msgstr "" 2742 2743#. Tag: para 2744#: reference_raster.xml:1438 2745#, no-c-format 2746msgid "" 2747"The first group, composed of the two first variants, produce a raster having " 2748"the same alignment (<varname>scalex</varname>, <varname>scaley</varname>, " 2749"<varname>gridx</varname> and <varname>gridy</varname>), pixel type and " 2750"nodata value as the provided reference raster. You generally pass this " 2751"reference raster by joining the table containing the geometry with the table " 2752"containing the reference raster." 2753msgstr "" 2754 2755#. Tag: para 2756#: reference_raster.xml:1440 2757#, no-c-format 2758msgid "" 2759"The second group, composed of four variants, let you set the dimensions of " 2760"the raster by providing the parameters of a pixel size (<varname>scalex</" 2761"varname> & <varname>scaley</varname> and <varname>skewx</varname> & " 2762"<varname>skewy</varname>). The <varname>width</varname> & " 2763"<varname>height</varname> of the resulting raster will be adjusted to fit " 2764"the extent of the geometry. In most cases, you must cast integer " 2765"<varname>scalex</varname> & <varname>scaley</varname> arguments to " 2766"double precision so that PostgreSQL choose the right variant." 2767msgstr "" 2768 2769#. Tag: para 2770#: reference_raster.xml:1442 2771#, no-c-format 2772msgid "" 2773"The third group, composed of four variants, let you fix the dimensions of " 2774"the raster by providing the dimensions of the raster (<varname>width</" 2775"varname> & <varname>height</varname>). The parameters of the pixel size " 2776"(<varname>scalex</varname> & <varname>scaley</varname> and " 2777"<varname>skewx</varname> & <varname>skewy</varname>) of the resulting " 2778"raster will be adjusted to fit the extent of the geometry." 2779msgstr "" 2780 2781#. Tag: para 2782#: reference_raster.xml:1444 2783#, no-c-format 2784msgid "" 2785"The two first variants of each of those two last groups let you specify the " 2786"alignment with an arbitrary corner of the alignment grid (<varname>gridx</" 2787"varname> & <varname>gridy</varname>) and the two last variants takes the " 2788"upper left corner (<varname>upperleftx</varname> & <varname>upperlefty</" 2789"varname>)." 2790msgstr "" 2791 2792#. Tag: para 2793#: reference_raster.xml:1446 2794#, no-c-format 2795msgid "" 2796"Each group of variant allows producing a one band raster or a multiple bands " 2797"raster. To produce a multiple bands raster, you must provide an array of " 2798"pixel types (<varname>pixeltype[]</varname>), an array of initial values " 2799"(<varname>value</varname>) and an array of nodata values " 2800"(<varname>nodataval</varname>). If not provided pixeltyped defaults to 8BUI, " 2801"values to 1 and nodataval to 0." 2802msgstr "" 2803 2804#. Tag: para 2805#: reference_raster.xml:1448 2806#, no-c-format 2807msgid "" 2808"The output raster will be in the same spatial reference as the source " 2809"geometry. The only exception is for variants with a reference raster. In " 2810"this case the resulting raster will get the same SRID as the reference " 2811"raster." 2812msgstr "" 2813 2814#. Tag: para 2815#: reference_raster.xml:1450 2816#, no-c-format 2817msgid "" 2818"The optional <varname>touched</varname> parameter defaults to false and maps " 2819"to the GDAL ALL_TOUCHED rasterization option, which determines if pixels " 2820"touched by lines or polygons will be burned. Not just those on the line " 2821"render path, or whose center point is within the polygon." 2822msgstr "" 2823 2824#. Tag: para 2825#: reference_raster.xml:1452 2826#, no-c-format 2827msgid "" 2828"This is particularly useful for rendering jpegs and pngs of geometries " 2829"directly from the database when using in combination with <xref linkend=" 2830"\"RT_ST_AsPNG\"/> and other <xref linkend=\"RT_ST_AsGDALRaster\"/> family of " 2831"functions." 2832msgstr "" 2833 2834#. Tag: para 2835#: reference_raster.xml:1456 2836#, no-c-format 2837msgid "" 2838"Not yet capable of rendering complex geometry types such as curves, TINS, " 2839"and PolyhedralSurfaces, but should be able too once GDAL can." 2840msgstr "" 2841 2842#. Tag: title 2843#: reference_raster.xml:1461 2844#, no-c-format 2845msgid "Examples: Output geometries as PNG files" 2846msgstr "" 2847 2848#. Tag: para 2849#: reference_raster.xml:1467 2850#, no-c-format 2851msgid "black circle" 2852msgstr "" 2853 2854#. Tag: programlisting 2855#: reference_raster.xml:1470 2856#, no-c-format 2857msgid "" 2858"-- this will output a black circle taking up 150 x 150 pixels --\n" 2859"SELECT ST_AsPNG(ST_AsRaster(ST_Buffer(ST_Point(1,5),10),150, 150));" 2860msgstr "" 2861 2862#. Tag: para 2863#: reference_raster.xml:1477 2864#, no-c-format 2865msgid "example from buffer rendered with just PostGIS" 2866msgstr "" 2867 2868#. Tag: programlisting 2869#: reference_raster.xml:1481 2870#, no-c-format 2871msgid "" 2872"-- the bands map to RGB bands - the value (118,154,118) - teal --\n" 2873"SELECT ST_AsPNG(\n" 2874" ST_AsRaster(\n" 2875" ST_Buffer(\n" 2876" ST_GeomFromText('LINESTRING(50 50,150 150,150 50)'), " 2877"10,'join=bevel'),\n" 2878" 200,200,ARRAY['8BUI', '8BUI', '8BUI'], " 2879"ARRAY[118,154,118], ARRAY[0,0,0]));" 2880msgstr "" 2881 2882#. Tag: para 2883#: reference_raster.xml:1487 2884#, no-c-format 2885msgid "" 2886", <xref linkend=\"ST_Buffer\"/>, <xref linkend=\"RT_ST_GDALDrivers\"/>, " 2887"<xref linkend=\"RT_ST_AsGDALRaster\"/>, <xref linkend=\"RT_ST_AsPNG\"/>, " 2888"<xref linkend=\"RT_ST_AsJPEG\"/>, <xref linkend=\"RT_ST_SRID\"/>" 2889msgstr "" 2890", <xref linkend=\"ST_Buffer\"/>, <xref linkend=\"RT_ST_GDALDrivers\"/>, " 2891"<xref linkend=\"RT_ST_AsGDALRaster\"/>, <xref linkend=\"RT_ST_AsPNG\"/>, " 2892"<xref linkend=\"RT_ST_AsJPEG\"/>, <xref linkend=\"RT_ST_SRID\"/>" 2893 2894#. Tag: refname 2895#: reference_raster.xml:1493 2896#, no-c-format 2897msgid "ST_Band" 2898msgstr "ST_Band" 2899 2900#. Tag: refpurpose 2901#: reference_raster.xml:1494 2902#, no-c-format 2903msgid "" 2904"Returns one or more bands of an existing raster as a new raster. Useful for " 2905"building new rasters from existing rasters." 2906msgstr "" 2907 2908#. Tag: funcsynopsis 2909#: reference_raster.xml:1498 2910#, no-c-format 2911msgid "" 2912"<funcprototype> <funcdef>raster <function>ST_Band</function></funcdef> " 2913"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 2914"<paramdef choice=\"opt\"><type>integer[] </type> <parameter>nbands = " 2915"ARRAY[1]</parameter></paramdef> </funcprototype> <funcprototype> " 2916"<funcdef>raster <function>ST_Band</function></funcdef> " 2917"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 2918"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> </" 2919"funcprototype> <funcprototype> <funcdef>raster <function>ST_Band</function></" 2920"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 2921"paramdef> <paramdef><type>text </type> <parameter>nbands</parameter></" 2922"paramdef> <paramdef choice=\"opt\"><type>character </type> " 2923"<parameter>delimiter=,</parameter></paramdef> </funcprototype>" 2924msgstr "" 2925 2926#. Tag: para 2927#: reference_raster.xml:1523 2928#, no-c-format 2929msgid "" 2930"Returns one or more bands of an existing raster as a new raster. Useful for " 2931"building new rasters from existing rasters or export of only selected bands " 2932"of a raster or rearranging the order of bands in a raster. If no band is " 2933"specified or any of specified bands does not exist in the raster, then all " 2934"bands are returned. Used as a helper function in various functions such as " 2935"for deleting a band." 2936msgstr "" 2937 2938#. Tag: para 2939#: reference_raster.xml:1525 2940#, no-c-format 2941msgid "" 2942"For the <code>nbands</code> as text variant of function, the default " 2943"delimiter is <code>,</code> which means you can ask for <code>'1,2,3'</code> " 2944"and if you wanted to use a different delimeter you would do " 2945"<code>ST_Band(rast, '1@2@3', '@')</code>. For asking for multiple bands, we " 2946"strongly suggest you use the array form of this function e.g. " 2947"<code>ST_Band(rast, '{1,2,3}'::int[]);</code> since the <code>text</code> " 2948"list of bands form may be removed in future versions of PostGIS." 2949msgstr "" 2950 2951#. Tag: programlisting 2952#: reference_raster.xml:1533 2953#, no-c-format 2954msgid "" 2955"-- Make 2 new rasters: 1 containing band 1 of dummy, second containing band " 2956"2 of dummy and then reclassified as a 2BUI\n" 2957"SELECT ST_NumBands(rast1) As numb1, ST_BandPixelType(rast1) As pix1,\n" 2958" ST_NumBands(rast2) As numb2, ST_BandPixelType(rast2) As pix2\n" 2959"FROM (\n" 2960" SELECT ST_Band(rast) As rast1, ST_Reclass(ST_Band(rast,3), '100-200):1, " 2961"[200-254:2', '2BUI') As rast2\n" 2962" FROM dummy_rast\n" 2963" WHERE rid = 2) As foo;\n" 2964"\n" 2965" numb1 | pix1 | numb2 | pix2\n" 2966"-------+------+-------+------\n" 2967" 1 | 8BUI | 1 | 2BUI" 2968msgstr "" 2969 2970#. Tag: programlisting 2971#: reference_raster.xml:1535 2972#, no-c-format 2973msgid "" 2974"-- Return bands 2 and 3. Using array cast syntax\n" 2975"SELECT ST_NumBands(ST_Band(rast, '{2,3}'::int[])) As num_bands\n" 2976" FROM dummy_rast WHERE rid=2;\n" 2977"\n" 2978"num_bands\n" 2979"----------\n" 2980"2\n" 2981"\n" 2982"-- Return bands 2 and 3. Use array to define bands\n" 2983"SELECT ST_NumBands(ST_Band(rast, ARRAY[2,3])) As num_bands\n" 2984" FROM dummy_rast\n" 2985"WHERE rid=2;" 2986msgstr "" 2987 2988#. Tag: para 2989#: reference_raster.xml:1545 2990#, no-c-format 2991msgid "original (column rast)" 2992msgstr "original (column rast)" 2993 2994#. Tag: para 2995#: reference_raster.xml:1554 2996#, no-c-format 2997msgid "dupe_band" 2998msgstr "dupe_band" 2999 3000#. Tag: para 3001#: reference_raster.xml:1563 3002#, no-c-format 3003msgid "sing_band" 3004msgstr "sing_band" 3005 3006#. Tag: programlisting 3007#: reference_raster.xml:1571 3008#, no-c-format 3009msgid "" 3010"--Make a new raster with 2nd band of original and 1st band repeated twice,\n" 3011"and another with just the third band\n" 3012"SELECT rast, ST_Band(rast, ARRAY[2,1,1]) As dupe_band,\n" 3013" ST_Band(rast, 3) As sing_band\n" 3014"FROM samples.than_chunked\n" 3015"WHERE rid=35;" 3016msgstr "" 3017 3018#. Tag: para 3019#: reference_raster.xml:1577 3020#, no-c-format 3021msgid "" 3022", <xref linkend=\"RT_ST_NumBands\"/>, <xref linkend=\"RT_ST_Reclass\"/>, " 3023"<xref linkend=\"RT_reference\"/>" 3024msgstr "" 3025 3026#. Tag: refname 3027#: reference_raster.xml:1583 3028#, fuzzy, no-c-format 3029msgid "ST_MakeEmptyCoverage" 3030msgstr "ST_MakeEmptyRaster" 3031 3032#. Tag: refpurpose 3033#: reference_raster.xml:1584 3034#, no-c-format 3035msgid "Cover georeferenced area with a grid of empty raster tiles." 3036msgstr "" 3037 3038#. Tag: funcprototype 3039#: reference_raster.xml:1589 3040#, fuzzy, no-c-format 3041msgid "" 3042"<funcdef>raster <function>ST_MakeEmptyCoverage</function></funcdef> " 3043"<paramdef><type>integer </type> <parameter>tilewidth</parameter></paramdef> " 3044"<paramdef><type>integer </type> <parameter>tileheight</parameter></paramdef> " 3045"<paramdef><type>integer </type> <parameter>width</parameter></paramdef> " 3046"<paramdef><type>integer </type> <parameter>height</parameter></paramdef> " 3047"<paramdef><type>double precision </type> <parameter>upperleftx</parameter></" 3048"paramdef> <paramdef><type>double precision </type> <parameter>upperlefty</" 3049"parameter></paramdef> <paramdef><type>double precision </type> " 3050"<parameter>scalex</parameter></paramdef> <paramdef><type>double precision </" 3051"type> <parameter>scaley</parameter></paramdef> <paramdef><type>double " 3052"precision </type> <parameter>skewx</parameter></paramdef> " 3053"<paramdef><type>double precision </type> <parameter>skewy</parameter></" 3054"paramdef> <paramdef choice=\"opt\"><type>integer </type> " 3055"<parameter>srid=unknown</parameter></paramdef>" 3056msgstr "" 3057"<funcprototype> <funcdef>raster <function>ST_Rescale</function></funcdef> " 3058"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 3059"<paramdef><type>double precision </type> <parameter>scalexy</parameter></" 3060"paramdef> <paramdef choice=\"opt\"><type>text </type> " 3061"<parameter>algorithm=NearestNeighbour</parameter></paramdef> <paramdef " 3062"choice=\"opt\"><type>double precision </type> <parameter>maxerr=0.125</" 3063"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 3064"<function>ST_Rescale</function></funcdef> <paramdef><type>raster </type> " 3065"<parameter>rast</parameter></paramdef> <paramdef><type>double precision </" 3066"type> <parameter>scalex</parameter></paramdef> <paramdef><type>double " 3067"precision </type> <parameter>scaley</parameter></paramdef> <paramdef choice=" 3068"\"opt\"><type>text </type> <parameter>algorithm=NearestNeighbour</" 3069"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 3070"type> <parameter>maxerr=0.125</parameter></paramdef> </funcprototype>" 3071 3072#. Tag: para 3073#: reference_raster.xml:1609 3074#, no-c-format 3075msgid "" 3076"Create a set of raster tiles with <xref linkend=\"RT_ST_MakeEmptyRaster\"/>. " 3077"Grid dimension is <varname>width</varname> & <varname>height</varname>. " 3078"Tile dimension is <varname>tilewidth</varname> & <varname>tileheight</" 3079"varname>. The covered georeferenced area is from upper left corner " 3080"(<varname>upperleftx</varname>, <varname>upperlefty</varname>) to lower " 3081"right corner (<varname>upperleftx</varname> + <varname>width</varname> * " 3082"<varname>scalex</varname>, <varname>upperlefty</varname> + <varname>height</" 3083"varname> * <varname>scaley</varname>)." 3084msgstr "" 3085 3086#. Tag: para 3087#: reference_raster.xml:1610 3088#, no-c-format 3089msgid "" 3090"Note that scaley is generally negative for rasters and scalex is generally " 3091"positive. So lower right corner will have a lower y value and higher x value " 3092"than the upper left corner." 3093msgstr "" 3094 3095#. Tag: para 3096#: reference_raster.xml:1611 3097#, fuzzy, no-c-format 3098msgid "Availability: 2.4.0" 3099msgstr "Disponibilità: 2.0" 3100 3101#. Tag: title 3102#: reference_raster.xml:1615 reference_raster.xml:8518 3103#, no-c-format 3104msgid "Examples Basic" 3105msgstr "" 3106 3107#. Tag: para 3108#: reference_raster.xml:1616 3109#, no-c-format 3110msgid "" 3111"Create 16 tiles in a 4x4 grid to cover the WGS84 area from upper left corner " 3112"(22, 77) to lower right corner (55, 33)." 3113msgstr "" 3114 3115#. Tag: programlisting 3116#: reference_raster.xml:1617 3117#, no-c-format 3118msgid "" 3119"<![CDATA[SELECT (ST_MetaData(tile)).* FROM ST_MakeEmptyCoverage(1, 1, 4, 4, " 3120"22, 33, (55 - 22)/(4)::float, (33 - 77)/(4)::float, 0., 0., 4326) tile;\n" 3121"\n" 3122" upperleftx | upperlefty | width | height | scalex | scaley | skewx | skewy " 3123"| srid | numbands\n" 3124"-------------------------------------------------------------------------------------\n" 3125" 22 | 33 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3126"| 4326 | 0\n" 3127" 30.25 | 33 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3128"| 4326 | 0\n" 3129" 38.5 | 33 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3130"| 4326 | 0\n" 3131" 46.75 | 33 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3132"| 4326 | 0\n" 3133" 22 | 22 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3134"| 4326 | 0\n" 3135" 30.25 | 22 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3136"| 4326 | 0\n" 3137" 38.5 | 22 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3138"| 4326 | 0\n" 3139" 46.75 | 22 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3140"| 4326 | 0\n" 3141" 22 | 11 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3142"| 4326 | 0\n" 3143" 30.25 | 11 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3144"| 4326 | 0\n" 3145" 38.5 | 11 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3146"| 4326 | 0\n" 3147" 46.75 | 11 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3148"| 4326 | 0\n" 3149" 22 | 0 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3150"| 4326 | 0\n" 3151" 30.25 | 0 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3152"| 4326 | 0\n" 3153" 38.5 | 0 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3154"| 4326 | 0\n" 3155" 46.75 | 0 | 1 | 1 | 8.25 | -11 | 0 | 0 " 3156"| 4326 | 0]]>" 3157msgstr "" 3158 3159#. Tag: refname 3160#: reference_raster.xml:1630 3161#, no-c-format 3162msgid "ST_MakeEmptyRaster" 3163msgstr "ST_MakeEmptyRaster" 3164 3165#. Tag: refpurpose 3166#: reference_raster.xml:1631 3167#, no-c-format 3168msgid "" 3169"Returns an empty raster (having no bands) of given dimensions (width & " 3170"height), upperleft X and Y, pixel size and rotation (scalex, scaley, skewx " 3171"& skewy) and reference system (srid). If a raster is passed in, returns " 3172"a new raster with the same size, alignment and SRID. If srid is left out, " 3173"the spatial ref is set to unknown (0)." 3174msgstr "" 3175 3176#. Tag: funcsynopsis 3177#: reference_raster.xml:1635 3178#, no-c-format 3179msgid "" 3180"<funcprototype> <funcdef>raster <function>ST_MakeEmptyRaster</function></" 3181"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 3182"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 3183"<function>ST_MakeEmptyRaster</function></funcdef> <paramdef><type>integer </" 3184"type> <parameter>width</parameter></paramdef> <paramdef><type>integer </" 3185"type> <parameter>height</parameter></paramdef> <paramdef><type>float8 </" 3186"type> <parameter>upperleftx</parameter></paramdef> <paramdef><type>float8 </" 3187"type> <parameter>upperlefty</parameter></paramdef> <paramdef><type>float8 </" 3188"type> <parameter>scalex</parameter></paramdef> <paramdef><type>float8 </" 3189"type> <parameter>scaley</parameter></paramdef> <paramdef><type>float8 </" 3190"type> <parameter>skewx</parameter></paramdef> <paramdef><type>float8 </type> " 3191"<parameter>skewy</parameter></paramdef> <paramdef choice=\"opt" 3192"\"><type>integer </type> <parameter>srid=unknown</parameter></paramdef> </" 3193"funcprototype> <funcprototype> <funcdef>raster <function>ST_MakeEmptyRaster</" 3194"function></funcdef> <paramdef><type>integer </type> <parameter>width</" 3195"parameter></paramdef> <paramdef><type>integer </type> <parameter>height</" 3196"parameter></paramdef> <paramdef><type>float8 </type> <parameter>upperleftx</" 3197"parameter></paramdef> <paramdef><type>float8 </type> <parameter>upperlefty</" 3198"parameter></paramdef> <paramdef><type>float8 </type> <parameter>pixelsize</" 3199"parameter></paramdef> </funcprototype>" 3200msgstr "" 3201"<funcprototype> <funcdef>raster <function>ST_MakeEmptyRaster</function></" 3202"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 3203"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 3204"<function>ST_MakeEmptyRaster</function></funcdef> <paramdef><type>integer </" 3205"type> <parameter>width</parameter></paramdef> <paramdef><type>integer </" 3206"type> <parameter>height</parameter></paramdef> <paramdef><type>float8 </" 3207"type> <parameter>upperleftx</parameter></paramdef> <paramdef><type>float8 </" 3208"type> <parameter>upperlefty</parameter></paramdef> <paramdef><type>float8 </" 3209"type> <parameter>scalex</parameter></paramdef> <paramdef><type>float8 </" 3210"type> <parameter>scaley</parameter></paramdef> <paramdef><type>float8 </" 3211"type> <parameter>skewx</parameter></paramdef> <paramdef><type>float8 </type> " 3212"<parameter>skewy</parameter></paramdef> <paramdef choice=\"opt" 3213"\"><type>integer </type> <parameter>srid=unknown</parameter></paramdef> </" 3214"funcprototype> <funcprototype> <funcdef>raster <function>ST_MakeEmptyRaster</" 3215"function></funcdef> <paramdef><type>integer </type> <parameter>width</" 3216"parameter></paramdef> <paramdef><type>integer </type> <parameter>height</" 3217"parameter></paramdef> <paramdef><type>float8 </type> <parameter>upperleftx</" 3218"parameter></paramdef> <paramdef><type>float8 </type> <parameter>upperlefty</" 3219"parameter></paramdef> <paramdef><type>float8 </type> <parameter>pixelsize</" 3220"parameter></paramdef> </funcprototype>" 3221 3222#. Tag: para 3223#: reference_raster.xml:1665 3224#, no-c-format 3225msgid "" 3226"Returns an empty raster (having no band) of given dimensions (width & " 3227"height) and georeferenced in spatial (or world) coordinates with upper left " 3228"X (upperleftx), upper left Y (upperlefty), pixel size and rotation (scalex, " 3229"scaley, skewx & skewy) and reference system (srid)." 3230msgstr "" 3231 3232#. Tag: para 3233#: reference_raster.xml:1668 3234#, no-c-format 3235msgid "" 3236"The last version use a single parameter to specify the pixel size " 3237"(pixelsize). scalex is set to this argument and scaley is set to the " 3238"negative value of this argument. skewx and skewy are set to 0." 3239msgstr "" 3240 3241#. Tag: para 3242#: reference_raster.xml:1670 3243#, no-c-format 3244msgid "" 3245"If an existing raster is passed in, it returns a new raster with the same " 3246"meta data settings (without the bands)." 3247msgstr "" 3248 3249#. Tag: para 3250#: reference_raster.xml:1672 3251#, no-c-format 3252msgid "" 3253"If no srid is specified it defaults to 0. After you create an empty raster " 3254"you probably want to add bands to it and maybe edit it. Refer to <xref " 3255"linkend=\"RT_ST_AddBand\"/> to define bands and <xref linkend=" 3256"\"RT_ST_SetValue\"/> to set initial pixel values." 3257msgstr "" 3258 3259#. Tag: programlisting 3260#: reference_raster.xml:1679 3261#, fuzzy, no-c-format 3262msgid "" 3263"INSERT INTO dummy_rast(rid,rast)\n" 3264"VALUES(3, ST_MakeEmptyRaster( 100, 100, 0.0005, 0.0005, 1, 1, 0, 0, " 3265"4326) );\n" 3266"\n" 3267"--use an existing raster as template for new raster\n" 3268"INSERT INTO dummy_rast(rid,rast)\n" 3269"SELECT 4, ST_MakeEmptyRaster(rast)\n" 3270"FROM dummy_rast WHERE rid = 3;\n" 3271"\n" 3272"-- output meta data of rasters we just added\n" 3273"SELECT rid, (md).*\n" 3274"FROM (SELECT rid, ST_MetaData(rast) As md\n" 3275" FROM dummy_rast\n" 3276" WHERE rid IN(3,4)) As foo;\n" 3277"\n" 3278"-- output --\n" 3279" rid | upperleftx | upperlefty | width | height | scalex | scaley | skewx | " 3280"skewy | srid | numbands\n" 3281"-----+------------+------------+-------+--------+------------+------------" 3282"+-------+-------+------+----------\n" 3283" 3 | 0.0005 | 0.0005 | 100 | 100 | 1 | 1 " 3284"| 0 | 0 | 4326 | 0\n" 3285" 4 | 0.0005 | 0.0005 | 100 | 100 | 1 | 1 " 3286"| 0 | 0 | 4326 | 0" 3287msgstr "" 3288"SELECT rid, (foo.md).* \n" 3289" FROM (SELECT rid, ST_MetaData(rast) As md\n" 3290"FROM dummy_rast) As foo;\n" 3291"\n" 3292" rid | upperleftx | upperlefty | width | height | scalex | scaley | skewx | " 3293"skewy | srid | numbands\n" 3294" ----+------------+------------+-------+--------+--------+-----------+-------" 3295"+-------+------+-------\n" 3296" 1 | 0.5 | 0.5 | 10 | 20 | 2 | 3 " 3297"| 0 | 0 | 0 | 0\n" 3298" 2 | 3427927.75 | 5793244 | 5 | 5 | 0.05 | -0.05 " 3299"| 0 | 0 | 0 | 3" 3300 3301#. Tag: para 3302#: reference_raster.xml:1685 3303#, no-c-format 3304msgid "" 3305", <xref linkend=\"RT_ST_MetaData\"/>, <xref linkend=\"RT_ST_ScaleX\"/>, " 3306"<xref linkend=\"RT_ST_ScaleY\"/>, <xref linkend=\"RT_ST_SetValue\"/>, <xref " 3307"linkend=\"RT_ST_SkewX\"/>, , <xref linkend=\"RT_ST_SkewY\"/>" 3308msgstr "" 3309", <xref linkend=\"RT_ST_MetaData\"/>, <xref linkend=\"RT_ST_ScaleX\"/>, " 3310"<xref linkend=\"RT_ST_ScaleY\"/>, <xref linkend=\"RT_ST_SetValue\"/>, <xref " 3311"linkend=\"RT_ST_SkewX\"/>, , <xref linkend=\"RT_ST_SkewY\"/>" 3312 3313#. Tag: refname 3314#: reference_raster.xml:1692 3315#, no-c-format 3316msgid "ST_Tile" 3317msgstr "" 3318 3319#. Tag: refpurpose 3320#: reference_raster.xml:1693 3321#, no-c-format 3322msgid "" 3323"<refpurpose>Returns a set of rasters resulting from the split of the input " 3324"raster based upon the desired dimensions of the output rasters.</refpurpose>" 3325msgstr "" 3326 3327#. Tag: funcsynopsis 3328#: reference_raster.xml:1697 3329#, no-c-format 3330msgid "" 3331"<funcprototype> <funcdef>setof raster <function>ST_Tile</function></funcdef> " 3332"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 3333"<paramdef><type>int[] </type> <parameter>nband</parameter></paramdef> " 3334"<paramdef><type>integer </type> <parameter>width</parameter></paramdef> " 3335"<paramdef><type>integer </type> <parameter>height</parameter></paramdef> " 3336"<paramdef choice=\"opt\"><type>boolean </type> " 3337"<parameter>padwithnodata=FALSE</parameter></paramdef> <paramdef choice=\"opt" 3338"\"><type>double precision </type> <parameter>nodataval=NULL</parameter></" 3339"paramdef> </funcprototype> <funcprototype> <funcdef>setof raster " 3340"<function>ST_Tile</function></funcdef> <paramdef><type>raster </type> " 3341"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 3342"<parameter>nband</parameter></paramdef> <paramdef><type>integer </type> " 3343"<parameter>width</parameter></paramdef> <paramdef><type>integer </type> " 3344"<parameter>height</parameter></paramdef> <paramdef choice=\"opt" 3345"\"><type>boolean </type> <parameter>padwithnodata=FALSE</parameter></" 3346"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 3347"<parameter>nodataval=NULL</parameter></paramdef> </funcprototype> " 3348"<funcprototype> <funcdef>setof raster <function>ST_Tile</function></funcdef> " 3349"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 3350"<paramdef><type>integer </type> <parameter>width</parameter></paramdef> " 3351"<paramdef><type>integer </type> <parameter>height</parameter></paramdef> " 3352"<paramdef choice=\"opt\"><type>boolean </type> " 3353"<parameter>padwithnodata=FALSE</parameter></paramdef> <paramdef choice=\"opt" 3354"\"><type>double precision </type> <parameter>nodataval=NULL</parameter></" 3355"paramdef> </funcprototype>" 3356msgstr "" 3357 3358#. Tag: para 3359#: reference_raster.xml:1733 3360#, no-c-format 3361msgid "" 3362"<para>Returns a set of rasters resulting from the split of the input raster " 3363"based upon the desired dimensions of the output rasters.</para>" 3364msgstr "" 3365 3366#. Tag: para 3367#: reference_raster.xml:1737 3368#, no-c-format 3369msgid "" 3370"If <varname>padwithnodata</varname> = FALSE, edge tiles on the right and " 3371"bottom sides of the raster may have different dimensions than the rest of " 3372"the tiles. If <varname>padwithnodata</varname> = TRUE, all tiles will have " 3373"the same dimensions with the possibility that edge tiles being padded with " 3374"NODATA values. If raster band(s) do not have NODATA value(s) specified, one " 3375"can be specified by setting <varname>nodataval</varname>." 3376msgstr "" 3377 3378#. Tag: para 3379#: reference_raster.xml:1742 3380#, no-c-format 3381msgid "" 3382"If a specified band of the input raster is out-of-db, the corresponding band " 3383"in the output rasters will also be out-of-db." 3384msgstr "" 3385 3386#. Tag: programlisting 3387#: reference_raster.xml:1753 3388#, no-c-format 3389msgid "" 3390"WITH foo AS (\n" 3391" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, 0, 1, -1, " 3392"0, 0, 0), 1, '8BUI', 1, 0), 2, '8BUI', 10, 0) AS rast UNION ALL\n" 3393" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 3, 0, 1, -1, " 3394"0, 0, 0), 1, '8BUI', 2, 0), 2, '8BUI', 20, 0) AS rast UNION ALL\n" 3395" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 6, 0, 1, -1, " 3396"0, 0, 0), 1, '8BUI', 3, 0), 2, '8BUI', 30, 0) AS rast UNION ALL\n" 3397"\n" 3398" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, -3, 1, -1, " 3399"0, 0, 0), 1, '8BUI', 4, 0), 2, '8BUI', 40, 0) AS rast UNION ALL\n" 3400" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 3, -3, 1, -1, " 3401"0, 0, 0), 1, '8BUI', 5, 0), 2, '8BUI', 50, 0) AS rast UNION ALL\n" 3402" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 6, -3, 1, -1, " 3403"0, 0, 0), 1, '8BUI', 6, 0), 2, '8BUI', 60, 0) AS rast UNION ALL\n" 3404"\n" 3405" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, -6, 1, -1, " 3406"0, 0, 0), 1, '8BUI', 7, 0), 2, '8BUI', 70, 0) AS rast UNION ALL\n" 3407" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 3, -6, 1, -1, " 3408"0, 0, 0), 1, '8BUI', 8, 0), 2, '8BUI', 80, 0) AS rast UNION ALL\n" 3409" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 6, -6, 1, -1, " 3410"0, 0, 0), 1, '8BUI', 9, 0), 2, '8BUI', 90, 0) AS rast\n" 3411"), bar AS (\n" 3412" SELECT ST_Union(rast) AS rast FROM foo\n" 3413"), baz AS (\n" 3414" SELECT ST_Tile(rast, 3, 3, TRUE) AS rast FROM bar\n" 3415")\n" 3416"SELECT\n" 3417" ST_DumpValues(rast)\n" 3418"FROM baz;\n" 3419"\n" 3420" st_dumpvalues\n" 3421"------------------------------------------\n" 3422" (1,\"{{1,1,1},{1,1,1},{1,1,1}}\")\n" 3423" (2,\"{{10,10,10},{10,10,10},{10,10,10}}\")\n" 3424" (1,\"{{2,2,2},{2,2,2},{2,2,2}}\")\n" 3425" (2,\"{{20,20,20},{20,20,20},{20,20,20}}\")\n" 3426" (1,\"{{3,3,3},{3,3,3},{3,3,3}}\")\n" 3427" (2,\"{{30,30,30},{30,30,30},{30,30,30}}\")\n" 3428" (1,\"{{4,4,4},{4,4,4},{4,4,4}}\")\n" 3429" (2,\"{{40,40,40},{40,40,40},{40,40,40}}\")\n" 3430" (1,\"{{5,5,5},{5,5,5},{5,5,5}}\")\n" 3431" (2,\"{{50,50,50},{50,50,50},{50,50,50}}\")\n" 3432" (1,\"{{6,6,6},{6,6,6},{6,6,6}}\")\n" 3433" (2,\"{{60,60,60},{60,60,60},{60,60,60}}\")\n" 3434" (1,\"{{7,7,7},{7,7,7},{7,7,7}}\")\n" 3435" (2,\"{{70,70,70},{70,70,70},{70,70,70}}\")\n" 3436" (1,\"{{8,8,8},{8,8,8},{8,8,8}}\")\n" 3437" (2,\"{{80,80,80},{80,80,80},{80,80,80}}\")\n" 3438" (1,\"{{9,9,9},{9,9,9},{9,9,9}}\")\n" 3439" (2,\"{{90,90,90},{90,90,90},{90,90,90}}\")\n" 3440"(18 rows)" 3441msgstr "" 3442 3443#. Tag: programlisting 3444#: reference_raster.xml:1755 3445#, no-c-format 3446msgid "" 3447"WITH foo AS (\n" 3448" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, 0, 1, -1, " 3449"0, 0, 0), 1, '8BUI', 1, 0), 2, '8BUI', 10, 0) AS rast UNION ALL\n" 3450" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 3, 0, 1, -1, " 3451"0, 0, 0), 1, '8BUI', 2, 0), 2, '8BUI', 20, 0) AS rast UNION ALL\n" 3452" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 6, 0, 1, -1, " 3453"0, 0, 0), 1, '8BUI', 3, 0), 2, '8BUI', 30, 0) AS rast UNION ALL\n" 3454"\n" 3455" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, -3, 1, -1, " 3456"0, 0, 0), 1, '8BUI', 4, 0), 2, '8BUI', 40, 0) AS rast UNION ALL\n" 3457" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 3, -3, 1, -1, " 3458"0, 0, 0), 1, '8BUI', 5, 0), 2, '8BUI', 50, 0) AS rast UNION ALL\n" 3459" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 6, -3, 1, -1, " 3460"0, 0, 0), 1, '8BUI', 6, 0), 2, '8BUI', 60, 0) AS rast UNION ALL\n" 3461"\n" 3462" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, -6, 1, -1, " 3463"0, 0, 0), 1, '8BUI', 7, 0), 2, '8BUI', 70, 0) AS rast UNION ALL\n" 3464" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 3, -6, 1, -1, " 3465"0, 0, 0), 1, '8BUI', 8, 0), 2, '8BUI', 80, 0) AS rast UNION ALL\n" 3466" SELECT ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 6, -6, 1, -1, " 3467"0, 0, 0), 1, '8BUI', 9, 0), 2, '8BUI', 90, 0) AS rast\n" 3468"), bar AS (\n" 3469" SELECT ST_Union(rast) AS rast FROM foo\n" 3470"), baz AS (\n" 3471" SELECT ST_Tile(rast, 3, 3, 2) AS rast FROM bar\n" 3472")\n" 3473"SELECT\n" 3474" ST_DumpValues(rast)\n" 3475"FROM baz;\n" 3476"\n" 3477" st_dumpvalues\n" 3478"------------------------------------------\n" 3479" (1,\"{{10,10,10},{10,10,10},{10,10,10}}\")\n" 3480" (1,\"{{20,20,20},{20,20,20},{20,20,20}}\")\n" 3481" (1,\"{{30,30,30},{30,30,30},{30,30,30}}\")\n" 3482" (1,\"{{40,40,40},{40,40,40},{40,40,40}}\")\n" 3483" (1,\"{{50,50,50},{50,50,50},{50,50,50}}\")\n" 3484" (1,\"{{60,60,60},{60,60,60},{60,60,60}}\")\n" 3485" (1,\"{{70,70,70},{70,70,70},{70,70,70}}\")\n" 3486" (1,\"{{80,80,80},{80,80,80},{80,80,80}}\")\n" 3487" (1,\"{{90,90,90},{90,90,90},{90,90,90}}\")\n" 3488"(9 rows)" 3489msgstr "" 3490 3491#. Tag: para 3492#: reference_raster.xml:1761 3493#, no-c-format 3494msgid ", <xref linkend=\"RT_Retile\"/>" 3495msgstr "" 3496 3497#. Tag: refname 3498#: reference_raster.xml:1771 3499#, no-c-format 3500msgid "ST_Retile" 3501msgstr "" 3502 3503#. Tag: refpurpose 3504#: reference_raster.xml:1772 3505#, no-c-format 3506msgid "" 3507"Return a set of configured tiles from an arbitrarily tiled raster coverage." 3508msgstr "" 3509 3510#. Tag: funcprototype 3511#: reference_raster.xml:1780 3512#, no-c-format 3513msgid "" 3514"<funcdef>SETOF raster <function>ST_Retile</function></funcdef> " 3515"<paramdef><type>regclass </type> <parameter>tab</parameter></paramdef> " 3516"<paramdef><type>name </type> <parameter>col</parameter></paramdef> " 3517"<paramdef><type>geometry </type> <parameter>ext</parameter></paramdef> " 3518"<paramdef><type>float8 </type> <parameter>sfx</parameter></paramdef> " 3519"<paramdef><type>float8 </type> <parameter>sfy</parameter></paramdef> " 3520"<paramdef><type>int </type> <parameter>tw</parameter></paramdef> " 3521"<paramdef><type>int </type> <parameter>th</parameter></paramdef> <paramdef " 3522"choice=\"opt\"><type>text </type> <parameter>algo='NearestNeighbor'</" 3523"parameter></paramdef>" 3524msgstr "" 3525 3526#. Tag: para 3527#: reference_raster.xml:1798 3528#, no-c-format 3529msgid "" 3530"Return a set of tiles having the specified scale (<varname>sfx</varname>, " 3531"<varname>sfy</varname>) and max size (<varname>tw</varname>, <varname>th</" 3532"varname>) and covering the specified extent (<varname>ext</varname>) with " 3533"data coming from the specified raster coverage (<varname>tab</varname>, " 3534"<varname>col</varname>)." 3535msgstr "" 3536 3537#. Tag: refname 3538#: reference_raster.xml:1822 3539#, no-c-format 3540msgid "ST_FromGDALRaster" 3541msgstr "" 3542 3543#. Tag: refpurpose 3544#: reference_raster.xml:1823 3545#, no-c-format 3546msgid "Returns a raster from a supported GDAL raster file." 3547msgstr "" 3548 3549#. Tag: funcprototype 3550#: reference_raster.xml:1828 3551#, no-c-format 3552msgid "" 3553"<funcdef>raster <function>ST_FromGDALRaster</function></funcdef> " 3554"<paramdef><type>bytea </type> <parameter>gdaldata</parameter></paramdef> " 3555"<paramdef choice=\"opt\"><type>integer </type> <parameter>srid=NULL</" 3556"parameter></paramdef>" 3557msgstr "" 3558 3559#. Tag: para 3560#: reference_raster.xml:1840 3561#, no-c-format 3562msgid "" 3563"Returns a raster from a supported GDAL raster file. <varname>gdaldata</" 3564"varname> is of type bytea and should be the contents of the GDAL raster file." 3565msgstr "" 3566 3567#. Tag: para 3568#: reference_raster.xml:1844 3569#, no-c-format 3570msgid "" 3571"If <varname>srid</varname> is NULL, the function will try to automatically " 3572"assign the SRID from the GDAL raster. If <varname>srid</varname> is " 3573"provided, the value provided will override any automatically assigned SRID." 3574msgstr "" 3575 3576#. Tag: programlisting 3577#: reference_raster.xml:1854 3578#, no-c-format 3579msgid "" 3580"WITH foo AS (\n" 3581" SELECT " 3582"ST_AsPNG(ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, " 3583"0.1, -0.1, 0, 0, 4326), 1, '8BUI', 1, 0), 2, '8BUI', 2, 0), 3, '8BUI', 3, " 3584"0)) AS png\n" 3585"),\n" 3586"bar AS (\n" 3587" SELECT 1 AS rid, ST_FromGDALRaster(png) AS rast FROM foo\n" 3588" UNION ALL\n" 3589" SELECT 2 AS rid, ST_FromGDALRaster(png, 3310) AS rast FROM foo\n" 3590")\n" 3591"SELECT\n" 3592" rid,\n" 3593" ST_Metadata(rast) AS metadata,\n" 3594" ST_SummaryStats(rast, 1) AS stats1,\n" 3595" ST_SummaryStats(rast, 2) AS stats2,\n" 3596" ST_SummaryStats(rast, 3) AS stats3\n" 3597"FROM bar\n" 3598"ORDER BY rid;\n" 3599"\n" 3600" rid | metadata | stats1 | stats2 | " 3601"stats3\n" 3602"-----+---------------------------+---------------+---------------" 3603"+----------------\n" 3604" 1 | (0,0,2,2,1,-1,0,0,0,3) | (4,4,1,0,1,1) | (4,8,2,0,2,2) | " 3605"(4,12,3,0,3,3)\n" 3606" 2 | (0,0,2,2,1,-1,0,0,3310,3) | (4,4,1,0,1,1) | (4,8,2,0,2,2) | " 3607"(4,12,3,0,3,3)\n" 3608"(2 rows)" 3609msgstr "" 3610 3611#. Tag: title 3612#: reference_raster.xml:1869 3613#, no-c-format 3614msgid "Raster Accessors" 3615msgstr "" 3616 3617#. Tag: refname 3618#: reference_raster.xml:1873 3619#, no-c-format 3620msgid "ST_GeoReference" 3621msgstr "ST_GeoReference" 3622 3623#. Tag: refpurpose 3624#: reference_raster.xml:1874 3625#, no-c-format 3626msgid "" 3627"Returns the georeference meta data in GDAL or ESRI format as commonly seen " 3628"in a world file. Default is GDAL." 3629msgstr "" 3630 3631#. Tag: funcprototype 3632#: reference_raster.xml:1879 3633#, no-c-format 3634msgid "" 3635"<funcdef>text <function>ST_GeoReference</function></funcdef> " 3636"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 3637"<paramdef choice=\"opt\"><type>text </type> <parameter>format=GDAL</" 3638"parameter></paramdef>" 3639msgstr "" 3640"<funcdef>text <function>ST_GeoReference</function></funcdef> " 3641"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 3642"<paramdef choice=\"opt\"><type>text </type> <parameter>format=GDAL</" 3643"parameter></paramdef>" 3644 3645#. Tag: para 3646#: reference_raster.xml:1890 3647#, no-c-format 3648msgid "" 3649"Returns the georeference meta data including carriage return in GDAL or ESRI " 3650"format as commonly seen in a <ulink url=\"http://en.wikipedia.org/wiki/" 3651"World_file\">world file</ulink>. Default is GDAL if no type specified. type " 3652"is string 'GDAL' or 'ESRI'." 3653msgstr "" 3654 3655#. Tag: para 3656#: reference_raster.xml:1892 reference_raster.xml:4231 3657#, no-c-format 3658msgid "Difference between format representations is as follows:" 3659msgstr "" 3660 3661#. Tag: para 3662#: reference_raster.xml:1893 reference_raster.xml:4232 3663#, no-c-format 3664msgid "<varname>GDAL</varname>:" 3665msgstr "<varname>GDAL</varname>:" 3666 3667#. Tag: programlisting 3668#: reference_raster.xml:1894 3669#, fuzzy, no-c-format 3670msgid "" 3671"scalex\n" 3672"skewy\n" 3673"skewx\n" 3674"scaley\n" 3675"upperleftx\n" 3676"upperlefty" 3677msgstr "" 3678"scalex \n" 3679"skewy \n" 3680"skewx\n" 3681"scaley\n" 3682"upperleftx\n" 3683"upperlefty" 3684 3685#. Tag: para 3686#: reference_raster.xml:1895 reference_raster.xml:4234 3687#, no-c-format 3688msgid "<varname>ESRI</varname>:" 3689msgstr "<varname>ESRI</varname>:" 3690 3691#. Tag: programlisting 3692#: reference_raster.xml:1896 3693#, fuzzy, no-c-format 3694msgid "" 3695"scalex\n" 3696"skewy\n" 3697"skewx\n" 3698"scaley\n" 3699"upperleftx + scalex*0.5\n" 3700"upperlefty + scaley*0.5" 3701msgstr "" 3702"scalex \n" 3703"skewy \n" 3704"skewx\n" 3705"scaley\n" 3706"upperleftx + scalex*0.5\n" 3707"upperlefty + scaley*0.5" 3708 3709#. Tag: programlisting 3710#: reference_raster.xml:1902 3711#, no-c-format 3712msgid "" 3713"SELECT ST_GeoReference(rast, 'ESRI') As esri_ref, ST_GeoReference(rast, " 3714"'GDAL') As gdal_ref\n" 3715" FROM dummy_rast WHERE rid=1;\n" 3716"\n" 3717" esri_ref | gdal_ref\n" 3718"--------------+--------------\n" 3719" 2.0000000000 | 2.0000000000\n" 3720" 0.0000000000 : 0.0000000000\n" 3721" 0.0000000000 : 0.0000000000\n" 3722" 3.0000000000 : 3.0000000000\n" 3723" 1.5000000000 : 0.5000000000\n" 3724" 2.0000000000 : 0.5000000000" 3725msgstr "" 3726"SELECT ST_GeoReference(rast, 'ESRI') As esri_ref, ST_GeoReference(rast, " 3727"'GDAL') As gdal_ref\n" 3728" FROM dummy_rast WHERE rid=1;\n" 3729"\n" 3730" esri_ref | gdal_ref\n" 3731"--------------+--------------\n" 3732" 2.0000000000 | 2.0000000000\n" 3733" 0.0000000000 : 0.0000000000\n" 3734" 0.0000000000 : 0.0000000000\n" 3735" 3.0000000000 : 3.0000000000\n" 3736" 1.5000000000 : 0.5000000000\n" 3737" 2.0000000000 : 0.5000000000" 3738 3739#. Tag: para 3740#: reference_raster.xml:1907 3741#, no-c-format 3742msgid ", <xref linkend=\"RT_ST_ScaleX\"/>, <xref linkend=\"RT_ST_ScaleY\"/>" 3743msgstr ", <xref linkend=\"RT_ST_ScaleX\"/>, <xref linkend=\"RT_ST_ScaleY\"/>" 3744 3745#. Tag: refname 3746#: reference_raster.xml:1913 3747#, no-c-format 3748msgid "ST_Height" 3749msgstr "ST_Height" 3750 3751#. Tag: refpurpose 3752#: reference_raster.xml:1914 3753#, no-c-format 3754msgid "Returns the height of the raster in pixels." 3755msgstr "" 3756 3757#. Tag: funcprototype 3758#: reference_raster.xml:1919 3759#, no-c-format 3760msgid "" 3761"<funcdef>integer <function>ST_Height</function></funcdef> " 3762"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 3763msgstr "" 3764"<funcdef>integer <function>ST_Height</function></funcdef> " 3765"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 3766 3767#. Tag: para 3768#: reference_raster.xml:1929 3769#, no-c-format 3770msgid "Returns the height of the raster." 3771msgstr "" 3772 3773#. Tag: programlisting 3774#: reference_raster.xml:1935 3775#, no-c-format 3776msgid "" 3777"SELECT rid, ST_Height(rast) As rastheight\n" 3778"FROM dummy_rast;\n" 3779"\n" 3780" rid | rastheight\n" 3781"-----+------------\n" 3782" 1 | 20\n" 3783" 2 | 5" 3784msgstr "" 3785"SELECT rid, ST_Height(rast) As rastheight\n" 3786"FROM dummy_rast;\n" 3787"\n" 3788" rid | rastheight\n" 3789"-----+------------\n" 3790" 1 | 20\n" 3791" 2 | 5" 3792 3793#. Tag: refname 3794#: reference_raster.xml:1947 3795#, no-c-format 3796msgid "ST_IsEmpty" 3797msgstr "ST_IsEmpty" 3798 3799#. Tag: refpurpose 3800#: reference_raster.xml:1948 3801#, no-c-format 3802msgid "" 3803"<refpurpose>Returns true if the raster is empty (width = 0 and height = 0). " 3804"Otherwise, returns false.</refpurpose>" 3805msgstr "" 3806 3807#. Tag: funcprototype 3808#: reference_raster.xml:1953 3809#, no-c-format 3810msgid "" 3811"<funcdef>boolean <function>ST_IsEmpty</function></funcdef> " 3812"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 3813msgstr "" 3814"<funcdef>boolean <function>ST_IsEmpty</function></funcdef> " 3815"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 3816 3817#. Tag: para 3818#: reference_raster.xml:1963 3819#, no-c-format 3820msgid "" 3821"<para>Returns true if the raster is empty (width = 0 and height = 0). " 3822"Otherwise, returns false.</para>" 3823msgstr "" 3824 3825#. Tag: programlisting 3826#: reference_raster.xml:1971 3827#, fuzzy, no-c-format 3828msgid "" 3829"SELECT ST_IsEmpty(ST_MakeEmptyRaster(100, 100, 0, 0, 0, 0, 0, 0))\n" 3830"st_isempty |\n" 3831"-----------+\n" 3832"f |\n" 3833"\n" 3834"\n" 3835"SELECT ST_IsEmpty(ST_MakeEmptyRaster(0, 0, 0, 0, 0, 0, 0, 0))\n" 3836"st_isempty |\n" 3837"-----------+\n" 3838"t |" 3839msgstr "" 3840"SELECT ST_IsEmpty(ST_MakeEmptyRaster(100, 100, 0, 0, 0, 0, 0, 0))\n" 3841"st_isempty |\n" 3842"-----------+\n" 3843"f |\n" 3844" \n" 3845" \n" 3846"SELECT ST_IsEmpty(ST_MakeEmptyRaster(0, 0, 0, 0, 0, 0, 0, 0))\n" 3847"st_isempty |\n" 3848"-----------+\n" 3849"t |" 3850 3851#. Tag: refname 3852#: reference_raster.xml:1983 3853#, no-c-format 3854msgid "ST_MemSize" 3855msgstr "" 3856 3857#. Tag: refpurpose 3858#: reference_raster.xml:1985 3859#, no-c-format 3860msgid "" 3861"<refpurpose>Returns the amount of space (in bytes) the raster takes.</" 3862"refpurpose>" 3863msgstr "" 3864 3865#. Tag: funcprototype 3866#: reference_raster.xml:1990 3867#, no-c-format 3868msgid "" 3869"<funcdef>integer <function>ST_MemSize</function></funcdef> " 3870"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 3871msgstr "" 3872 3873#. Tag: para 3874#: reference_raster.xml:2000 3875#, no-c-format 3876msgid "<para>Returns the amount of space (in bytes) the raster takes.</para>" 3877msgstr "" 3878 3879#. Tag: para 3880#: reference_raster.xml:2001 3881#, no-c-format 3882msgid "" 3883"This is a nice compliment to PostgreSQL built in functions pg_column_size, " 3884"pg_size_pretty, pg_relation_size, pg_total_relation_size." 3885msgstr "" 3886 3887#. Tag: para 3888#: reference_raster.xml:2002 3889#, no-c-format 3890msgid "" 3891"pg_relation_size which gives the byte size of a table may return byte size " 3892"lower than ST_MemSize. This is because pg_relation_size does not add toasted " 3893"table contribution and large geometries are stored in TOAST tables. " 3894"pg_column_size might return lower because it returns the compressed size." 3895msgstr "" 3896 3897#. Tag: para 3898#: reference_raster.xml:2004 3899#, no-c-format 3900msgid "" 3901"pg_total_relation_size - includes, the table, the toasted tables, and the " 3902"indexes." 3903msgstr "" 3904 3905#. Tag: programlisting 3906#: reference_raster.xml:2014 3907#, no-c-format 3908msgid "" 3909"SELECT ST_MemSize(ST_AsRaster(ST_Buffer(ST_Point(1,5),10,1000),150, 150, " 3910"'8BUI')) As rast_mem;\n" 3911"\n" 3912" rast_mem\n" 3913" --------\n" 3914" 22568" 3915msgstr "" 3916 3917#. Tag: refname 3918#: reference_raster.xml:2027 3919#, no-c-format 3920msgid "ST_MetaData" 3921msgstr "ST_MetaData" 3922 3923#. Tag: refpurpose 3924#: reference_raster.xml:2028 3925#, no-c-format 3926msgid "" 3927"Returns basic meta data about a raster object such as pixel size, rotation " 3928"(skew), upper, lower left, etc." 3929msgstr "" 3930 3931#. Tag: funcprototype 3932#: reference_raster.xml:2033 3933#, no-c-format 3934msgid "" 3935"<funcdef>record <function>ST_MetaData</function></funcdef> " 3936"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 3937msgstr "" 3938"<funcdef>record <function>ST_MetaData</function></funcdef> " 3939"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 3940 3941#. Tag: para 3942#: reference_raster.xml:2043 3943#, no-c-format 3944msgid "" 3945"Returns basic meta data about a raster object such as pixel size, rotation " 3946"(skew), upper, lower left, etc. Columns returned: upperleftx | upperlefty | " 3947"width | height | scalex | scaley | skewx | skewy | srid | numbands" 3948msgstr "" 3949 3950#. Tag: programlisting 3951#: reference_raster.xml:2050 3952#, fuzzy, no-c-format 3953msgid "" 3954"SELECT rid, (foo.md).*\n" 3955" FROM (SELECT rid, ST_MetaData(rast) As md\n" 3956"FROM dummy_rast) As foo;\n" 3957"\n" 3958" rid | upperleftx | upperlefty | width | height | scalex | scaley | skewx | " 3959"skewy | srid | numbands\n" 3960" ----+------------+------------+-------+--------+--------+-----------+-------" 3961"+-------+------+-------\n" 3962" 1 | 0.5 | 0.5 | 10 | 20 | 2 | 3 " 3963"| 0 | 0 | 0 | 0\n" 3964" 2 | 3427927.75 | 5793244 | 5 | 5 | 0.05 | -0.05 " 3965"| 0 | 0 | 0 | 3" 3966msgstr "" 3967"SELECT rid, (foo.md).* \n" 3968" FROM (SELECT rid, ST_MetaData(rast) As md\n" 3969"FROM dummy_rast) As foo;\n" 3970"\n" 3971" rid | upperleftx | upperlefty | width | height | scalex | scaley | skewx | " 3972"skewy | srid | numbands\n" 3973" ----+------------+------------+-------+--------+--------+-----------+-------" 3974"+-------+------+-------\n" 3975" 1 | 0.5 | 0.5 | 10 | 20 | 2 | 3 " 3976"| 0 | 0 | 0 | 0\n" 3977" 2 | 3427927.75 | 5793244 | 5 | 5 | 0.05 | -0.05 " 3978"| 0 | 0 | 0 | 3" 3979 3980#. Tag: para 3981#: reference_raster.xml:2056 reference_raster.xml:5010 3982#, no-c-format 3983msgid ", <xref linkend=\"RT_ST_NumBands\"/>" 3984msgstr ", <xref linkend=\"RT_ST_NumBands\"/>" 3985 3986#. Tag: refname 3987#: reference_raster.xml:2062 3988#, no-c-format 3989msgid "ST_NumBands" 3990msgstr "ST_NumBands" 3991 3992#. Tag: refpurpose 3993#: reference_raster.xml:2063 3994#, no-c-format 3995msgid "" 3996"<refpurpose>Returns the number of bands in the raster object.</refpurpose>" 3997msgstr "" 3998 3999#. Tag: funcprototype 4000#: reference_raster.xml:2068 4001#, no-c-format 4002msgid "" 4003"<funcdef>integer <function>ST_NumBands</function></funcdef> " 4004"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4005msgstr "" 4006 4007#. Tag: para 4008#: reference_raster.xml:2078 4009#, no-c-format 4010msgid "<para>Returns the number of bands in the raster object.</para>" 4011msgstr "" 4012 4013#. Tag: programlisting 4014#: reference_raster.xml:2084 4015#, no-c-format 4016msgid "" 4017"SELECT rid, ST_NumBands(rast) As numbands\n" 4018"FROM dummy_rast;\n" 4019"\n" 4020"rid | numbands\n" 4021"----+----------\n" 4022" 1 | 0\n" 4023" 2 | 3" 4024msgstr "" 4025"SELECT rid, ST_NumBands(rast) As numbands\n" 4026"FROM dummy_rast;\n" 4027"\n" 4028"rid | numbands\n" 4029"----+----------\n" 4030" 1 | 0\n" 4031" 2 | 3" 4032 4033#. Tag: refname 4034#: reference_raster.xml:2096 4035#, no-c-format 4036msgid "ST_PixelHeight" 4037msgstr "ST_PixelHeight" 4038 4039#. Tag: refpurpose 4040#: reference_raster.xml:2097 4041#, no-c-format 4042msgid "" 4043"Returns the pixel height in geometric units of the spatial reference system." 4044msgstr "" 4045 4046#. Tag: funcprototype 4047#: reference_raster.xml:2102 4048#, no-c-format 4049msgid "" 4050"<funcdef>double precision <function>ST_PixelHeight</function></funcdef> " 4051"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4052msgstr "" 4053"<funcdef>double precision <function>ST_PixelHeight</function></funcdef> " 4054"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4055 4056#. Tag: para 4057#: reference_raster.xml:2112 4058#, no-c-format 4059msgid "" 4060"Returns the height of a pixel in geometric units of the spatial reference " 4061"system. In the common case where there is no skew, the pixel height is just " 4062"the scale ratio between geometric coordinates and raster pixels." 4063msgstr "" 4064 4065#. Tag: para 4066#: reference_raster.xml:2114 4067#, no-c-format 4068msgid "" 4069"Refer to <xref linkend=\"RT_ST_PixelWidth\"/> for a diagrammatic " 4070"visualization of the relationship." 4071msgstr "" 4072 4073#. Tag: title 4074#: reference_raster.xml:2118 reference_raster.xml:2178 4075#, no-c-format 4076msgid "Examples: Rasters with no skew" 4077msgstr "" 4078 4079#. Tag: programlisting 4080#: reference_raster.xml:2120 4081#, no-c-format 4082msgid "" 4083"SELECT ST_Height(rast) As rastheight, ST_PixelHeight(rast) As pixheight,\n" 4084" ST_ScaleX(rast) As scalex, ST_ScaleY(rast) As scaley, ST_SkewX(rast) As " 4085"skewx,\n" 4086" ST_SkewY(rast) As skewy\n" 4087"FROM dummy_rast;\n" 4088"\n" 4089" rastheight | pixheight | scalex | scaley | skewx | skewy\n" 4090"------------+-----------+--------+--------+-------+----------\n" 4091" 20 | 3 | 2 | 3 | 0 | 0\n" 4092" 5 | 0.05 | 0.05 | -0.05 | 0 | 0" 4093msgstr "" 4094"SELECT ST_Height(rast) As rastheight, ST_PixelHeight(rast) As pixheight,\n" 4095" ST_ScaleX(rast) As scalex, ST_ScaleY(rast) As scaley, ST_SkewX(rast) As " 4096"skewx,\n" 4097" ST_SkewY(rast) As skewy\n" 4098"FROM dummy_rast;\n" 4099"\n" 4100" rastheight | pixheight | scalex | scaley | skewx | skewy\n" 4101"------------+-----------+--------+--------+-------+----------\n" 4102" 20 | 3 | 2 | 3 | 0 | 0\n" 4103" 5 | 0.05 | 0.05 | -0.05 | 0 | 0" 4104 4105#. Tag: title 4106#: reference_raster.xml:2125 reference_raster.xml:2185 4107#, no-c-format 4108msgid "Examples: Rasters with skew different than 0" 4109msgstr "" 4110 4111#. Tag: programlisting 4112#: reference_raster.xml:2127 4113#, no-c-format 4114msgid "" 4115"SELECT ST_Height(rast) As rastheight, ST_PixelHeight(rast) As pixheight,\n" 4116" ST_ScaleX(rast) As scalex, ST_ScaleY(rast) As scaley, ST_SkewX(rast) As " 4117"skewx,\n" 4118" ST_SkewY(rast) As skewy\n" 4119"FROM (SELECT ST_SetSKew(rast,0.5,0.5) As rast\n" 4120" FROM dummy_rast) As skewed;\n" 4121"\n" 4122"rastheight | pixheight | scalex | scaley | skewx | skewy\n" 4123"-----------+-------------------+--------+--------+-------+----------\n" 4124" 20 | 3.04138126514911 | 2 | 3 | 0.5 | 0.5\n" 4125" 5 | 0.502493781056044 | 0.05 | -0.05 | 0.5 | 0.5" 4126msgstr "" 4127"SELECT ST_Height(rast) As rastheight, ST_PixelHeight(rast) As pixheight,\n" 4128" ST_ScaleX(rast) As scalex, ST_ScaleY(rast) As scaley, ST_SkewX(rast) As " 4129"skewx,\n" 4130" ST_SkewY(rast) As skewy\n" 4131"FROM (SELECT ST_SetSKew(rast,0.5,0.5) As rast\n" 4132" FROM dummy_rast) As skewed;\n" 4133"\n" 4134"rastheight | pixheight | scalex | scaley | skewx | skewy\n" 4135"-----------+-------------------+--------+--------+-------+----------\n" 4136" 20 | 3.04138126514911 | 2 | 3 | 0.5 | 0.5\n" 4137" 5 | 0.502493781056044 | 0.05 | -0.05 | 0.5 | 0.5" 4138 4139#. Tag: para 4140#: reference_raster.xml:2134 reference_raster.xml:2194 4141#: reference_raster.xml:4290 4142#, no-c-format 4143msgid "" 4144", <xref linkend=\"RT_ST_ScaleX\"/>, <xref linkend=\"RT_ST_ScaleY\"/>, <xref " 4145"linkend=\"RT_ST_SkewX\"/>, <xref linkend=\"RT_ST_SkewY\"/>" 4146msgstr "" 4147", <xref linkend=\"RT_ST_ScaleX\"/>, <xref linkend=\"RT_ST_ScaleY\"/>, <xref " 4148"linkend=\"RT_ST_SkewX\"/>, <xref linkend=\"RT_ST_SkewY\"/>" 4149 4150#. Tag: refname 4151#: reference_raster.xml:2146 4152#, no-c-format 4153msgid "ST_PixelWidth" 4154msgstr "ST_PixelWidth" 4155 4156#. Tag: refpurpose 4157#: reference_raster.xml:2147 4158#, no-c-format 4159msgid "" 4160"Returns the pixel width in geometric units of the spatial reference system." 4161msgstr "" 4162 4163#. Tag: funcprototype 4164#: reference_raster.xml:2152 4165#, no-c-format 4166msgid "" 4167"<funcdef>double precision <function>ST_PixelWidth</function></funcdef> " 4168"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4169msgstr "" 4170"<funcdef>double precision <function>ST_PixelWidth</function></funcdef> " 4171"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4172 4173#. Tag: para 4174#: reference_raster.xml:2162 4175#, no-c-format 4176msgid "" 4177"Returns the width of a pixel in geometric units of the spatial reference " 4178"system. In the common case where there is no skew, the pixel width is just " 4179"the scale ratio between geometric coordinates and raster pixels." 4180msgstr "" 4181 4182#. Tag: para 4183#: reference_raster.xml:2164 4184#, no-c-format 4185msgid "The following diagram demonstrates the relationship:" 4186msgstr "" 4187 4188#. Tag: para 4189#: reference_raster.xml:2171 4190#, no-c-format 4191msgid "Pixel Width: Pixel size in the i direction" 4192msgstr "" 4193 4194#. Tag: para 4195#: reference_raster.xml:2171 4196#, no-c-format 4197msgid "Pixel Height: Pixel size in the j direction" 4198msgstr "" 4199 4200#. Tag: programlisting 4201#: reference_raster.xml:2180 4202#, fuzzy, no-c-format 4203msgid "" 4204"SELECT ST_Width(rast) As rastwidth, ST_PixelWidth(rast) As pixwidth,\n" 4205" ST_ScaleX(rast) As scalex, ST_ScaleY(rast) As scaley, ST_SkewX(rast) " 4206"As skewx,\n" 4207" ST_SkewY(rast) As skewy\n" 4208" FROM dummy_rast;\n" 4209"\n" 4210" rastwidth | pixwidth | scalex | scaley | skewx | skewy\n" 4211" -----------+----------+--------+--------+-------+----------\n" 4212" 10 | 2 | 2 | 3 | 0 | 0\n" 4213" 5 | 0.05 | 0.05 | -0.05 | 0 | 0" 4214msgstr "" 4215"SELECT ST_Width(rast) As rastwidth, ST_PixelWidth(rast) As pixwidth,\n" 4216" ST_ScaleX(rast) As scalex, ST_ScaleY(rast) As scaley, ST_SkewX(rast) " 4217"As skewx,\n" 4218" ST_SkewY(rast) As skewy\n" 4219" FROM dummy_rast;\n" 4220" \n" 4221" rastwidth | pixwidth | scalex | scaley | skewx | skewy\n" 4222" -----------+----------+--------+--------+-------+----------\n" 4223" 10 | 2 | 2 | 3 | 0 | 0\n" 4224" 5 | 0.05 | 0.05 | -0.05 | 0 | 0" 4225 4226#. Tag: programlisting 4227#: reference_raster.xml:2187 4228#, fuzzy, no-c-format 4229msgid "" 4230"SELECT ST_Width(rast) As rastwidth, ST_PixelWidth(rast) As pixwidth,\n" 4231" ST_ScaleX(rast) As scalex, ST_ScaleY(rast) As scaley, ST_SkewX(rast) " 4232"As skewx,\n" 4233" ST_SkewY(rast) As skewy\n" 4234" FROM (SELECT ST_SetSkew(rast,0.5,0.5) As rast\n" 4235" FROM dummy_rast) As skewed;\n" 4236"\n" 4237" rastwidth | pixwidth | scalex | scaley | skewx | skewy\n" 4238" -----------+-------------------+--------+--------+-------" 4239"+----------\n" 4240" 10 | 2.06155281280883 | 2 | 3 | 0.5 | 0.5\n" 4241" 5 | 0.502493781056044 | 0.05 | -0.05 | 0.5 | 0.5" 4242msgstr "" 4243"SELECT ST_Width(rast) As rastwidth, ST_PixelWidth(rast) As pixwidth,\n" 4244" ST_ScaleX(rast) As scalex, ST_ScaleY(rast) As scaley, ST_SkewX(rast) " 4245"As skewx,\n" 4246" ST_SkewY(rast) As skewy\n" 4247" FROM (SELECT ST_SetSkew(rast,0.5,0.5) As rast\n" 4248" FROM dummy_rast) As skewed;\n" 4249" \n" 4250" rastwidth | pixwidth | scalex | scaley | skewx | skewy\n" 4251" -----------+-------------------+--------+--------+-------" 4252"+----------\n" 4253" 10 | 2.06155281280883 | 2 | 3 | 0.5 | 0.5\n" 4254" 5 | 0.502493781056044 | 0.05 | -0.05 | 0.5 | 0.5" 4255 4256#. Tag: refname 4257#: reference_raster.xml:2200 4258#, no-c-format 4259msgid "ST_ScaleX" 4260msgstr "ST_ScaleX" 4261 4262#. Tag: refpurpose 4263#: reference_raster.xml:2201 4264#, no-c-format 4265msgid "" 4266"Returns the X component of the pixel width in units of coordinate reference " 4267"system." 4268msgstr "" 4269 4270#. Tag: funcprototype 4271#: reference_raster.xml:2206 4272#, no-c-format 4273msgid "" 4274"<funcdef>float8 <function>ST_ScaleX</function></funcdef> " 4275"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4276msgstr "" 4277"<funcdef>float8 <function>ST_ScaleX</function></funcdef> " 4278"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4279 4280#. Tag: para 4281#: reference_raster.xml:2216 4282#, no-c-format 4283msgid "" 4284"Returns the X component of the pixel width in units of coordinate reference " 4285"system. Refer to <ulink url=\"http://en.wikipedia.org/wiki/World_file" 4286"\">World File</ulink> for more details." 4287msgstr "" 4288 4289#. Tag: para 4290#: reference_raster.xml:2218 4291#, no-c-format 4292msgid "Changed: 2.0.0. In WKTRaster versions this was called ST_PixelSizeX." 4293msgstr "" 4294 4295#. Tag: programlisting 4296#: reference_raster.xml:2224 4297#, no-c-format 4298msgid "" 4299"SELECT rid, ST_ScaleX(rast) As rastpixwidth\n" 4300"FROM dummy_rast;\n" 4301"\n" 4302" rid | rastpixwidth\n" 4303"-----+--------------\n" 4304" 1 | 2\n" 4305" 2 | 0.05" 4306msgstr "" 4307"SELECT rid, ST_ScaleX(rast) As rastpixwidth\n" 4308"FROM dummy_rast;\n" 4309"\n" 4310" rid | rastpixwidth\n" 4311"-----+--------------\n" 4312" 1 | 2\n" 4313" 2 | 0.05" 4314 4315#. Tag: refname 4316#: reference_raster.xml:2237 4317#, no-c-format 4318msgid "ST_ScaleY" 4319msgstr "ST_ScaleY" 4320 4321#. Tag: refpurpose 4322#: reference_raster.xml:2238 4323#, no-c-format 4324msgid "" 4325"Returns the Y component of the pixel height in units of coordinate reference " 4326"system." 4327msgstr "" 4328 4329#. Tag: funcprototype 4330#: reference_raster.xml:2243 4331#, no-c-format 4332msgid "" 4333"<funcdef>float8 <function>ST_ScaleY</function></funcdef> " 4334"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4335msgstr "" 4336"<funcdef>float8 <function>ST_ScaleY</function></funcdef> " 4337"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4338 4339#. Tag: para 4340#: reference_raster.xml:2253 4341#, no-c-format 4342msgid "" 4343"Returns the Y component of the pixel height in units of coordinate reference " 4344"system. May be negative. Refer to <ulink url=\"http://en.wikipedia.org/wiki/" 4345"World_file\">World File</ulink> for more details." 4346msgstr "" 4347 4348#. Tag: para 4349#: reference_raster.xml:2256 4350#, no-c-format 4351msgid "Changed: 2.0.0. In WKTRaster versions this was called ST_PixelSizeY." 4352msgstr "" 4353 4354#. Tag: programlisting 4355#: reference_raster.xml:2262 4356#, no-c-format 4357msgid "" 4358"SELECT rid, ST_ScaleY(rast) As rastpixheight\n" 4359"FROM dummy_rast;\n" 4360"\n" 4361" rid | rastpixheight\n" 4362"-----+---------------\n" 4363" 1 | 3\n" 4364" 2 | -0.05" 4365msgstr "" 4366"SELECT rid, ST_ScaleY(rast) As rastpixheight\n" 4367"FROM dummy_rast;\n" 4368"\n" 4369" rid | rastpixheight\n" 4370"-----+---------------\n" 4371" 1 | 3\n" 4372" 2 | -0.05" 4373 4374#. Tag: refname 4375#: reference_raster.xml:2275 4376#, no-c-format 4377msgid "ST_RasterToWorldCoord" 4378msgstr "" 4379 4380#. Tag: refpurpose 4381#: reference_raster.xml:2276 4382#, no-c-format 4383msgid "" 4384"Returns the raster's upper left corner as geometric X and Y (longitude and " 4385"latitude) given a column and row. Column and row starts at 1." 4386msgstr "" 4387 4388#. Tag: funcprototype 4389#: reference_raster.xml:2281 4390#, no-c-format 4391msgid "" 4392"<funcdef>record <function>ST_RasterToWorldCoord</function></funcdef> " 4393"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 4394"<paramdef><type>integer </type> <parameter>xcolumn</parameter></paramdef> " 4395"<paramdef><type>integer </type> <parameter>yrow</parameter></paramdef>" 4396msgstr "" 4397 4398#. Tag: para 4399#: reference_raster.xml:2293 4400#, no-c-format 4401msgid "" 4402"Returns the upper left corner as geometric X and Y (longitude and latitude) " 4403"given a column and row. Returned X and Y are in geometric units of the " 4404"georeferenced raster. Numbering of column and row starts at 1 but if either " 4405"parameter is passed a zero, a negative number or a number greater than the " 4406"respective dimension of the raster, it will return coordinates outside of " 4407"the raster assuming the raster's grid is applicable outside the raster's " 4408"bounds." 4409msgstr "" 4410 4411#. Tag: programlisting 4412#: reference_raster.xml:2305 4413#, no-c-format 4414msgid "" 4415"-- non-skewed raster\n" 4416"SELECT\n" 4417" rid,\n" 4418" (ST_RasterToWorldCoord(rast,1, 1)).*,\n" 4419" (ST_RasterToWorldCoord(rast,2, 2)).*\n" 4420"FROM dummy_rast\n" 4421"\n" 4422" rid | longitude | latitude | longitude | latitude\n" 4423"-----+------------+----------+-----------+------------\n" 4424" 1 | 0.5 | 0.5 | 2.5 | 3.5\n" 4425" 2 | 3427927.75 | 5793244 | 3427927.8 | 5793243.95" 4426msgstr "" 4427 4428#. Tag: programlisting 4429#: reference_raster.xml:2307 4430#, no-c-format 4431msgid "" 4432"-- skewed raster\n" 4433"SELECT\n" 4434" rid,\n" 4435" (ST_RasterToWorldCoord(rast, 1, 1)).*,\n" 4436" (ST_RasterToWorldCoord(rast, 2, 3)).*\n" 4437"FROM (\n" 4438" SELECT\n" 4439" rid,\n" 4440" ST_SetSkew(rast, 100.5, 0) As rast\n" 4441" FROM dummy_rast\n" 4442") As foo\n" 4443"\n" 4444" rid | longitude | latitude | longitude | latitude\n" 4445"-----+------------+----------+-----------+-----------\n" 4446" 1 | 0.5 | 0.5 | 203.5 | 6.5\n" 4447" 2 | 3427927.75 | 5793244 | 3428128.8 | 5793243.9" 4448msgstr "" 4449 4450#. Tag: para 4451#: reference_raster.xml:2314 4452#, no-c-format 4453msgid "" 4454", <xref linkend=\"RT_ST_RasterToWorldCoordY\"/>, <xref linkend=" 4455"\"RT_ST_SetSkew\"/>" 4456msgstr "" 4457 4458#. Tag: refname 4459#: reference_raster.xml:2324 4460#, no-c-format 4461msgid "ST_RasterToWorldCoordX" 4462msgstr "" 4463 4464#. Tag: refpurpose 4465#: reference_raster.xml:2325 4466#, no-c-format 4467msgid "" 4468"Returns the geometric X coordinate upper left of a raster, column and row. " 4469"Numbering of columns and rows starts at 1." 4470msgstr "" 4471 4472#. Tag: funcsynopsis 4473#: reference_raster.xml:2330 4474#, no-c-format 4475msgid "" 4476"<funcprototype> <funcdef>float8 <function>ST_RasterToWorldCoordX</function></" 4477"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 4478"paramdef> <paramdef><type>integer </type> <parameter>xcolumn</parameter></" 4479"paramdef> </funcprototype> <funcprototype> <funcdef>float8 " 4480"<function>ST_RasterToWorldCoordX</function></funcdef> <paramdef><type>raster " 4481"</type> <parameter>rast</parameter></paramdef> <paramdef><type>integer </" 4482"type> <parameter>xcolumn</parameter></paramdef> <paramdef><type>integer </" 4483"type> <parameter>yrow</parameter></paramdef> </funcprototype>" 4484msgstr "" 4485 4486#. Tag: para 4487#: reference_raster.xml:2348 4488#, no-c-format 4489msgid "" 4490"Returns the upper left X coordinate of a raster column row in geometric " 4491"units of the georeferenced raster. Numbering of columns and rows starts at 1 " 4492"but if you pass in a negative number or number higher than number of columns " 4493"in raster, it will give you coordinates outside of the raster file to left " 4494"or right with the assumption that the skew and pixel sizes are same as " 4495"selected raster." 4496msgstr "" 4497 4498#. Tag: para 4499#: reference_raster.xml:2353 4500#, no-c-format 4501msgid "" 4502"For non-skewed rasters, providing the X column is sufficient. For skewed " 4503"rasters, the georeferenced coordinate is a function of the ST_ScaleX and " 4504"ST_SkewX and row and column. An error will be raised if you give just the X " 4505"column for a skewed raster." 4506msgstr "" 4507 4508#. Tag: para 4509#: reference_raster.xml:2357 4510#, no-c-format 4511msgid "Changed: 2.1.0 In prior versions, this was called ST_Raster2WorldCoordX" 4512msgstr "" 4513 4514#. Tag: programlisting 4515#: reference_raster.xml:2364 4516#, no-c-format 4517msgid "" 4518"-- non-skewed raster providing column is sufficient\n" 4519"SELECT rid, ST_RasterToWorldCoordX(rast,1) As x1coord,\n" 4520" ST_RasterToWorldCoordX(rast,2) As x2coord,\n" 4521" ST_ScaleX(rast) As pixelx\n" 4522"FROM dummy_rast;\n" 4523"\n" 4524" rid | x1coord | x2coord | pixelx\n" 4525"-----+------------+-----------+--------\n" 4526" 1 | 0.5 | 2.5 | 2\n" 4527" 2 | 3427927.75 | 3427927.8 | 0.05" 4528msgstr "" 4529 4530#. Tag: programlisting 4531#: reference_raster.xml:2366 4532#, no-c-format 4533msgid "" 4534"-- for fun lets skew it\n" 4535"SELECT rid, ST_RasterToWorldCoordX(rast, 1, 1) As x1coord,\n" 4536" ST_RasterToWorldCoordX(rast, 2, 3) As x2coord,\n" 4537" ST_ScaleX(rast) As pixelx\n" 4538"FROM (SELECT rid, ST_SetSkew(rast, 100.5, 0) As rast FROM dummy_rast) As " 4539"foo;\n" 4540"\n" 4541" rid | x1coord | x2coord | pixelx\n" 4542"-----+------------+-----------+--------\n" 4543" 1 | 0.5 | 203.5 | 2\n" 4544" 2 | 3427927.75 | 3428128.8 | 0.05" 4545msgstr "" 4546 4547#. Tag: para 4548#: reference_raster.xml:2373 4549#, no-c-format 4550msgid "" 4551", <xref linkend=\"RT_ST_RasterToWorldCoordY\"/>, <xref linkend=" 4552"\"RT_ST_SetSkew\"/>, <xref linkend=\"RT_ST_SkewX\"/>" 4553msgstr "" 4554 4555#. Tag: refname 4556#: reference_raster.xml:2379 4557#, no-c-format 4558msgid "ST_RasterToWorldCoordY" 4559msgstr "" 4560 4561#. Tag: refpurpose 4562#: reference_raster.xml:2380 4563#, no-c-format 4564msgid "" 4565"Returns the geometric Y coordinate upper left corner of a raster, column and " 4566"row. Numbering of columns and rows starts at 1." 4567msgstr "" 4568 4569#. Tag: funcsynopsis 4570#: reference_raster.xml:2385 4571#, no-c-format 4572msgid "" 4573"<funcprototype> <funcdef>float8 <function>ST_RasterToWorldCoordY</function></" 4574"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 4575"paramdef> <paramdef><type>integer </type> <parameter>yrow</parameter></" 4576"paramdef> </funcprototype> <funcprototype> <funcdef>float8 " 4577"<function>ST_RasterToWorldCoordY</function></funcdef> <paramdef><type>raster " 4578"</type> <parameter>rast</parameter></paramdef> <paramdef><type>integer </" 4579"type> <parameter>xcolumn</parameter></paramdef> <paramdef><type>integer </" 4580"type> <parameter>yrow</parameter></paramdef> </funcprototype>" 4581msgstr "" 4582 4583#. Tag: para 4584#: reference_raster.xml:2403 4585#, no-c-format 4586msgid "" 4587"Returns the upper left Y coordinate of a raster column row in geometric " 4588"units of the georeferenced raster. Numbering of columns and rows starts at 1 " 4589"but if you pass in a negative number or number higher than number of columns/" 4590"rows in raster, it will give you coordinates outside of the raster file to " 4591"left or right with the assumption that the skew and pixel sizes are same as " 4592"selected raster tile." 4593msgstr "" 4594 4595#. Tag: para 4596#: reference_raster.xml:2408 4597#, no-c-format 4598msgid "" 4599"For non-skewed rasters, providing the Y column is sufficient. For skewed " 4600"rasters, the georeferenced coordinate is a function of the ST_ScaleY and " 4601"ST_SkewY and row and column. An error will be raised if you give just the Y " 4602"row for a skewed raster." 4603msgstr "" 4604 4605#. Tag: para 4606#: reference_raster.xml:2412 4607#, no-c-format 4608msgid "Changed: 2.1.0 In prior versions, this was called ST_Raster2WorldCoordY" 4609msgstr "" 4610 4611#. Tag: programlisting 4612#: reference_raster.xml:2418 4613#, no-c-format 4614msgid "" 4615"-- non-skewed raster providing row is sufficient\n" 4616"SELECT rid, ST_RasterToWorldCoordY(rast,1) As y1coord,\n" 4617" ST_RasterToWorldCoordY(rast,3) As y2coord,\n" 4618" ST_ScaleY(rast) As pixely\n" 4619"FROM dummy_rast;\n" 4620"\n" 4621" rid | y1coord | y2coord | pixely\n" 4622"-----+---------+-----------+--------\n" 4623" 1 | 0.5 | 6.5 | 3\n" 4624" 2 | 5793244 | 5793243.9 | -0.05" 4625msgstr "" 4626 4627#. Tag: programlisting 4628#: reference_raster.xml:2420 4629#, no-c-format 4630msgid "" 4631"-- for fun lets skew it\n" 4632"SELECT rid, ST_RasterToWorldCoordY(rast,1,1) As y1coord,\n" 4633" ST_RasterToWorldCoordY(rast,2,3) As y2coord,\n" 4634" ST_ScaleY(rast) As pixely\n" 4635"FROM (SELECT rid, ST_SetSkew(rast,0,100.5) As rast FROM dummy_rast) As foo;\n" 4636"\n" 4637" rid | y1coord | y2coord | pixely\n" 4638"-----+---------+-----------+--------\n" 4639" 1 | 0.5 | 107 | 3\n" 4640" 2 | 5793244 | 5793344.4 | -0.05" 4641msgstr "" 4642 4643#. Tag: para 4644#: reference_raster.xml:2427 4645#, no-c-format 4646msgid "" 4647", <xref linkend=\"RT_ST_RasterToWorldCoordX\"/>, <xref linkend=" 4648"\"RT_ST_SetSkew\"/>, <xref linkend=\"RT_ST_SkewY\"/>" 4649msgstr "" 4650 4651#. Tag: refname 4652#: reference_raster.xml:2433 4653#, no-c-format 4654msgid "ST_Rotation" 4655msgstr "ST_Rotation" 4656 4657#. Tag: refpurpose 4658#: reference_raster.xml:2434 4659#, no-c-format 4660msgid "Returns the rotation of the raster in radian." 4661msgstr "" 4662 4663#. Tag: funcprototype 4664#: reference_raster.xml:2439 4665#, no-c-format 4666msgid "" 4667"<funcdef>float8 <function>ST_Rotation</function></funcdef> " 4668"<paramdef><type>raster</type> <parameter>rast</parameter></paramdef>" 4669msgstr "" 4670"<funcdef>float8 <function>ST_Rotation</function></funcdef> " 4671"<paramdef><type>raster</type> <parameter>rast</parameter></paramdef>" 4672 4673#. Tag: para 4674#: reference_raster.xml:2449 4675#, no-c-format 4676msgid "" 4677"Returns the uniform rotation of the raster in radian. If a raster does not " 4678"have uniform rotation, NaN is returned. Refer to <ulink url=\"http://en." 4679"wikipedia.org/wiki/World_file\">World File</ulink> for more details." 4680msgstr "" 4681 4682#. Tag: programlisting 4683#: reference_raster.xml:2456 4684#, fuzzy, no-c-format 4685msgid "" 4686"SELECT rid, ST_Rotation(ST_SetScale(ST_SetSkew(rast, sqrt(2)), sqrt(2))) as " 4687"rot FROM dummy_rast;\n" 4688"\n" 4689" rid | rot\n" 4690"-----+-------------------\n" 4691" 1 | 0.785398163397448\n" 4692" 2 | 0.785398163397448" 4693msgstr "" 4694"SELECT rid, ST_Rotation(ST_SetScale(ST_SetSkew(rast, sqrt(2)), sqrt(2))) as " 4695"rot FROM dummy_rast;\n" 4696"\n" 4697" rid | rot \n" 4698"-----+-------------------\n" 4699" 1 | 0.785398163397448\n" 4700" 2 | 0.785398163397448" 4701 4702#. Tag: para 4703#: reference_raster.xml:2462 4704#, no-c-format 4705msgid ", <xref linkend=\"RT_ST_SetScale\"/>, <xref linkend=\"RT_ST_SetSkew\"/>" 4706msgstr "" 4707", <xref linkend=\"RT_ST_SetScale\"/>, <xref linkend=\"RT_ST_SetSkew\"/>" 4708 4709#. Tag: refname 4710#: reference_raster.xml:2468 4711#, no-c-format 4712msgid "ST_SkewX" 4713msgstr "ST_SkewX" 4714 4715#. Tag: refpurpose 4716#: reference_raster.xml:2469 4717#, no-c-format 4718msgid "Returns the georeference X skew (or rotation parameter)." 4719msgstr "" 4720 4721#. Tag: funcprototype 4722#: reference_raster.xml:2474 4723#, no-c-format 4724msgid "" 4725"<funcdef>float8 <function>ST_SkewX</function></funcdef> " 4726"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4727msgstr "" 4728"<funcdef>float8 <function>ST_SkewX</function></funcdef> " 4729"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4730 4731#. Tag: para 4732#: reference_raster.xml:2484 4733#, no-c-format 4734msgid "" 4735"Returns the georeference X skew (or rotation parameter). Refer to <ulink url=" 4736"\"http://en.wikipedia.org/wiki/World_file\">World File</ulink> for more " 4737"details." 4738msgstr "" 4739 4740#. Tag: programlisting 4741#: reference_raster.xml:2491 reference_raster.xml:2527 4742#, fuzzy, no-c-format 4743msgid "" 4744"SELECT rid, ST_SkewX(rast) As skewx, ST_SkewY(rast) As skewy,\n" 4745" ST_GeoReference(rast) as georef\n" 4746"FROM dummy_rast;\n" 4747"\n" 4748" rid | skewx | skewy | georef\n" 4749"-----+-------+-------+--------------------\n" 4750" 1 | 0 | 0 | 2.0000000000\n" 4751" : 0.0000000000\n" 4752" : 0.0000000000\n" 4753" : 3.0000000000\n" 4754" : 0.5000000000\n" 4755" : 0.5000000000\n" 4756" :\n" 4757" 2 | 0 | 0 | 0.0500000000\n" 4758" : 0.0000000000\n" 4759" : 0.0000000000\n" 4760" : -0.0500000000\n" 4761" : 3427927.7500000000\n" 4762" : 5793244.0000000000" 4763msgstr "" 4764"SELECT rid, ST_SkewX(rast) As skewx, ST_SkewY(rast) As skewy, \n" 4765" ST_GeoReference(rast) as georef\n" 4766"FROM dummy_rast;\n" 4767"\n" 4768" rid | skewx | skewy | georef\n" 4769"-----+-------+-------+--------------------\n" 4770" 1 | 0 | 0 | 2.0000000000\n" 4771" : 0.0000000000\n" 4772" : 0.0000000000\n" 4773" : 3.0000000000\n" 4774" : 0.5000000000\n" 4775" : 0.5000000000\n" 4776" :\n" 4777" 2 | 0 | 0 | 0.0500000000\n" 4778" : 0.0000000000\n" 4779" : 0.0000000000\n" 4780" : -0.0500000000\n" 4781" : 3427927.7500000000\n" 4782" : 5793244.0000000000" 4783 4784#. Tag: para 4785#: reference_raster.xml:2498 4786#, no-c-format 4787msgid ", <xref linkend=\"RT_ST_SkewY\"/>, <xref linkend=\"RT_ST_SetSkew\"/>" 4788msgstr ", <xref linkend=\"RT_ST_SkewY\"/>, <xref linkend=\"RT_ST_SetSkew\"/>" 4789 4790#. Tag: refname 4791#: reference_raster.xml:2504 4792#, no-c-format 4793msgid "ST_SkewY" 4794msgstr "ST_SkewY" 4795 4796#. Tag: refpurpose 4797#: reference_raster.xml:2505 4798#, no-c-format 4799msgid "Returns the georeference Y skew (or rotation parameter)." 4800msgstr "" 4801 4802#. Tag: funcprototype 4803#: reference_raster.xml:2510 4804#, no-c-format 4805msgid "" 4806"<funcdef>float8 <function>ST_SkewY</function></funcdef> " 4807"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4808msgstr "" 4809"<funcdef>float8 <function>ST_SkewY</function></funcdef> " 4810"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4811 4812#. Tag: para 4813#: reference_raster.xml:2520 4814#, no-c-format 4815msgid "" 4816"Returns the georeference Y skew (or rotation parameter). Refer to <ulink url=" 4817"\"http://en.wikipedia.org/wiki/World_file\">World File</ulink> for more " 4818"details." 4819msgstr "" 4820 4821#. Tag: para 4822#: reference_raster.xml:2534 4823#, no-c-format 4824msgid ", <xref linkend=\"RT_ST_SkewX\"/>, <xref linkend=\"RT_ST_SetSkew\"/>" 4825msgstr "" 4826 4827#. Tag: refname 4828#: reference_raster.xml:2540 4829#, no-c-format 4830msgid "ST_SRID" 4831msgstr "ST_SRID" 4832 4833#. Tag: refpurpose 4834#: reference_raster.xml:2541 4835#, no-c-format 4836msgid "" 4837"Returns the spatial reference identifier of the raster as defined in " 4838"spatial_ref_sys table." 4839msgstr "" 4840 4841#. Tag: funcprototype 4842#: reference_raster.xml:2546 4843#, no-c-format 4844msgid "" 4845"<funcdef>integer <function>ST_SRID</function></funcdef> " 4846"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4847msgstr "" 4848"<funcdef>integer <function>ST_SRID</function></funcdef> " 4849"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4850 4851#. Tag: para 4852#: reference_raster.xml:2556 4853#, no-c-format 4854msgid "" 4855"Returns the spatial reference identifier of the raster object as defined in " 4856"the spatial_ref_sys table." 4857msgstr "" 4858 4859#. Tag: para 4860#: reference_raster.xml:2557 4861#, no-c-format 4862msgid "" 4863"From PostGIS 2.0+ the srid of a non-georeferenced raster/geometry is 0 " 4864"instead of the prior -1." 4865msgstr "" 4866 4867#. Tag: programlisting 4868#: reference_raster.xml:2563 4869#, no-c-format 4870msgid "" 4871"SELECT ST_SRID(rast) As srid\n" 4872"FROM dummy_rast WHERE rid=1;\n" 4873"\n" 4874"srid\n" 4875"----------------\n" 4876"0" 4877msgstr "" 4878"SELECT ST_SRID(rast) As srid\n" 4879"FROM dummy_rast WHERE rid=1;\n" 4880"\n" 4881"srid\n" 4882"----------------\n" 4883"0" 4884 4885#. Tag: para 4886#: reference_raster.xml:2569 4887#, no-c-format 4888msgid ", <xref linkend=\"ST_SRID\"/>" 4889msgstr ", <xref linkend=\"ST_SRID\"/>" 4890 4891#. Tag: refname 4892#: reference_raster.xml:2575 4893#, no-c-format 4894msgid "ST_Summary" 4895msgstr "" 4896 4897#. Tag: refpurpose 4898#: reference_raster.xml:2576 4899#, no-c-format 4900msgid "" 4901"<refpurpose>Returns a text summary of the contents of the raster.</" 4902"refpurpose>" 4903msgstr "" 4904 4905#. Tag: funcprototype 4906#: reference_raster.xml:2581 4907#, no-c-format 4908msgid "" 4909"<funcdef>text <function>ST_Summary</function></funcdef> " 4910"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4911msgstr "" 4912 4913#. Tag: para 4914#: reference_raster.xml:2591 4915#, no-c-format 4916msgid "<para>Returns a text summary of the contents of the raster.</para>" 4917msgstr "" 4918 4919#. Tag: programlisting 4920#: reference_raster.xml:2598 4921#, no-c-format 4922msgid "" 4923"SELECT ST_Summary(\n" 4924" ST_AddBand(\n" 4925" ST_AddBand(\n" 4926" ST_AddBand(\n" 4927" ST_MakeEmptyRaster(10, 10, 0, 0, 1, -1, 0, " 4928"0, 0)\n" 4929" , 1, '8BUI', 1, 0\n" 4930" )\n" 4931" , 2, '32BF', 0, -9999\n" 4932" )\n" 4933" , 3, '16BSI', 0, NULL\n" 4934" )\n" 4935");\n" 4936"\n" 4937" st_summary\n" 4938"------------------------------------------------------------------\n" 4939" Raster of 10x10 pixels has 3 bands and extent of BOX(0 -10,10 0)+\n" 4940" band 1 of pixtype 8BUI is in-db with NODATA value of 0 +\n" 4941" band 2 of pixtype 32BF is in-db with NODATA value of -9999 +\n" 4942" band 3 of pixtype 16BSI is in-db with no NODATA value\n" 4943"(1 row)" 4944msgstr "" 4945 4946#. Tag: para 4947#: reference_raster.xml:2603 4948#, no-c-format 4949msgid "" 4950", <xref linkend=\"RT_ST_BandMetaData\"/>, <xref linkend=\"ST_Summary\"/> " 4951"<xref linkend=\"ST_Extent\"/>" 4952msgstr "" 4953 4954#. Tag: refname 4955#: reference_raster.xml:2614 4956#, no-c-format 4957msgid "ST_UpperLeftX" 4958msgstr "ST_UpperLeftX" 4959 4960#. Tag: refpurpose 4961#: reference_raster.xml:2615 4962#, no-c-format 4963msgid "" 4964"<refpurpose>Returns the upper left X coordinate of raster in projected " 4965"spatial ref.</refpurpose>" 4966msgstr "" 4967 4968#. Tag: funcprototype 4969#: reference_raster.xml:2620 4970#, no-c-format 4971msgid "" 4972"<funcdef>float8 <function>ST_UpperLeftX</function></funcdef> " 4973"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4974msgstr "" 4975"<funcdef>float8 <function>ST_UpperLeftX</function></funcdef> " 4976"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 4977 4978#. Tag: para 4979#: reference_raster.xml:2630 4980#, no-c-format 4981msgid "" 4982"<para>Returns the upper left X coordinate of raster in projected spatial ref." 4983"</para>" 4984msgstr "" 4985 4986#. Tag: programlisting 4987#: reference_raster.xml:2636 4988#, no-c-format 4989msgid "" 4990"SELECt rid, ST_UpperLeftX(rast) As ulx\n" 4991"FROM dummy_rast;\n" 4992"\n" 4993" rid | ulx\n" 4994"-----+------------\n" 4995" 1 | 0.5\n" 4996" 2 | 3427927.75" 4997msgstr "" 4998"SELECt rid, ST_UpperLeftX(rast) As ulx\n" 4999"FROM dummy_rast;\n" 5000"\n" 5001" rid | ulx\n" 5002"-----+------------\n" 5003" 1 | 0.5\n" 5004" 2 | 3427927.75" 5005 5006#. Tag: para 5007#: reference_raster.xml:2642 reference_raster.xml:2676 5008#, no-c-format 5009msgid ", <xref linkend=\"RT_ST_GeoReference\"/>, <xref linkend=\"RT_Box3D\"/>" 5010msgstr ", <xref linkend=\"RT_ST_GeoReference\"/>, <xref linkend=\"RT_Box3D\"/>" 5011 5012#. Tag: refname 5013#: reference_raster.xml:2648 5014#, no-c-format 5015msgid "ST_UpperLeftY" 5016msgstr "ST_UpperLeftY" 5017 5018#. Tag: refpurpose 5019#: reference_raster.xml:2649 5020#, no-c-format 5021msgid "" 5022"<refpurpose>Returns the upper left Y coordinate of raster in projected " 5023"spatial ref.</refpurpose>" 5024msgstr "" 5025 5026#. Tag: funcprototype 5027#: reference_raster.xml:2654 5028#, no-c-format 5029msgid "" 5030"<funcdef>float8 <function>ST_UpperLeftY</function></funcdef> " 5031"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 5032msgstr "" 5033"<funcdef>float8 <function>ST_UpperLeftY</function></funcdef> " 5034"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 5035 5036#. Tag: para 5037#: reference_raster.xml:2664 5038#, no-c-format 5039msgid "" 5040"<para>Returns the upper left Y coordinate of raster in projected spatial ref." 5041"</para>" 5042msgstr "" 5043 5044#. Tag: programlisting 5045#: reference_raster.xml:2670 5046#, no-c-format 5047msgid "" 5048"SELECT rid, ST_UpperLeftY(rast) As uly\n" 5049"FROM dummy_rast;\n" 5050"\n" 5051" rid | uly\n" 5052"-----+---------\n" 5053" 1 | 0.5\n" 5054" 2 | 5793244" 5055msgstr "" 5056"SELECT rid, ST_UpperLeftY(rast) As uly\n" 5057"FROM dummy_rast;\n" 5058"\n" 5059" rid | uly\n" 5060"-----+---------\n" 5061" 1 | 0.5\n" 5062" 2 | 5793244" 5063 5064#. Tag: refname 5065#: reference_raster.xml:2682 5066#, no-c-format 5067msgid "ST_Width" 5068msgstr "ST_Width" 5069 5070#. Tag: refpurpose 5071#: reference_raster.xml:2683 5072#, no-c-format 5073msgid "<refpurpose>Returns the width of the raster in pixels.</refpurpose>" 5074msgstr "" 5075 5076#. Tag: funcprototype 5077#: reference_raster.xml:2688 5078#, no-c-format 5079msgid "" 5080"<funcdef>integer <function>ST_Width</function></funcdef> " 5081"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 5082msgstr "" 5083 5084#. Tag: para 5085#: reference_raster.xml:2698 5086#, no-c-format 5087msgid "<para>Returns the width of the raster in pixels.</para>" 5088msgstr "" 5089 5090#. Tag: programlisting 5091#: reference_raster.xml:2704 5092#, no-c-format 5093msgid "" 5094"SELECT ST_Width(rast) As rastwidth\n" 5095"FROM dummy_rast WHERE rid=1;\n" 5096"\n" 5097"rastwidth\n" 5098"----------------\n" 5099"10" 5100msgstr "" 5101"SELECT ST_Width(rast) As rastwidth\n" 5102"FROM dummy_rast WHERE rid=1;\n" 5103"\n" 5104"rastwidth\n" 5105"----------------\n" 5106"10" 5107 5108#. Tag: refname 5109#: reference_raster.xml:2718 5110#, no-c-format 5111msgid "ST_WorldToRasterCoord" 5112msgstr "" 5113 5114#. Tag: refpurpose 5115#: reference_raster.xml:2719 5116#, no-c-format 5117msgid "" 5118"Returns the upper left corner as column and row given geometric X and Y " 5119"(longitude and latitude) or a point geometry expressed in the spatial " 5120"reference coordinate system of the raster." 5121msgstr "" 5122 5123#. Tag: funcsynopsis 5124#: reference_raster.xml:2723 5125#, no-c-format 5126msgid "" 5127"<funcprototype> <funcdef>record <function>ST_WorldToRasterCoord</function></" 5128"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 5129"paramdef> <paramdef><type>geometry </type> <parameter>pt</parameter></" 5130"paramdef> </funcprototype> <funcprototype> <funcdef>record " 5131"<function>ST_WorldToRasterCoord</function></funcdef> <paramdef><type>raster " 5132"</type> <parameter>rast</parameter></paramdef> <paramdef><type>double " 5133"precision </type> <parameter>longitude</parameter></paramdef> " 5134"<paramdef><type>double precision </type> <parameter>latitude</parameter></" 5135"paramdef> </funcprototype>" 5136msgstr "" 5137 5138#. Tag: para 5139#: reference_raster.xml:2742 5140#, no-c-format 5141msgid "" 5142"Returns the upper left corner as column and row given geometric X and Y " 5143"(longitude and latitude) or a point geometry. This function works regardless " 5144"of whether or not the geometric X and Y or point geometry is outside the " 5145"extent of the raster. Geometric X and Y must be expressed in the spatial " 5146"reference coordinate system of the raster." 5147msgstr "" 5148 5149#. Tag: programlisting 5150#: reference_raster.xml:2755 5151#, no-c-format 5152msgid "" 5153"SELECT\n" 5154" rid,\n" 5155" (ST_WorldToRasterCoord(rast,3427927.8,20.5)).*,\n" 5156" (ST_WorldToRasterCoord(rast,ST_GeomFromText('POINT(3427927.8 20.5)'," 5157"ST_SRID(rast)))).*\n" 5158"FROM dummy_rast;\n" 5159"\n" 5160" rid | columnx | rowy | columnx | rowy\n" 5161"-----+---------+-----------+---------+-----------\n" 5162" 1 | 1713964 | 7 | 1713964 | 7\n" 5163" 2 | 2 | 115864471 | 2 | 115864471" 5164msgstr "" 5165 5166#. Tag: para 5167#: reference_raster.xml:2761 5168#, no-c-format 5169msgid "" 5170", <xref linkend=\"RT_ST_WorldToRasterCoordY\"/>, <xref linkend=" 5171"\"RT_ST_RasterToWorldCoordX\"/>, <xref linkend=\"RT_ST_RasterToWorldCoordY\"/" 5172">, <xref linkend=\"RT_ST_SRID\"/>" 5173msgstr "" 5174 5175#. Tag: refname 5176#: reference_raster.xml:2773 5177#, no-c-format 5178msgid "ST_WorldToRasterCoordX" 5179msgstr "" 5180 5181#. Tag: refpurpose 5182#: reference_raster.xml:2774 5183#, no-c-format 5184msgid "" 5185"Returns the column in the raster of the point geometry (pt) or a X and Y " 5186"world coordinate (xw, yw) represented in world spatial reference system of " 5187"raster." 5188msgstr "" 5189 5190#. Tag: funcsynopsis 5191#: reference_raster.xml:2779 5192#, no-c-format 5193msgid "" 5194"<funcprototype> <funcdef>integer <function>ST_WorldToRasterCoordX</" 5195"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 5196"parameter></paramdef> <paramdef><type>geometry </type> <parameter>pt</" 5197"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>integer " 5198"<function>ST_WorldToRasterCoordX</function></funcdef> <paramdef><type>raster " 5199"</type> <parameter>rast</parameter></paramdef> <paramdef><type>double " 5200"precision </type> <parameter>xw</parameter></paramdef> </funcprototype> " 5201"<funcprototype> <funcdef>integer <function>ST_WorldToRasterCoordX</" 5202"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 5203"parameter></paramdef> <paramdef><type>double precision </type> " 5204"<parameter>xw</parameter></paramdef> <paramdef><type>double precision </" 5205"type> <parameter>yw</parameter></paramdef> </funcprototype>" 5206msgstr "" 5207 5208#. Tag: para 5209#: reference_raster.xml:2804 5210#, no-c-format 5211msgid "" 5212"Returns the column in the raster of the point geometry (pt) or a X and Y " 5213"world coordinate (xw, yw). A point, or (both xw and yw world coordinates are " 5214"required if a raster is skewed). If a raster is not skewed then xw is " 5215"sufficient. World coordinates are in the spatial reference coordinate system " 5216"of the raster." 5217msgstr "" 5218 5219#. Tag: para 5220#: reference_raster.xml:2806 5221#, no-c-format 5222msgid "Changed: 2.1.0 In prior versions, this was called ST_World2RasterCoordX" 5223msgstr "" 5224 5225#. Tag: programlisting 5226#: reference_raster.xml:2812 5227#, no-c-format 5228msgid "" 5229"SELECT rid, ST_WorldToRasterCoordX(rast,3427927.8) As xcoord,\n" 5230" ST_WorldToRasterCoordX(rast,3427927.8,20.5) As xcoord_xwyw,\n" 5231" ST_WorldToRasterCoordX(rast,ST_GeomFromText('POINT(3427927.8 " 5232"20.5)',ST_SRID(rast))) As ptxcoord\n" 5233"FROM dummy_rast;\n" 5234"\n" 5235" rid | xcoord | xcoord_xwyw | ptxcoord\n" 5236"-----+---------+---------+----------\n" 5237" 1 | 1713964 | 1713964 | 1713964\n" 5238" 2 | 1 | 1 | 1" 5239msgstr "" 5240 5241#. Tag: para 5242#: reference_raster.xml:2818 reference_raster.xml:2873 5243#, no-c-format 5244msgid "" 5245", <xref linkend=\"RT_ST_RasterToWorldCoordY\"/>, <xref linkend=\"RT_ST_SRID" 5246"\"/>" 5247msgstr "" 5248 5249#. Tag: refname 5250#: reference_raster.xml:2828 5251#, no-c-format 5252msgid "ST_WorldToRasterCoordY" 5253msgstr "" 5254 5255#. Tag: refpurpose 5256#: reference_raster.xml:2829 5257#, no-c-format 5258msgid "" 5259"Returns the row in the raster of the point geometry (pt) or a X and Y world " 5260"coordinate (xw, yw) represented in world spatial reference system of raster." 5261msgstr "" 5262 5263#. Tag: funcsynopsis 5264#: reference_raster.xml:2834 5265#, no-c-format 5266msgid "" 5267"<funcprototype> <funcdef>integer <function>ST_WorldToRasterCoordY</" 5268"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 5269"parameter></paramdef> <paramdef><type>geometry </type> <parameter>pt</" 5270"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>integer " 5271"<function>ST_WorldToRasterCoordY</function></funcdef> <paramdef><type>raster " 5272"</type> <parameter>rast</parameter></paramdef> <paramdef><type>double " 5273"precision </type> <parameter>xw</parameter></paramdef> </funcprototype> " 5274"<funcprototype> <funcdef>integer <function>ST_WorldToRasterCoordY</" 5275"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 5276"parameter></paramdef> <paramdef><type>double precision </type> " 5277"<parameter>xw</parameter></paramdef> <paramdef><type>double precision </" 5278"type> <parameter>yw</parameter></paramdef> </funcprototype>" 5279msgstr "" 5280 5281#. Tag: para 5282#: reference_raster.xml:2859 5283#, no-c-format 5284msgid "" 5285"Returns the row in the raster of the point geometry (pt) or a X and Y world " 5286"coordinate (xw, yw). A point, or (both xw and yw world coordinates are " 5287"required if a raster is skewed). If a raster is not skewed then xw is " 5288"sufficient. World coordinates are in the spatial reference coordinate system " 5289"of the raster." 5290msgstr "" 5291 5292#. Tag: para 5293#: reference_raster.xml:2861 5294#, no-c-format 5295msgid "Changed: 2.1.0 In prior versions, this was called ST_World2RasterCoordY" 5296msgstr "" 5297 5298#. Tag: programlisting 5299#: reference_raster.xml:2867 5300#, no-c-format 5301msgid "" 5302"SELECT rid, ST_WorldToRasterCoordY(rast,20.5) As ycoord,\n" 5303" ST_WorldToRasterCoordY(rast,3427927.8,20.5) As ycoord_xwyw,\n" 5304" ST_WorldToRasterCoordY(rast,ST_GeomFromText('POINT(3427927.8 " 5305"20.5)',ST_SRID(rast))) As ptycoord\n" 5306"FROM dummy_rast;\n" 5307"\n" 5308" rid | ycoord | ycoord_xwyw | ptycoord\n" 5309"-----+-----------+-------------+-----------\n" 5310" 1 | 7 | 7 | 7\n" 5311" 2 | 115864471 | 115864471 | 115864471" 5312msgstr "" 5313 5314#. Tag: title 5315#: reference_raster.xml:2880 5316#, no-c-format 5317msgid "Raster Band Accessors" 5318msgstr "" 5319 5320#. Tag: refname 5321#: reference_raster.xml:2883 5322#, no-c-format 5323msgid "ST_BandMetaData" 5324msgstr "ST_BandMetaData" 5325 5326#. Tag: refpurpose 5327#: reference_raster.xml:2884 5328#, no-c-format 5329msgid "" 5330"Returns basic meta data for a specific raster band. band num 1 is assumed if " 5331"none-specified." 5332msgstr "" 5333 5334#. Tag: funcsynopsis 5335#: reference_raster.xml:2888 5336#, fuzzy, no-c-format 5337msgid "" 5338"<funcprototype> <funcdef>(1) record <function>ST_BandMetaData</function></" 5339"funcdef> <paramdef><type>raster </type><parameter>rast</parameter></" 5340"paramdef> <paramdef choice=\"opt\"><type>integer </type><parameter>band=1</" 5341"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>(2) record " 5342"<function>ST_BandMetaData</function></funcdef> <paramdef><type>raster </" 5343"type><parameter>rast</parameter></paramdef> <paramdef choice=\"opt" 5344"\"><type>integer[] </type><parameter>band</parameter></paramdef> </" 5345"funcprototype>" 5346msgstr "" 5347"<funcprototype> <funcdef>raster <function>ST_SetScale</function></funcdef> " 5348"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 5349"<paramdef><type>float8 </type> <parameter>xy</parameter></paramdef> </" 5350"funcprototype> <funcprototype> <funcdef>raster <function>ST_SetScale</" 5351"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 5352"parameter></paramdef> <paramdef><type>float8 </type> <parameter>x</" 5353"parameter></paramdef> <paramdef><type>float8 </type> <parameter>y</" 5354"parameter></paramdef> </funcprototype>" 5355 5356#. Tag: para 5357#: reference_raster.xml:2905 5358#, no-c-format 5359msgid "" 5360"Returns basic meta data about a raster band. Columns returned: pixeltype, " 5361"nodatavalue, isoutdb, path, outdbbandnum, filesize, filetimestamp." 5362msgstr "" 5363 5364#. Tag: para 5365#: reference_raster.xml:2908 5366#, no-c-format 5367msgid "If raster contains no bands then an error is thrown." 5368msgstr "" 5369 5370#. Tag: para 5371#: reference_raster.xml:2914 5372#, no-c-format 5373msgid "If band has no NODATA value, nodatavalue are NULL." 5374msgstr "" 5375 5376#. Tag: para 5377#: reference_raster.xml:2919 5378#, no-c-format 5379msgid "" 5380"If isoutdb is False, path, outdbbandnum, filesize and filetimestamp are " 5381"NULL. If outdb access is disabled, filesize and filetimestamp will also be " 5382"NULL." 5383msgstr "" 5384 5385#. Tag: para 5386#: reference_raster.xml:2924 5387#, no-c-format 5388msgid "" 5389"Enhanced: 2.5.0 to include <emphasis>outdbbandnum</emphasis>, " 5390"<emphasis>filesize</emphasis> and <emphasis>filetimestamp</emphasis> for " 5391"outdb rasters." 5392msgstr "" 5393 5394#. Tag: title 5395#: reference_raster.xml:2928 reference_raster.xml:3987 5396#: reference_raster.xml:6874 reference_raster.xml:7299 5397#: reference_raster.xml:8905 reference_raster.xml:9348 5398#: reference_raster.xml:9445 reference_raster.xml:9573 5399#, no-c-format 5400msgid "Examples: Variant 1" 5401msgstr "" 5402 5403#. Tag: programlisting 5404#: reference_raster.xml:2930 5405#, fuzzy, no-c-format 5406msgid "" 5407"SELECT\n" 5408" rid,\n" 5409" (foo.md).*\n" 5410"FROM (\n" 5411" SELECT\n" 5412" rid,\n" 5413" ST_BandMetaData(rast, 1) AS md\n" 5414" FROM dummy_rast\n" 5415" WHERE rid=2\n" 5416") As foo;\n" 5417"\n" 5418" rid | pixeltype | nodatavalue | isoutdb | path | outdbbandnum\n" 5419"-----+-----------+---- --------+---------+------+--------------\n" 5420" 2 | 8BUI | 0 | f | |" 5421msgstr "" 5422"SELECT rid, (foo.md).* \n" 5423" FROM (SELECT rid, ST_BandMetaData(rast,1) As md\n" 5424"FROM dummy_rast WHERE rid=2) As foo;\n" 5425"\n" 5426" rid | pixeltype | nodatavalue | isoutdb | path\n" 5427"-----+-----------+----------------+-------------+---------+------\n" 5428" 2 | 8BUI | 0 | f |" 5429 5430#. Tag: title 5431#: reference_raster.xml:2935 reference_raster.xml:4000 5432#: reference_raster.xml:6918 reference_raster.xml:8912 5433#: reference_raster.xml:9353 reference_raster.xml:9450 5434#: reference_raster.xml:9578 5435#, no-c-format 5436msgid "Examples: Variant 2" 5437msgstr "" 5438 5439#. Tag: programlisting 5440#: reference_raster.xml:2937 5441#, no-c-format 5442msgid "" 5443"WITH foo AS (\n" 5444" SELECT\n" 5445" ST_AddBand(NULL::raster, '/home/pele/devel/geo/postgis-git/" 5446"raster/test/regress/loader/Projected.tif', NULL::int[]) AS rast\n" 5447")\n" 5448"SELECT\n" 5449" *\n" 5450"FROM ST_BandMetadata(\n" 5451" (SELECT rast FROM foo),\n" 5452" ARRAY[1,3,2]::int[]\n" 5453");\n" 5454"\n" 5455" bandnum | pixeltype | nodatavalue | isoutdb " 5456"| " 5457"path | outdbbandnum | filesize | " 5458"filetimestamp |\n" 5459"---------+-----------+-------------+---------" 5460"+--------------------------------------------------------------------------------" 5461"+---------------+----------+---------------+-\n" 5462" 1 | 8BUI | | t | /home/pele/devel/geo/postgis-" 5463"git/raster/test/regress/loader/Projected.tif | 1 | 12345 " 5464"| 1521807257 |\n" 5465" 3 | 8BUI | | t | /home/pele/devel/geo/postgis-" 5466"git/raster/test/regress/loader/Projected.tif | 3 | 12345 " 5467"| 1521807257 |\n" 5468" 2 | 8BUI | | t | /home/pele/devel/geo/postgis-" 5469"git/raster/test/regress/loader/Projected.tif | 2 | 12345 " 5470"| 1521807257 |" 5471msgstr "" 5472 5473#. Tag: para 5474#: reference_raster.xml:2944 5475#, no-c-format 5476msgid ", <xref linkend=\"RT_ST_BandPixelType\"/>" 5477msgstr ", <xref linkend=\"RT_ST_BandPixelType\"/>" 5478 5479#. Tag: refname 5480#: reference_raster.xml:2950 5481#, no-c-format 5482msgid "ST_BandNoDataValue" 5483msgstr "ST_BandNoDataValue" 5484 5485#. Tag: refpurpose 5486#: reference_raster.xml:2951 5487#, no-c-format 5488msgid "" 5489"Returns the value in a given band that represents no data. If no band num 1 " 5490"is assumed." 5491msgstr "" 5492 5493#. Tag: funcprototype 5494#: reference_raster.xml:2956 5495#, no-c-format 5496msgid "" 5497"<funcdef>double precision <function>ST_BandNoDataValue</function></funcdef> " 5498"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 5499"<paramdef choice=\"opt\"><type>integer </type> <parameter>bandnum=1</" 5500"parameter></paramdef>" 5501msgstr "" 5502"<funcdef>double precision <function>ST_BandNoDataValue</function></funcdef> " 5503"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 5504"<paramdef choice=\"opt\"><type>integer </type> <parameter>bandnum=1</" 5505"parameter></paramdef>" 5506 5507#. Tag: para 5508#: reference_raster.xml:2967 reference_raster.xml:3165 5509#, no-c-format 5510msgid "Returns the value that represents no data for the band" 5511msgstr "" 5512 5513#. Tag: programlisting 5514#: reference_raster.xml:2973 5515#, fuzzy, no-c-format 5516msgid "" 5517"SELECT ST_BandNoDataValue(rast,1) As bnval1,\n" 5518" ST_BandNoDataValue(rast,2) As bnval2, ST_BandNoDataValue(rast,3) As " 5519"bnval3\n" 5520"FROM dummy_rast\n" 5521"WHERE rid = 2;\n" 5522"\n" 5523" bnval1 | bnval2 | bnval3\n" 5524"--------+--------+--------\n" 5525" 0 | 0 | 0" 5526msgstr "" 5527"SELECT ST_BandNoDataValue(rast,1) As bnval1, \n" 5528" ST_BandNoDataValue(rast,2) As bnval2, ST_BandNoDataValue(rast,3) As " 5529"bnval3\n" 5530"FROM dummy_rast\n" 5531"WHERE rid = 2;\n" 5532"\n" 5533" bnval1 | bnval2 | bnval3\n" 5534"--------+--------+--------\n" 5535" 0 | 0 | 0" 5536 5537#. Tag: refname 5538#: reference_raster.xml:2986 5539#, no-c-format 5540msgid "ST_BandIsNoData" 5541msgstr "ST_BandIsNoData" 5542 5543#. Tag: refpurpose 5544#: reference_raster.xml:2987 5545#, no-c-format 5546msgid "Returns true if the band is filled with only nodata values." 5547msgstr "" 5548 5549#. Tag: funcsynopsis 5550#: reference_raster.xml:2991 5551#, no-c-format 5552msgid "" 5553"<funcprototype> <funcdef>boolean <function>ST_BandIsNoData</function></" 5554"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 5555"paramdef> <paramdef><type>integer </type> <parameter>band</parameter></" 5556"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 5557"<parameter>forceChecking=true</parameter></paramdef> </funcprototype> " 5558"<funcprototype> <funcdef>boolean <function>ST_BandIsNoData</function></" 5559"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 5560"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 5561"<parameter>forceChecking=true</parameter></paramdef> </funcprototype>" 5562msgstr "" 5563"<funcprototype> <funcdef>boolean <function>ST_BandIsNoData</function></" 5564"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 5565"paramdef> <paramdef><type>integer </type> <parameter>band</parameter></" 5566"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 5567"<parameter>forceChecking=true</parameter></paramdef> </funcprototype> " 5568"<funcprototype> <funcdef>boolean <function>ST_BandIsNoData</function></" 5569"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 5570"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 5571"<parameter>forceChecking=true</parameter></paramdef> </funcprototype>" 5572 5573#. Tag: para 5574#: reference_raster.xml:3008 5575#, no-c-format 5576msgid "" 5577"Returns true if the band is filled with only nodata values. Band 1 is " 5578"assumed if not specified. If the last argument is TRUE, the entire band is " 5579"checked pixel by pixel. Otherwise, the function simply returns the value of " 5580"the isnodata flag for the band. The default value for this parameter is " 5581"FALSE, if not specified." 5582msgstr "" 5583 5584#. Tag: para 5585#: reference_raster.xml:3018 5586#, no-c-format 5587msgid "" 5588"If the flag is dirty (this is, the result is different using TRUE as last " 5589"parameter and not using it) you should update the raster to set this flag to " 5590"true, by using ST_SetBandIsNodata(), or ST_SetBandNodataValue() with TRUE as " 5591"last argument. See <xref linkend=\"RT_ST_SetBandIsNoData\"/>." 5592msgstr "" 5593 5594#. Tag: programlisting 5595#: reference_raster.xml:3028 5596#, no-c-format 5597msgid "" 5598"-- Create dummy table with one raster column\n" 5599"create table dummy_rast (rid integer, rast raster);\n" 5600"\n" 5601"-- Add raster with two bands, one pixel/band. In the first band, nodatavalue " 5602"= pixel value = 3.\n" 5603"-- In the second band, nodatavalue = 13, pixel value = 4\n" 5604"insert into dummy_rast values(1,\n" 5605"(\n" 5606"'01' -- little endian (uint8 ndr)\n" 5607"||\n" 5608"'0000' -- version (uint16 0)\n" 5609"||\n" 5610"'0200' -- nBands (uint16 0)\n" 5611"||\n" 5612"'17263529ED684A3F' -- scaleX (float64 0.000805965234044584)\n" 5613"||\n" 5614"'F9253529ED684ABF' -- scaleY (float64 -0.00080596523404458)\n" 5615"||\n" 5616"'1C9F33CE69E352C0' -- ipX (float64 -75.5533328537098)\n" 5617"||\n" 5618"'718F0E9A27A44840' -- ipY (float64 49.2824585505576)\n" 5619"||\n" 5620"'ED50EB853EC32B3F' -- skewX (float64 0.000211812383858707)\n" 5621"||\n" 5622"'7550EB853EC32B3F' -- skewY (float64 0.000211812383858704)\n" 5623"||\n" 5624"'E6100000' -- SRID (int32 4326)\n" 5625"||\n" 5626"'0100' -- width (uint16 1)\n" 5627"||\n" 5628"'0100' -- height (uint16 1)\n" 5629"||\n" 5630"'6' -- hasnodatavalue and isnodata value set to true.\n" 5631"||\n" 5632"'2' -- first band type (4BUI)\n" 5633"||\n" 5634"'03' -- novalue==3\n" 5635"||\n" 5636"'03' -- pixel(0,0)==3 (same that nodata)\n" 5637"||\n" 5638"'0' -- hasnodatavalue set to false\n" 5639"||\n" 5640"'5' -- second band type (16BSI)\n" 5641"||\n" 5642"'0D00' -- novalue==13\n" 5643"||\n" 5644"'0400' -- pixel(0,0)==4\n" 5645")::raster\n" 5646");\n" 5647"\n" 5648"select st_bandisnodata(rast, 1) from dummy_rast where rid = 1; -- Expected " 5649"true\n" 5650"select st_bandisnodata(rast, 2) from dummy_rast where rid = 1; -- Expected " 5651"false" 5652msgstr "" 5653 5654#. Tag: para 5655#: reference_raster.xml:3034 5656#, no-c-format 5657msgid "" 5658", <xref linkend=\"RT_ST_NumBands\"/>, <xref linkend=" 5659"\"RT_ST_SetBandNoDataValue\"/>, <xref linkend=\"RT_ST_SetBandIsNoData\"/>" 5660msgstr "" 5661", <xref linkend=\"RT_ST_NumBands\"/>, <xref linkend=" 5662"\"RT_ST_SetBandNoDataValue\"/>, <xref linkend=\"RT_ST_SetBandIsNoData\"/>" 5663 5664#. Tag: refname 5665#: reference_raster.xml:3043 5666#, no-c-format 5667msgid "ST_BandPath" 5668msgstr "ST_BandPath" 5669 5670#. Tag: refpurpose 5671#: reference_raster.xml:3044 5672#, no-c-format 5673msgid "" 5674"Returns system file path to a band stored in file system. If no bandnum " 5675"specified, 1 is assumed." 5676msgstr "" 5677 5678#. Tag: funcprototype 5679#: reference_raster.xml:3049 5680#, no-c-format 5681msgid "" 5682"<funcdef>text <function>ST_BandPath</function></funcdef> " 5683"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 5684"<paramdef choice=\"opt\"><type>integer </type> <parameter>bandnum=1</" 5685"parameter></paramdef>" 5686msgstr "" 5687"<funcdef>text <function>ST_BandPath</function></funcdef> " 5688"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 5689"<paramdef choice=\"opt\"><type>integer </type> <parameter>bandnum=1</" 5690"parameter></paramdef>" 5691 5692#. Tag: para 5693#: reference_raster.xml:3060 5694#, no-c-format 5695msgid "" 5696"Returns system file path to a band. Throws an error if called with an in db " 5697"band." 5698msgstr "" 5699 5700#. Tag: programlisting 5701#: reference_raster.xml:3066 5702#, no-c-format 5703msgid "<!-- TODO: -->" 5704msgstr "<!-- TODO: -->" 5705 5706#. Tag: refname 5707#: reference_raster.xml:3078 5708#, fuzzy, no-c-format 5709msgid "ST_BandFileSize" 5710msgstr "ST_BandPixelType" 5711 5712#. Tag: refpurpose 5713#: reference_raster.xml:3079 5714#, no-c-format 5715msgid "" 5716"Returns the file size of a band stored in file system. If no bandnum " 5717"specified, 1 is assumed." 5718msgstr "" 5719 5720#. Tag: funcprototype 5721#: reference_raster.xml:3084 5722#, fuzzy, no-c-format 5723msgid "" 5724"<funcdef>bigint <function>ST_BandFileSize</function></funcdef> " 5725"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 5726"<paramdef choice=\"opt\"><type>integer </type> <parameter>bandnum=1</" 5727"parameter></paramdef>" 5728msgstr "" 5729"<funcdef>text <function>ST_BandPixelType</function></funcdef> " 5730"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 5731"<paramdef choice=\"opt\"><type>integer </type> <parameter>bandnum=1</" 5732"parameter></paramdef>" 5733 5734#. Tag: para 5735#: reference_raster.xml:3095 5736#, no-c-format 5737msgid "" 5738"Returns the file size of a band stored in file system. Throws an error if " 5739"called with an in db band, or if outdb access is not enabled." 5740msgstr "" 5741 5742#. Tag: para 5743#: reference_raster.xml:3097 5744#, no-c-format 5745msgid "" 5746"This function is typically used in conjunction with ST_BandPath() and " 5747"ST_BandFileTimestamp() so a client can determine if the filename of a outdb " 5748"raster as seen by it is the same as the one seen by the server." 5749msgstr "" 5750 5751#. Tag: para 5752#: reference_raster.xml:3099 reference_raster.xml:3135 5753#: reference_raster.xml:5094 reference_raster.xml:5147 5754#: reference_raster.xml:5844 reference_raster.xml:5887 5755#: reference_raster.xml:6000 reference_raster.xml:6869 5756#, fuzzy, no-c-format 5757msgid "Availability: 2.5.0" 5758msgstr "Disponibilità: 2.0" 5759 5760#. Tag: programlisting 5761#: reference_raster.xml:3106 5762#, fuzzy, no-c-format 5763msgid "" 5764"SELECT ST_BandFileSize(rast,1) FROM dummy_rast WHERE rid = 1;\n" 5765"\n" 5766" st_bandfilesize\n" 5767"-----------------\n" 5768" 240574" 5769msgstr "" 5770"SELECT ST_AsText(ST_PixelAsPoint(rast, 1, 1)) FROM dummy_rast WHERE rid = " 5771"1;\n" 5772"\n" 5773" st_astext \n" 5774"----------------\n" 5775" POINT(0.5 0.5)" 5776 5777#. Tag: refname 5778#: reference_raster.xml:3114 5779#, fuzzy, no-c-format 5780msgid "ST_BandFileTimestamp" 5781msgstr "ST_BandPixelType" 5782 5783#. Tag: refpurpose 5784#: reference_raster.xml:3115 5785#, no-c-format 5786msgid "" 5787"Returns the file timestamp of a band stored in file system. If no bandnum " 5788"specified, 1 is assumed." 5789msgstr "" 5790 5791#. Tag: funcprototype 5792#: reference_raster.xml:3120 5793#, fuzzy, no-c-format 5794msgid "" 5795"<funcdef>bigint <function>ST_BandFileTimestamp</function></funcdef> " 5796"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 5797"<paramdef choice=\"opt\"><type>integer </type> <parameter>bandnum=1</" 5798"parameter></paramdef>" 5799msgstr "" 5800"<funcdef>text <function>ST_BandPixelType</function></funcdef> " 5801"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 5802"<paramdef choice=\"opt\"><type>integer </type> <parameter>bandnum=1</" 5803"parameter></paramdef>" 5804 5805#. Tag: para 5806#: reference_raster.xml:3131 5807#, no-c-format 5808msgid "" 5809"Returns the file timestamp (number of seconds since Jan 1st 1970 00:00:00 " 5810"UTC) of a band stored in file system. Throws an error if called with an in " 5811"db band, or if outdb access is not enabled." 5812msgstr "" 5813 5814#. Tag: para 5815#: reference_raster.xml:3133 5816#, no-c-format 5817msgid "" 5818"This function is typically used in conjunction with ST_BandPath() and " 5819"ST_BandFileSize() so a client can determine if the filename of a outdb " 5820"raster as seen by it is the same as the one seen by the server." 5821msgstr "" 5822 5823#. Tag: programlisting 5824#: reference_raster.xml:3141 5825#, fuzzy, no-c-format 5826msgid "" 5827"SELECT ST_BandFileTimestamp(rast,1) FROM dummy_rast WHERE rid = 1;\n" 5828"\n" 5829" st_bandfiletimestamp\n" 5830"----------------------\n" 5831" 1521807257" 5832msgstr "" 5833"SELECT ST_AsText(ST_PixelAsPoint(rast, 1, 1)) FROM dummy_rast WHERE rid = " 5834"1;\n" 5835"\n" 5836" st_astext \n" 5837"----------------\n" 5838" POINT(0.5 0.5)" 5839 5840#. Tag: refname 5841#: reference_raster.xml:3148 5842#, no-c-format 5843msgid "ST_BandPixelType" 5844msgstr "ST_BandPixelType" 5845 5846#. Tag: refpurpose 5847#: reference_raster.xml:3149 5848#, no-c-format 5849msgid "" 5850"Returns the type of pixel for given band. If no bandnum specified, 1 is " 5851"assumed." 5852msgstr "" 5853 5854#. Tag: funcprototype 5855#: reference_raster.xml:3154 5856#, no-c-format 5857msgid "" 5858"<funcdef>text <function>ST_BandPixelType</function></funcdef> " 5859"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 5860"<paramdef choice=\"opt\"><type>integer </type> <parameter>bandnum=1</" 5861"parameter></paramdef>" 5862msgstr "" 5863"<funcdef>text <function>ST_BandPixelType</function></funcdef> " 5864"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 5865"<paramdef choice=\"opt\"><type>integer </type> <parameter>bandnum=1</" 5866"parameter></paramdef>" 5867 5868#. Tag: para 5869#: reference_raster.xml:3166 5870#, no-c-format 5871msgid "There are 11 pixel types. Pixel Types supported are as follows:" 5872msgstr "" 5873 5874#. Tag: para 5875#: reference_raster.xml:3169 5876#, no-c-format 5877msgid "1BB - 1-bit boolean" 5878msgstr "" 5879 5880#. Tag: para 5881#: reference_raster.xml:3173 5882#, no-c-format 5883msgid "2BUI - 2-bit unsigned integer" 5884msgstr "" 5885 5886#. Tag: para 5887#: reference_raster.xml:3177 5888#, no-c-format 5889msgid "4BUI - 4-bit unsigned integer" 5890msgstr "" 5891 5892#. Tag: para 5893#: reference_raster.xml:3181 5894#, no-c-format 5895msgid "8BSI - 8-bit signed integer" 5896msgstr "" 5897 5898#. Tag: para 5899#: reference_raster.xml:3184 5900#, no-c-format 5901msgid "8BUI - 8-bit unsigned integer" 5902msgstr "" 5903 5904#. Tag: para 5905#: reference_raster.xml:3187 5906#, no-c-format 5907msgid "16BSI - 16-bit signed integer" 5908msgstr "" 5909 5910#. Tag: para 5911#: reference_raster.xml:3190 5912#, no-c-format 5913msgid "16BUI - 16-bit unsigned integer" 5914msgstr "" 5915 5916#. Tag: para 5917#: reference_raster.xml:3193 5918#, no-c-format 5919msgid "32BSI - 32-bit signed integer" 5920msgstr "" 5921 5922#. Tag: para 5923#: reference_raster.xml:3196 5924#, no-c-format 5925msgid "32BUI - 32-bit unsigned integer" 5926msgstr "" 5927 5928#. Tag: para 5929#: reference_raster.xml:3199 5930#, no-c-format 5931msgid "32BF - 32-bit float" 5932msgstr "" 5933 5934#. Tag: para 5935#: reference_raster.xml:3202 5936#, no-c-format 5937msgid "64BF - 64-bit float" 5938msgstr "" 5939 5940#. Tag: programlisting 5941#: reference_raster.xml:3211 5942#, fuzzy, no-c-format 5943msgid "" 5944"SELECT ST_BandPixelType(rast,1) As btype1,\n" 5945" ST_BandPixelType(rast,2) As btype2, ST_BandPixelType(rast,3) As btype3\n" 5946"FROM dummy_rast\n" 5947"WHERE rid = 2;\n" 5948"\n" 5949" btype1 | btype2 | btype3\n" 5950"--------+--------+--------\n" 5951" 8BUI | 8BUI | 8BUI" 5952msgstr "" 5953"SELECT ST_BandPixelType(rast,1) As btype1, \n" 5954" ST_BandPixelType(rast,2) As btype2, ST_BandPixelType(rast,3) As btype3\n" 5955"FROM dummy_rast\n" 5956"WHERE rid = 2;\n" 5957"\n" 5958" btype1 | btype2 | btype3\n" 5959"--------+--------+--------\n" 5960" 8BUI | 8BUI | 8BUI" 5961 5962#. Tag: refname 5963#: reference_raster.xml:3223 5964#, no-c-format 5965msgid "ST_HasNoBand" 5966msgstr "ST_HasNoBand" 5967 5968#. Tag: refpurpose 5969#: reference_raster.xml:3224 5970#, no-c-format 5971msgid "" 5972"<refpurpose>Returns true if there is no band with given band number. If no " 5973"band number is specified, then band number 1 is assumed.</refpurpose>" 5974msgstr "" 5975 5976#. Tag: funcprototype 5977#: reference_raster.xml:3229 5978#, no-c-format 5979msgid "" 5980"<funcdef>boolean <function>ST_HasNoBand</function></funcdef> " 5981"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 5982"<paramdef><type>integer </type> <parameter>bandnum=1</parameter></paramdef>" 5983msgstr "" 5984"<funcdef>boolean <function>ST_HasNoBand</function></funcdef> " 5985"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 5986"<paramdef><type>integer </type> <parameter>bandnum=1</parameter></paramdef>" 5987 5988#. Tag: para 5989#: reference_raster.xml:3240 5990#, no-c-format 5991msgid "" 5992"<para>Returns true if there is no band with given band number. If no band " 5993"number is specified, then band number 1 is assumed.</para>" 5994msgstr "" 5995 5996#. Tag: programlisting 5997#: reference_raster.xml:3248 5998#, fuzzy, no-c-format 5999msgid "" 6000"SELECT rid, ST_HasNoBand(rast) As hb1, ST_HasNoBand(rast,2) as hb2,\n" 6001"ST_HasNoBand(rast,4) as hb4, ST_NumBands(rast) As numbands\n" 6002"FROM dummy_rast;\n" 6003"\n" 6004"rid | hb1 | hb2 | hb4 | numbands\n" 6005"-----+-----+-----+-----+----------\n" 6006"1 | t | t | t | 0\n" 6007"2 | f | f | t | 3" 6008msgstr "" 6009"SELECT rid, ST_HasNoBand(rast) As hb1, ST_HasNoBand(rast,2) as hb2, \n" 6010"ST_HasNoBand(rast,4) as hb4, ST_NumBands(rast) As numbands \n" 6011"FROM dummy_rast;\n" 6012"\n" 6013"rid | hb1 | hb2 | hb4 | numbands\n" 6014"-----+-----+-----+-----+----------\n" 6015"1 | t | t | t | 0\n" 6016"2 | f | f | t | 3" 6017 6018#. Tag: title 6019#: reference_raster.xml:3261 6020#, no-c-format 6021msgid "Raster Pixel Accessors and Setters" 6022msgstr "" 6023 6024#. Tag: refname 6025#: reference_raster.xml:3265 6026#, no-c-format 6027msgid "ST_PixelAsPolygon" 6028msgstr "" 6029 6030#. Tag: refpurpose 6031#: reference_raster.xml:3266 6032#, no-c-format 6033msgid "" 6034"<refpurpose>Returns the polygon geometry that bounds the pixel for a " 6035"particular row and column.</refpurpose>" 6036msgstr "" 6037 6038#. Tag: funcprototype 6039#: reference_raster.xml:3271 6040#, no-c-format 6041msgid "" 6042"<funcdef>geometry <function>ST_PixelAsPolygon</function></funcdef> " 6043"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 6044"<paramdef><type>integer </type> <parameter>columnx</parameter></paramdef> " 6045"<paramdef><type>integer </type> <parameter>rowy</parameter></paramdef>" 6046msgstr "" 6047"<funcdef>geometry <function>ST_PixelAsPolygon</function></funcdef> " 6048"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 6049"<paramdef><type>integer </type> <parameter>columnx</parameter></paramdef> " 6050"<paramdef><type>integer </type> <parameter>rowy</parameter></paramdef>" 6051 6052#. Tag: para 6053#: reference_raster.xml:3283 6054#, no-c-format 6055msgid "" 6056"<para>Returns the polygon geometry that bounds the pixel for a particular " 6057"row and column.</para>" 6058msgstr "" 6059 6060#. Tag: programlisting 6061#: reference_raster.xml:3291 6062#, fuzzy, no-c-format 6063msgid "" 6064"-- get raster pixel polygon\n" 6065"SELECT i,j, ST_AsText(ST_PixelAsPolygon(foo.rast, i,j)) As b1pgeom\n" 6066"FROM dummy_rast As foo\n" 6067" CROSS JOIN generate_series(1,2) As i\n" 6068" CROSS JOIN generate_series(1,1) As j\n" 6069"WHERE rid=2;\n" 6070"\n" 6071" i | j | b1pgeom\n" 6072"---+---" 6073"+-----------------------------------------------------------------------------\n" 6074" 1 | 1 | POLYGON((3427927.75 5793244,3427927.8 5793244,3427927.8 " 6075"5793243.95,...\n" 6076" 2 | 1 | POLYGON((3427927.8 5793244,3427927.85 5793244,3427927.85 " 6077"5793243.95, .." 6078msgstr "" 6079"-- get raster pixel polygon\n" 6080"SELECT i,j, ST_AsText(ST_PixelAsPolygon(foo.rast, i,j)) As b1pgeom\n" 6081"FROM dummy_rast As foo \n" 6082" CROSS JOIN generate_series(1,2) As i \n" 6083" CROSS JOIN generate_series(1,1) As j\n" 6084"WHERE rid=2;\n" 6085"\n" 6086" i | j | b1pgeom\n" 6087"---+---" 6088"+-----------------------------------------------------------------------------\n" 6089" 1 | 1 | POLYGON((3427927.75 5793244,3427927.8 5793244,3427927.8 " 6090"5793243.95,...\n" 6091" 2 | 1 | POLYGON((3427927.8 5793244,3427927.85 5793244,3427927.85 " 6092"5793243.95, .." 6093 6094#. Tag: para 6095#: reference_raster.xml:3296 6096#, no-c-format 6097msgid "" 6098", <xref linkend=\"RT_ST_PixelAsPolygons\"/>, <xref linkend=" 6099"\"RT_ST_PixelAsPoint\"/>, <xref linkend=\"RT_ST_PixelAsPoints\"/>, <xref " 6100"linkend=\"RT_ST_PixelAsCentroid\"/>, <xref linkend=\"RT_ST_PixelAsCentroids" 6101"\"/>, <xref linkend=\"RT_ST_Intersection\"/>, <xref linkend=\"ST_AsText\"/>" 6102msgstr "" 6103", <xref linkend=\"RT_ST_PixelAsPolygons\"/>, <xref linkend=" 6104"\"RT_ST_PixelAsPoint\"/>, <xref linkend=\"RT_ST_PixelAsPoints\"/>, <xref " 6105"linkend=\"RT_ST_PixelAsCentroid\"/>, <xref linkend=\"RT_ST_PixelAsCentroids" 6106"\"/>, <xref linkend=\"RT_ST_Intersection\"/>, <xref linkend=\"ST_AsText\"/>" 6107 6108#. Tag: refname 6109#: reference_raster.xml:3311 6110#, no-c-format 6111msgid "ST_PixelAsPolygons" 6112msgstr "ST_PixelAsPolygons" 6113 6114#. Tag: refpurpose 6115#: reference_raster.xml:3312 6116#, no-c-format 6117msgid "" 6118"Returns the polygon geometry that bounds every pixel of a raster band along " 6119"with the value, the X and the Y raster coordinates of each pixel." 6120msgstr "" 6121 6122#. Tag: funcprototype 6123#: reference_raster.xml:3317 6124#, no-c-format 6125msgid "" 6126"<funcdef>setof record <function>ST_PixelAsPolygons</function></funcdef> " 6127"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 6128"<paramdef choice=\"opt\"><type>integer </type> <parameter>band=1</" 6129"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6130"<parameter>exclude_nodata_value=TRUE</parameter></paramdef>" 6131msgstr "" 6132"<funcdef>setof record <function>ST_PixelAsPolygons</function></funcdef> " 6133"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 6134"<paramdef choice=\"opt\"><type>integer </type> <parameter>band=1</" 6135"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6136"<parameter>exclude_nodata_value=TRUE</parameter></paramdef>" 6137 6138#. Tag: para 6139#: reference_raster.xml:3329 6140#, no-c-format 6141msgid "" 6142"Returns the polygon geometry that bounds every pixel of a raster band along " 6143"with the value (double precision), the X and the Y raster coordinates " 6144"(integers) of each pixel." 6145msgstr "" 6146 6147#. Tag: para 6148#: reference_raster.xml:3331 reference_raster.xml:3437 6149#: reference_raster.xml:3534 6150#, no-c-format 6151msgid "" 6152"Return record format: <parameter>geom</parameter> <xref linkend=\"geometry\"/" 6153">, <parameter>val</parameter> double precision, <parameter>x</parameter> " 6154"integer, <parameter>y</parameter> integers." 6155msgstr "" 6156 6157#. Tag: para 6158#: reference_raster.xml:3335 reference_raster.xml:3441 6159#: reference_raster.xml:3538 6160#, no-c-format 6161msgid "" 6162"When <parameter>exclude_nodata_value</parameter> = TRUE, only those pixels " 6163"whose values are not NODATA are returned as points." 6164msgstr "" 6165 6166#. Tag: para 6167#: reference_raster.xml:3341 6168#, no-c-format 6169msgid "" 6170"ST_PixelAsPolygons returns one polygon geometry for every pixel. This is " 6171"different than ST_DumpAsPolygons where each geometry represents one or more " 6172"pixels with the same pixel value." 6173msgstr "" 6174 6175#. Tag: para 6176#: reference_raster.xml:3347 6177#, no-c-format 6178msgid "Enhanced: 2.1.0 exclude_nodata_value optional argument was added." 6179msgstr "" 6180 6181#. Tag: para 6182#: reference_raster.xml:3348 reference_raster.xml:3446 6183#: reference_raster.xml:3544 6184#, no-c-format 6185msgid "Changed: 2.1.1 Changed behavior of exclude_nodata_value." 6186msgstr "" 6187 6188#. Tag: programlisting 6189#: reference_raster.xml:3353 6190#, no-c-format 6191msgid "" 6192"-- get raster pixel polygon\n" 6193"SELECT (gv).x, (gv).y, (gv).val, ST_AsText((gv).geom) geom\n" 6194"FROM (SELECT ST_PixelAsPolygons(\n" 6195" ST_SetValue(ST_SetValue(ST_AddBand(ST_MakeEmptyRaster(2, 2, " 6196"0, 0, 0.001, -0.001, 0.001, 0.001, 4269),\n" 6197" '8BUI'::text, 1, 0),\n" 6198" 2, 2, 10),\n" 6199" 1, 1, NULL)\n" 6200") gv\n" 6201") foo;\n" 6202"\n" 6203" x | y | val | geom\n" 6204"---+---" 6205"+-----------------------------------------------------------------------------\n" 6206" 1 | 1 | | POLYGON((0 0,0.001 0.001,0.002 0,0.001 -0.001,0 0))\n" 6207" 1 | 2 | 1 | POLYGON((0.001 -0.001,0.002 0,0.003 -0.001,0.002 -0.002,0.001 " 6208"-0.001))\n" 6209" 2 | 1 | 1 | POLYGON((0.001 0.001,0.002 0.002,0.003 0.001,0.002 0,0.001 " 6210"0.001))\n" 6211" 2 | 2 | 10 | POLYGON((0.002 0,0.003 0.001,0.004 0,0.003 -0.001,0.002 0))" 6212msgstr "" 6213 6214#. Tag: para 6215#: reference_raster.xml:3358 6216#, no-c-format 6217msgid "" 6218", <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref linkend=" 6219"\"RT_ST_PixelAsPoint\"/>, <xref linkend=\"RT_ST_PixelAsPoints\"/>, <xref " 6220"linkend=\"RT_ST_PixelAsCentroid\"/>, <xref linkend=\"RT_ST_PixelAsCentroids" 6221"\"/>, <xref linkend=\"ST_AsText\"/>" 6222msgstr "" 6223", <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref linkend=" 6224"\"RT_ST_PixelAsPoint\"/>, <xref linkend=\"RT_ST_PixelAsPoints\"/>, <xref " 6225"linkend=\"RT_ST_PixelAsCentroid\"/>, <xref linkend=\"RT_ST_PixelAsCentroids" 6226"\"/>, <xref linkend=\"ST_AsText\"/>" 6227 6228#. Tag: refname 6229#: reference_raster.xml:3372 6230#, no-c-format 6231msgid "ST_PixelAsPoint" 6232msgstr "ST_PixelAsPoint" 6233 6234#. Tag: refpurpose 6235#: reference_raster.xml:3373 6236#, no-c-format 6237msgid "" 6238"<refpurpose>Returns a point geometry of the pixel's upper-left corner.</" 6239"refpurpose>" 6240msgstr "" 6241 6242#. Tag: funcprototype 6243#: reference_raster.xml:3379 6244#, no-c-format 6245msgid "" 6246"<funcdef>geometry <function>ST_PixelAsPoint</function></funcdef> " 6247"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 6248"<paramdef><type>integer </type> <parameter>columnx</parameter></paramdef> " 6249"<paramdef><type>integer </type> <parameter>rowy</parameter></paramdef>" 6250msgstr "" 6251"<funcdef>geometry <function>ST_PixelAsPoint</function></funcdef> " 6252"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 6253"<paramdef><type>integer </type> <parameter>columnx</parameter></paramdef> " 6254"<paramdef><type>integer </type> <parameter>rowy</parameter></paramdef>" 6255 6256#. Tag: para 6257#: reference_raster.xml:3390 6258#, no-c-format 6259msgid "<para>Returns a point geometry of the pixel's upper-left corner.</para>" 6260msgstr "" 6261 6262#. Tag: programlisting 6263#: reference_raster.xml:3396 6264#, fuzzy, no-c-format 6265msgid "" 6266"SELECT ST_AsText(ST_PixelAsPoint(rast, 1, 1)) FROM dummy_rast WHERE rid = " 6267"1;\n" 6268"\n" 6269" st_astext\n" 6270"----------------\n" 6271" POINT(0.5 0.5)" 6272msgstr "" 6273"SELECT ST_AsText(ST_PixelAsPoint(rast, 1, 1)) FROM dummy_rast WHERE rid = " 6274"1;\n" 6275"\n" 6276" st_astext \n" 6277"----------------\n" 6278" POINT(0.5 0.5)" 6279 6280#. Tag: para 6281#: reference_raster.xml:3401 6282#, no-c-format 6283msgid "" 6284", <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref linkend=" 6285"\"RT_ST_PixelAsPolygons\"/>, <xref linkend=\"RT_ST_PixelAsPoints\"/>, <xref " 6286"linkend=\"RT_ST_PixelAsCentroid\"/>, <xref linkend=\"RT_ST_PixelAsCentroids" 6287"\"/>" 6288msgstr "" 6289", <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref linkend=" 6290"\"RT_ST_PixelAsPolygons\"/>, <xref linkend=\"RT_ST_PixelAsPoints\"/>, <xref " 6291"linkend=\"RT_ST_PixelAsCentroid\"/>, <xref linkend=\"RT_ST_PixelAsCentroids" 6292"\"/>" 6293 6294#. Tag: refname 6295#: reference_raster.xml:3415 6296#, no-c-format 6297msgid "ST_PixelAsPoints" 6298msgstr "ST_PixelAsPoints" 6299 6300#. Tag: refpurpose 6301#: reference_raster.xml:3416 6302#, no-c-format 6303msgid "" 6304"<refpurpose>Returns a point geometry for each pixel of a raster band along " 6305"with the value, the X and the Y raster coordinates of each pixel. The " 6306"coordinates of the point geometry are of the pixel's upper-left corner.</" 6307"refpurpose>" 6308msgstr "" 6309 6310#. Tag: funcprototype 6311#: reference_raster.xml:3422 6312#, fuzzy, no-c-format 6313msgid "" 6314"<funcdef>setof record <function>ST_PixelAsPoints</function></funcdef> " 6315"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 6316"<paramdef choice=\"opt\"><type>integer </type> <parameter>band=1</" 6317"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6318"<parameter>exclude_nodata_value=TRUE</parameter></paramdef>" 6319msgstr "" 6320"<funcdef>setof record <function>ST_PixelAsPolygons</function></funcdef> " 6321"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 6322"<paramdef choice=\"opt\"><type>integer </type> <parameter>band=1</" 6323"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6324"<parameter>exclude_nodata_value=TRUE</parameter></paramdef>" 6325 6326#. Tag: para 6327#: reference_raster.xml:3433 6328#, no-c-format 6329msgid "" 6330"<para>Returns a point geometry for each pixel of a raster band along with " 6331"the value, the X and the Y raster coordinates of each pixel. The coordinates " 6332"of the point geometry are of the pixel's upper-left corner.</para>" 6333msgstr "" 6334 6335#. Tag: programlisting 6336#: reference_raster.xml:3451 6337#, fuzzy, no-c-format 6338msgid "" 6339"SELECT x, y, val, ST_AsText(geom) FROM (SELECT (ST_PixelAsPoints(rast, 1)).* " 6340"FROM dummy_rast WHERE rid = 2) foo;\n" 6341"\n" 6342" x | y | val | st_astext\n" 6343"---+---+-----+------------------------------\n" 6344" 1 | 1 | 253 | POINT(3427927.75 5793244)\n" 6345" 2 | 1 | 254 | POINT(3427927.8 5793244)\n" 6346" 3 | 1 | 253 | POINT(3427927.85 5793244)\n" 6347" 4 | 1 | 254 | POINT(3427927.9 5793244)\n" 6348" 5 | 1 | 254 | POINT(3427927.95 5793244)\n" 6349" 1 | 2 | 253 | POINT(3427927.75 5793243.95)\n" 6350" 2 | 2 | 254 | POINT(3427927.8 5793243.95)\n" 6351" 3 | 2 | 254 | POINT(3427927.85 5793243.95)\n" 6352" 4 | 2 | 253 | POINT(3427927.9 5793243.95)\n" 6353" 5 | 2 | 249 | POINT(3427927.95 5793243.95)\n" 6354" 1 | 3 | 250 | POINT(3427927.75 5793243.9)\n" 6355" 2 | 3 | 254 | POINT(3427927.8 5793243.9)\n" 6356" 3 | 3 | 254 | POINT(3427927.85 5793243.9)\n" 6357" 4 | 3 | 252 | POINT(3427927.9 5793243.9)\n" 6358" 5 | 3 | 249 | POINT(3427927.95 5793243.9)\n" 6359" 1 | 4 | 251 | POINT(3427927.75 5793243.85)\n" 6360" 2 | 4 | 253 | POINT(3427927.8 5793243.85)\n" 6361" 3 | 4 | 254 | POINT(3427927.85 5793243.85)\n" 6362" 4 | 4 | 254 | POINT(3427927.9 5793243.85)\n" 6363" 5 | 4 | 253 | POINT(3427927.95 5793243.85)\n" 6364" 1 | 5 | 252 | POINT(3427927.75 5793243.8)\n" 6365" 2 | 5 | 250 | POINT(3427927.8 5793243.8)\n" 6366" 3 | 5 | 254 | POINT(3427927.85 5793243.8)\n" 6367" 4 | 5 | 254 | POINT(3427927.9 5793243.8)\n" 6368" 5 | 5 | 254 | POINT(3427927.95 5793243.8)" 6369msgstr "" 6370"SELECT x, y, val, ST_AsText(geom) FROM (SELECT (ST_PixelAsPoints(rast, 1)).* " 6371"FROM dummy_rast WHERE rid = 2) foo;\n" 6372"\n" 6373" x | y | val | st_astext \n" 6374"---+---+-----+------------------------------\n" 6375" 1 | 1 | 253 | POINT(3427927.75 5793244)\n" 6376" 2 | 1 | 254 | POINT(3427927.8 5793244)\n" 6377" 3 | 1 | 253 | POINT(3427927.85 5793244)\n" 6378" 4 | 1 | 254 | POINT(3427927.9 5793244)\n" 6379" 5 | 1 | 254 | POINT(3427927.95 5793244)\n" 6380" 1 | 2 | 253 | POINT(3427927.75 5793243.95)\n" 6381" 2 | 2 | 254 | POINT(3427927.8 5793243.95)\n" 6382" 3 | 2 | 254 | POINT(3427927.85 5793243.95)\n" 6383" 4 | 2 | 253 | POINT(3427927.9 5793243.95)\n" 6384" 5 | 2 | 249 | POINT(3427927.95 5793243.95)\n" 6385" 1 | 3 | 250 | POINT(3427927.75 5793243.9)\n" 6386" 2 | 3 | 254 | POINT(3427927.8 5793243.9)\n" 6387" 3 | 3 | 254 | POINT(3427927.85 5793243.9)\n" 6388" 4 | 3 | 252 | POINT(3427927.9 5793243.9)\n" 6389" 5 | 3 | 249 | POINT(3427927.95 5793243.9)\n" 6390" 1 | 4 | 251 | POINT(3427927.75 5793243.85)\n" 6391" 2 | 4 | 253 | POINT(3427927.8 5793243.85)\n" 6392" 3 | 4 | 254 | POINT(3427927.85 5793243.85)\n" 6393" 4 | 4 | 254 | POINT(3427927.9 5793243.85)\n" 6394" 5 | 4 | 253 | POINT(3427927.95 5793243.85)\n" 6395" 1 | 5 | 252 | POINT(3427927.75 5793243.8)\n" 6396" 2 | 5 | 250 | POINT(3427927.8 5793243.8)\n" 6397" 3 | 5 | 254 | POINT(3427927.85 5793243.8)\n" 6398" 4 | 5 | 254 | POINT(3427927.9 5793243.8)\n" 6399" 5 | 5 | 254 | POINT(3427927.95 5793243.8)" 6400 6401#. Tag: para 6402#: reference_raster.xml:3456 6403#, no-c-format 6404msgid "" 6405", <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref linkend=" 6406"\"RT_ST_PixelAsPolygons\"/>, <xref linkend=\"RT_ST_PixelAsPoint\"/>, <xref " 6407"linkend=\"RT_ST_PixelAsCentroid\"/>, <xref linkend=\"RT_ST_PixelAsCentroids" 6408"\"/>" 6409msgstr "" 6410", <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref linkend=" 6411"\"RT_ST_PixelAsPolygons\"/>, <xref linkend=\"RT_ST_PixelAsPoint\"/>, <xref " 6412"linkend=\"RT_ST_PixelAsCentroid\"/>, <xref linkend=\"RT_ST_PixelAsCentroids" 6413"\"/>" 6414 6415#. Tag: refname 6416#: reference_raster.xml:3470 6417#, no-c-format 6418msgid "ST_PixelAsCentroid" 6419msgstr "ST_PixelAsCentroid" 6420 6421#. Tag: refpurpose 6422#: reference_raster.xml:3471 6423#, no-c-format 6424msgid "" 6425"<refpurpose>Returns the centroid (point geometry) of the area represented by " 6426"a pixel.</refpurpose>" 6427msgstr "" 6428 6429#. Tag: funcprototype 6430#: reference_raster.xml:3477 6431#, fuzzy, no-c-format 6432msgid "" 6433"<funcdef>geometry <function>ST_PixelAsCentroid</function></funcdef> " 6434"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 6435"<paramdef><type>integer </type> <parameter>x</parameter></paramdef> " 6436"<paramdef><type>integer </type> <parameter>y</parameter></paramdef>" 6437msgstr "" 6438"<funcdef>geometry <function>ST_PixelAsCentroid</function></funcdef> " 6439"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 6440"<paramdef><type>integer </type> <parameter>columnx</parameter></paramdef> " 6441"<paramdef><type>integer </type> <parameter>rowy</parameter></paramdef>" 6442 6443#. Tag: para 6444#: reference_raster.xml:3488 6445#, no-c-format 6446msgid "" 6447"<para>Returns the centroid (point geometry) of the area represented by a " 6448"pixel.</para>" 6449msgstr "" 6450 6451#. Tag: programlisting 6452#: reference_raster.xml:3494 6453#, fuzzy, no-c-format 6454msgid "" 6455"SELECT ST_AsText(ST_PixelAsCentroid(rast, 1, 1)) FROM dummy_rast WHERE rid = " 6456"1;\n" 6457"\n" 6458" st_astext\n" 6459"--------------\n" 6460" POINT(1.5 2)" 6461msgstr "" 6462"SELECT ST_AsText(ST_PixelAsCentroid(rast, 1, 1)) FROM dummy_rast WHERE rid = " 6463"1;\n" 6464"\n" 6465" st_astext \n" 6466"--------------\n" 6467" POINT(1.5 2)" 6468 6469#. Tag: para 6470#: reference_raster.xml:3499 6471#, no-c-format 6472msgid "" 6473", <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref linkend=" 6474"\"RT_ST_PixelAsPolygons\"/>, <xref linkend=\"RT_ST_PixelAsPoint\"/>, <xref " 6475"linkend=\"RT_ST_PixelAsPoints\"/>, <xref linkend=\"RT_ST_PixelAsCentroids\"/>" 6476msgstr "" 6477", <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref linkend=" 6478"\"RT_ST_PixelAsPolygons\"/>, <xref linkend=\"RT_ST_PixelAsPoint\"/>, <xref " 6479"linkend=\"RT_ST_PixelAsPoints\"/>, <xref linkend=\"RT_ST_PixelAsCentroids\"/>" 6480 6481#. Tag: refname 6482#: reference_raster.xml:3513 6483#, no-c-format 6484msgid "ST_PixelAsCentroids" 6485msgstr "ST_PixelAsCentroids" 6486 6487#. Tag: refpurpose 6488#: reference_raster.xml:3514 6489#, no-c-format 6490msgid "" 6491"<refpurpose>Returns the centroid (point geometry) for each pixel of a raster " 6492"band along with the value, the X and the Y raster coordinates of each pixel. " 6493"The point geometry is the centroid of the area represented by a pixel.</" 6494"refpurpose>" 6495msgstr "" 6496 6497#. Tag: funcprototype 6498#: reference_raster.xml:3520 6499#, fuzzy, no-c-format 6500msgid "" 6501"<funcdef>setof record <function>ST_PixelAsCentroids</function></funcdef> " 6502"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 6503"<paramdef choice=\"opt\"><type>integer </type> <parameter>band=1</" 6504"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6505"<parameter>exclude_nodata_value=TRUE</parameter></paramdef>" 6506msgstr "" 6507"<funcdef>geometry <function>ST_PixelAsCentroids</function></funcdef> " 6508"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 6509"<paramdef choice=\"opt\"><type>integer </type> <parameter>band=1</" 6510"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6511"<parameter>exclude_nodata_value=TRUE</parameter></paramdef>" 6512 6513#. Tag: para 6514#: reference_raster.xml:3531 6515#, no-c-format 6516msgid "" 6517"<para>Returns the centroid (point geometry) for each pixel of a raster band " 6518"along with the value, the X and the Y raster coordinates of each pixel. The " 6519"point geometry is the centroid of the area represented by a pixel.</para>" 6520msgstr "" 6521 6522#. Tag: programlisting 6523#: reference_raster.xml:3549 6524#, fuzzy, no-c-format 6525msgid "" 6526"--LATERAL syntax requires PostgreSQL 9.3+\n" 6527"SELECT x, y, val, ST_AsText(geom)\n" 6528" FROM (SELECT dp.* FROM dummy_rast, LATERAL ST_PixelAsCentroids(rast, " 6529"1) AS dp WHERE rid = 2) foo;\n" 6530" x | y | val | st_astext\n" 6531"---+---+-----+--------------------------------\n" 6532" 1 | 1 | 253 | POINT(3427927.775 5793243.975)\n" 6533" 2 | 1 | 254 | POINT(3427927.825 5793243.975)\n" 6534" 3 | 1 | 253 | POINT(3427927.875 5793243.975)\n" 6535" 4 | 1 | 254 | POINT(3427927.925 5793243.975)\n" 6536" 5 | 1 | 254 | POINT(3427927.975 5793243.975)\n" 6537" 1 | 2 | 253 | POINT(3427927.775 5793243.925)\n" 6538" 2 | 2 | 254 | POINT(3427927.825 5793243.925)\n" 6539" 3 | 2 | 254 | POINT(3427927.875 5793243.925)\n" 6540" 4 | 2 | 253 | POINT(3427927.925 5793243.925)\n" 6541" 5 | 2 | 249 | POINT(3427927.975 5793243.925)\n" 6542" 1 | 3 | 250 | POINT(3427927.775 5793243.875)\n" 6543" 2 | 3 | 254 | POINT(3427927.825 5793243.875)\n" 6544" 3 | 3 | 254 | POINT(3427927.875 5793243.875)\n" 6545" 4 | 3 | 252 | POINT(3427927.925 5793243.875)\n" 6546" 5 | 3 | 249 | POINT(3427927.975 5793243.875)\n" 6547" 1 | 4 | 251 | POINT(3427927.775 5793243.825)\n" 6548" 2 | 4 | 253 | POINT(3427927.825 5793243.825)\n" 6549" 3 | 4 | 254 | POINT(3427927.875 5793243.825)\n" 6550" 4 | 4 | 254 | POINT(3427927.925 5793243.825)\n" 6551" 5 | 4 | 253 | POINT(3427927.975 5793243.825)\n" 6552" 1 | 5 | 252 | POINT(3427927.775 5793243.775)\n" 6553" 2 | 5 | 250 | POINT(3427927.825 5793243.775)\n" 6554" 3 | 5 | 254 | POINT(3427927.875 5793243.775)\n" 6555" 4 | 5 | 254 | POINT(3427927.925 5793243.775)\n" 6556" 5 | 5 | 254 | POINT(3427927.975 5793243.775)" 6557msgstr "" 6558"SELECT x, y, val, ST_AsText(geom) FROM (SELECT (ST_PixelAsCentroids(rast, " 6559"1)).* FROM dummy_rast WHERE rid = 2) foo;\n" 6560" x | y | val | st_astext \n" 6561"---+---+-----+--------------------------------\n" 6562" 1 | 1 | 253 | POINT(3427927.775 5793243.975)\n" 6563" 2 | 1 | 254 | POINT(3427927.825 5793243.975)\n" 6564" 3 | 1 | 253 | POINT(3427927.875 5793243.975)\n" 6565" 4 | 1 | 254 | POINT(3427927.925 5793243.975)\n" 6566" 5 | 1 | 254 | POINT(3427927.975 5793243.975)\n" 6567" 1 | 2 | 253 | POINT(3427927.775 5793243.925)\n" 6568" 2 | 2 | 254 | POINT(3427927.825 5793243.925)\n" 6569" 3 | 2 | 254 | POINT(3427927.875 5793243.925)\n" 6570" 4 | 2 | 253 | POINT(3427927.925 5793243.925)\n" 6571" 5 | 2 | 249 | POINT(3427927.975 5793243.925)\n" 6572" 1 | 3 | 250 | POINT(3427927.775 5793243.875)\n" 6573" 2 | 3 | 254 | POINT(3427927.825 5793243.875)\n" 6574" 3 | 3 | 254 | POINT(3427927.875 5793243.875)\n" 6575" 4 | 3 | 252 | POINT(3427927.925 5793243.875)\n" 6576" 5 | 3 | 249 | POINT(3427927.975 5793243.875)\n" 6577" 1 | 4 | 251 | POINT(3427927.775 5793243.825)\n" 6578" 2 | 4 | 253 | POINT(3427927.825 5793243.825)\n" 6579" 3 | 4 | 254 | POINT(3427927.875 5793243.825)\n" 6580" 4 | 4 | 254 | POINT(3427927.925 5793243.825)\n" 6581" 5 | 4 | 253 | POINT(3427927.975 5793243.825)\n" 6582" 1 | 5 | 252 | POINT(3427927.775 5793243.775)\n" 6583" 2 | 5 | 250 | POINT(3427927.825 5793243.775)\n" 6584" 3 | 5 | 254 | POINT(3427927.875 5793243.775)\n" 6585" 4 | 5 | 254 | POINT(3427927.925 5793243.775)\n" 6586" 5 | 5 | 254 | POINT(3427927.975 5793243.775)" 6587 6588#. Tag: para 6589#: reference_raster.xml:3554 6590#, no-c-format 6591msgid "" 6592", <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref linkend=" 6593"\"RT_ST_PixelAsPolygons\"/>, <xref linkend=\"RT_ST_PixelAsPoint\"/>, <xref " 6594"linkend=\"RT_ST_PixelAsPoints\"/>, <xref linkend=\"RT_ST_PixelAsCentroid\"/>" 6595msgstr "" 6596", <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref linkend=" 6597"\"RT_ST_PixelAsPolygons\"/>, <xref linkend=\"RT_ST_PixelAsPoint\"/>, <xref " 6598"linkend=\"RT_ST_PixelAsPoints\"/>, <xref linkend=\"RT_ST_PixelAsCentroid\"/>" 6599 6600#. Tag: refname 6601#: reference_raster.xml:3568 6602#, no-c-format 6603msgid "ST_Value" 6604msgstr "ST_Value" 6605 6606#. Tag: refpurpose 6607#: reference_raster.xml:3569 6608#, no-c-format 6609msgid "" 6610"Returns the value of a given band in a given columnx, rowy pixel or at a " 6611"particular geometric point. Band numbers start at 1 and assumed to be 1 if " 6612"not specified. If <varname>exclude_nodata_value</varname> is set to false, " 6613"then all pixels include <varname>nodata</varname> pixels are considered to " 6614"intersect and return value. If <varname>exclude_nodata_value</varname> is " 6615"not passed in then reads it from metadata of raster." 6616msgstr "" 6617 6618#. Tag: funcsynopsis 6619#: reference_raster.xml:3573 6620#, fuzzy, no-c-format 6621msgid "" 6622"<funcprototype> <funcdef>double precision <function>ST_Value</function></" 6623"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 6624"paramdef> <paramdef><type>geometry </type> <parameter>pt</parameter></" 6625"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6626"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 6627"<funcprototype> <funcdef>double precision <function>ST_Value</function></" 6628"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 6629"paramdef> <paramdef><type>integer </type> <parameter>band</parameter></" 6630"paramdef> <paramdef><type>geometry </type> <parameter>pt</parameter></" 6631"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6632"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 6633"<funcprototype> <funcdef>double precision <function>ST_Value</function></" 6634"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 6635"paramdef> <paramdef><type>integer </type> <parameter>x</parameter></" 6636"paramdef> <paramdef><type>integer </type> <parameter>y</parameter></" 6637"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6638"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 6639"<funcprototype> <funcdef>double precision <function>ST_Value</function></" 6640"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 6641"paramdef> <paramdef><type>integer </type> <parameter>band</parameter></" 6642"paramdef> <paramdef><type>integer </type> <parameter>x</parameter></" 6643"paramdef> <paramdef><type>integer </type> <parameter>y</parameter></" 6644"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6645"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype>" 6646msgstr "" 6647"<funcprototype> <funcdef>double precision <function>ST_Value</function></" 6648"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 6649"paramdef> <paramdef><type>geometry </type> <parameter>pt</parameter></" 6650"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6651"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 6652"<funcprototype> <funcdef>double precision <function>ST_Value</function></" 6653"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 6654"paramdef> <paramdef><type>integer </type> <parameter>bandnum</parameter></" 6655"paramdef> <paramdef><type>geometry </type> <parameter>pt</parameter></" 6656"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6657"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 6658"<funcprototype> <funcdef>double precision <function>ST_Value</function></" 6659"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 6660"paramdef> <paramdef><type>integer </type> <parameter>columnx</parameter></" 6661"paramdef> <paramdef><type>integer </type> <parameter>rowy</parameter></" 6662"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6663"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 6664"<funcprototype> <funcdef>double precision <function>ST_Value</function></" 6665"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 6666"paramdef> <paramdef><type>integer </type> <parameter>bandnum</parameter></" 6667"paramdef> <paramdef><type>integer </type> <parameter>columnx</parameter></" 6668"paramdef> <paramdef><type>integer </type> <parameter>rowy</parameter></" 6669"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6670"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype>" 6671 6672#. Tag: para 6673#: reference_raster.xml:3608 6674#, no-c-format 6675msgid "" 6676"Returns the value of a given band in a given columnx, rowy pixel or at a " 6677"given geometry point. Band numbers start at 1 and band is assumed to be 1 if " 6678"not specified. If <varname>exclude_nodata_value</varname> is set to true, " 6679"then only non <varname>nodata</varname> pixels are considered. If " 6680"<varname>exclude_nodata_value</varname> is set to false, then all pixels are " 6681"considered." 6682msgstr "" 6683 6684#. Tag: para 6685#: reference_raster.xml:3611 6686#, no-c-format 6687msgid "Enhanced: 2.0.0 exclude_nodata_value optional argument was added." 6688msgstr "" 6689 6690#. Tag: programlisting 6691#: reference_raster.xml:3616 6692#, no-c-format 6693msgid "" 6694"-- get raster values at particular postgis geometry points\n" 6695"-- the srid of your geometry should be same as for your raster\n" 6696"SELECT rid, ST_Value(rast, foo.pt_geom) As b1pval, ST_Value(rast, 2, foo." 6697"pt_geom) As b2pval\n" 6698"FROM dummy_rast CROSS JOIN (SELECT ST_SetSRID(ST_Point(3427927.77, " 6699"5793243.76), 0) As pt_geom) As foo\n" 6700"WHERE rid=2;\n" 6701"\n" 6702" rid | b1pval | b2pval\n" 6703"-----+--------+--------\n" 6704" 2 | 252 | 79\n" 6705"\n" 6706"\n" 6707"-- general fictitious example using a real table\n" 6708"SELECT rid, ST_Value(rast, 3, sometable.geom) As b3pval\n" 6709"FROM sometable\n" 6710"WHERE ST_Intersects(rast,sometable.geom);" 6711msgstr "" 6712 6713#. Tag: programlisting 6714#: reference_raster.xml:3617 6715#, fuzzy, no-c-format 6716msgid "" 6717"SELECT rid, ST_Value(rast, 1, 1, 1) As b1pval,\n" 6718" ST_Value(rast, 2, 1, 1) As b2pval, ST_Value(rast, 3, 1, 1) As b3pval\n" 6719"FROM dummy_rast\n" 6720"WHERE rid=2;\n" 6721"\n" 6722" rid | b1pval | b2pval | b3pval\n" 6723"-----+--------+--------+--------\n" 6724" 2 | 253 | 78 | 70" 6725msgstr "" 6726"SELECT rid, ST_Value(rast, 1, 1, 1) As b1pval, \n" 6727" ST_Value(rast, 2, 1, 1) As b2pval, ST_Value(rast, 3, 1, 1) As b3pval\n" 6728"FROM dummy_rast\n" 6729"WHERE rid=2;\n" 6730"\n" 6731" rid | b1pval | b2pval | b3pval\n" 6732"-----+--------+--------+--------\n" 6733" 2 | 253 | 78 | 70" 6734 6735#. Tag: programlisting 6736#: reference_raster.xml:3619 6737#, fuzzy, no-c-format 6738msgid "" 6739"--- Get all values in bands 1,2,3 of each pixel --\n" 6740"SELECT x, y, ST_Value(rast, 1, x, y) As b1val,\n" 6741" ST_Value(rast, 2, x, y) As b2val, ST_Value(rast, 3, x, y) As b3val\n" 6742"FROM dummy_rast CROSS JOIN\n" 6743"generate_series(1, 1000) As x CROSS JOIN generate_series(1, 1000) As y\n" 6744"WHERE rid = 2 AND x <= ST_Width(rast) AND y <= ST_Height(rast);\n" 6745"\n" 6746" x | y | b1val | b2val | b3val\n" 6747"---+---+-------+-------+-------\n" 6748" 1 | 1 | 253 | 78 | 70\n" 6749" 1 | 2 | 253 | 96 | 80\n" 6750" 1 | 3 | 250 | 99 | 90\n" 6751" 1 | 4 | 251 | 89 | 77\n" 6752" 1 | 5 | 252 | 79 | 62\n" 6753" 2 | 1 | 254 | 98 | 86\n" 6754" 2 | 2 | 254 | 118 | 108\n" 6755" :\n" 6756" :" 6757msgstr "" 6758"--- Get all values in bands 1,2,3 of each pixel --\n" 6759"SELECT x, y, ST_Value(rast, 1, x, y) As b1val, \n" 6760" ST_Value(rast, 2, x, y) As b2val, ST_Value(rast, 3, x, y) As b3val\n" 6761"FROM dummy_rast CROSS JOIN\n" 6762"generate_series(1, 1000) As x CROSS JOIN generate_series(1, 1000) As y\n" 6763"WHERE rid = 2 AND x <= ST_Width(rast) AND y <= ST_Height(rast);\n" 6764"\n" 6765" x | y | b1val | b2val | b3val\n" 6766"---+---+-------+-------+-------\n" 6767" 1 | 1 | 253 | 78 | 70\n" 6768" 1 | 2 | 253 | 96 | 80\n" 6769" 1 | 3 | 250 | 99 | 90\n" 6770" 1 | 4 | 251 | 89 | 77\n" 6771" 1 | 5 | 252 | 79 | 62\n" 6772" 2 | 1 | 254 | 98 | 86\n" 6773" 2 | 2 | 254 | 118 | 108\n" 6774" :\n" 6775" :" 6776 6777#. Tag: programlisting 6778#: reference_raster.xml:3621 6779#, fuzzy, no-c-format 6780msgid "" 6781"--- Get all values in bands 1,2,3 of each pixel same as above but returning " 6782"the upper left point point of each pixel --\n" 6783"SELECT ST_AsText(ST_SetSRID(\n" 6784" ST_Point(ST_UpperLeftX(rast) + ST_ScaleX(rast)*x,\n" 6785" ST_UpperLeftY(rast) + ST_ScaleY(rast)*y),\n" 6786" ST_SRID(rast))) As uplpt\n" 6787" , ST_Value(rast, 1, x, y) As b1val,\n" 6788" ST_Value(rast, 2, x, y) As b2val, ST_Value(rast, 3, x, y) As b3val\n" 6789"FROM dummy_rast CROSS JOIN\n" 6790"generate_series(1,1000) As x CROSS JOIN generate_series(1,1000) As y\n" 6791"WHERE rid = 2 AND x <= ST_Width(rast) AND y <= ST_Height(rast);\n" 6792"\n" 6793" uplpt | b1val | b2val | b3val\n" 6794"-----------------------------+-------+-------+-------\n" 6795" POINT(3427929.25 5793245.5) | 253 | 78 | 70\n" 6796" POINT(3427929.25 5793247) | 253 | 96 | 80\n" 6797" POINT(3427929.25 5793248.5) | 250 | 99 | 90\n" 6798":" 6799msgstr "" 6800"--- Get all values in bands 1,2,3 of each pixel --\n" 6801"SELECT x, y, ST_Value(rast, 1, x, y) As b1val, \n" 6802" ST_Value(rast, 2, x, y) As b2val, ST_Value(rast, 3, x, y) As b3val\n" 6803"FROM dummy_rast CROSS JOIN\n" 6804"generate_series(1, 1000) As x CROSS JOIN generate_series(1, 1000) As y\n" 6805"WHERE rid = 2 AND x <= ST_Width(rast) AND y <= ST_Height(rast);\n" 6806"\n" 6807" x | y | b1val | b2val | b3val\n" 6808"---+---+-------+-------+-------\n" 6809" 1 | 1 | 253 | 78 | 70\n" 6810" 1 | 2 | 253 | 96 | 80\n" 6811" 1 | 3 | 250 | 99 | 90\n" 6812" 1 | 4 | 251 | 89 | 77\n" 6813" 1 | 5 | 252 | 79 | 62\n" 6814" 2 | 1 | 254 | 98 | 86\n" 6815" 2 | 2 | 254 | 118 | 108\n" 6816" :\n" 6817" :" 6818 6819#. Tag: programlisting 6820#: reference_raster.xml:3622 6821#, no-c-format 6822msgid "" 6823"--- Get a polygon formed by union of all pixels\n" 6824" that fall in a particular value range and intersect particular " 6825"polygon --\n" 6826"SELECT ST_AsText(ST_Union(pixpolyg)) As shadow\n" 6827"FROM (SELECT ST_Translate(ST_MakeEnvelope(\n" 6828" ST_UpperLeftX(rast), ST_UpperLeftY(rast),\n" 6829" ST_UpperLeftX(rast) + ST_ScaleX(rast),\n" 6830" ST_UpperLeftY(rast) + ST_ScaleY(rast), 0\n" 6831" ), ST_ScaleX(rast)*x, ST_ScaleY(rast)*y\n" 6832" ) As pixpolyg, ST_Value(rast, 2, x, y) As b2val\n" 6833" FROM dummy_rast CROSS JOIN\n" 6834"generate_series(1,1000) As x CROSS JOIN generate_series(1,1000) As y\n" 6835"WHERE rid = 2\n" 6836" AND x <= ST_Width(rast) AND y <= ST_Height(rast)) As foo\n" 6837"WHERE\n" 6838" ST_Intersects(\n" 6839" pixpolyg,\n" 6840" ST_GeomFromText('POLYGON((3427928 5793244,3427927.75 " 6841"5793243.75,3427928 5793243.75,3427928 5793244))',0)\n" 6842" ) AND b2val != 254;\n" 6843"\n" 6844"\n" 6845" shadow\n" 6846"------------------------------------------------------------------------------------\n" 6847" MULTIPOLYGON(((3427928 5793243.9,3427928 5793243.85,3427927.95 " 6848"5793243.85,3427927.95 5793243.9,\n" 6849" 3427927.95 5793243.95,3427928 5793243.95,3427928.05 5793243.95,3427928.05 " 6850"5793243.9,3427928 5793243.9)),((3427927.95 5793243.9,3427927.95 579324\n" 6851"3.85,3427927.9 5793243.85,3427927.85 5793243.85,3427927.85 " 6852"5793243.9,3427927.9 5793243.9,3427927.9 5793243.95,\n" 6853"3427927.95 5793243.95,3427927.95 5793243.9)),((3427927.85 " 6854"5793243.75,3427927.85 5793243.7,3427927.8 5793243.7,3427927.8 5793243.75\n" 6855",3427927.8 5793243.8,3427927.8 5793243.85,3427927.85 5793243.85,3427927.85 " 6856"5793243.8,3427927.85 5793243.75)),\n" 6857"((3427928.05 5793243.75,3427928.05 5793243.7,3427928 5793243.7,3427927.95 " 6858"5793243.7,3427927.95 5793243.75,3427927.95 5793243.8,3427\n" 6859"927.95 5793243.85,3427928 5793243.85,3427928 5793243.8,3427928.05 " 6860"5793243.8,\n" 6861"3427928.05 5793243.75)),((3427927.95 5793243.75,3427927.95 " 6862"5793243.7,3427927.9 5793243.7,3427927.85 5793243.7,\n" 6863"3427927.85 5793243.75,3427927.85 5793243.8,3427927.85 5793243.85,3427927.9 " 6864"5793243.85,\n" 6865"3427927.95 5793243.85,3427927.95 5793243.8,3427927.95 5793243.75)))" 6866msgstr "" 6867 6868#. Tag: programlisting 6869#: reference_raster.xml:3624 6870#, no-c-format 6871msgid "" 6872"--- Checking all the pixels of a large raster tile can take a long time.\n" 6873"--- You can dramatically improve speed at some lose of precision by orders " 6874"of magnitude\n" 6875"-- by sampling pixels using the step optional parameter of " 6876"generate_series.\n" 6877"-- This next example does the same as previous but by checking 1 for every " 6878"4 (2x2) pixels and putting in the last checked\n" 6879"-- putting in the checked pixel as the value for subsequent 4\n" 6880"\n" 6881"SELECT ST_AsText(ST_Union(pixpolyg)) As shadow\n" 6882"FROM (SELECT ST_Translate(ST_MakeEnvelope(\n" 6883" ST_UpperLeftX(rast), ST_UpperLeftY(rast),\n" 6884" ST_UpperLeftX(rast) + ST_ScaleX(rast)*2,\n" 6885" ST_UpperLeftY(rast) + ST_ScaleY(rast)*2, 0\n" 6886" ), ST_ScaleX(rast)*x, ST_ScaleY(rast)*y\n" 6887" ) As pixpolyg, ST_Value(rast, 2, x, y) As b2val\n" 6888" FROM dummy_rast CROSS JOIN\n" 6889"generate_series(1,1000,2) As x CROSS JOIN generate_series(1,1000,2) As y\n" 6890"WHERE rid = 2\n" 6891" AND x <= ST_Width(rast) AND y <= ST_Height(rast) ) As foo\n" 6892"WHERE\n" 6893" ST_Intersects(\n" 6894" pixpolyg,\n" 6895" ST_GeomFromText('POLYGON((3427928 5793244,3427927.75 " 6896"5793243.75,3427928 5793243.75,3427928 5793244))',0)\n" 6897" ) AND b2val != 254;\n" 6898"\n" 6899" shadow\n" 6900"------------------------------------------------------------------------------------\n" 6901" MULTIPOLYGON(((3427927.9 5793243.85,3427927.8 5793243.85,3427927.8 " 6902"5793243.95,\n" 6903" 3427927.9 5793243.95,3427928 5793243.95,3427928.1 5793243.95,3427928.1 " 6904"5793243.85,3427928 5793243.85,3427927.9 5793243.85)),\n" 6905" ((3427927.9 5793243.65,3427927.8 5793243.65,3427927.8 5793243.75,3427927.8 " 6906"5793243.85,3427927.9 5793243.85,\n" 6907" 3427928 5793243.85,3427928 5793243.75,3427928.1 5793243.75,3427928.1 " 6908"5793243.65,3427928 5793243.65,3427927.9 5793243.65)))" 6909msgstr "" 6910 6911#. Tag: para 6912#: reference_raster.xml:3629 6913#, no-c-format 6914msgid "" 6915", <xref linkend=\"RT_ST_DumpAsPolygons\"/>, <xref linkend=\"RT_ST_NumBands\"/" 6916">, <xref linkend=\"RT_ST_PixelAsPolygon\"/>, <xref linkend=\"RT_ST_ScaleX\"/" 6917">, <xref linkend=\"RT_ST_ScaleY\"/>, <xref linkend=\"RT_ST_UpperLeftX\"/>, " 6918"<xref linkend=\"RT_ST_UpperLeftY\"/>, <xref linkend=\"RT_ST_SRID\"/>, <xref " 6919"linkend=\"ST_AsText\"/>, <xref linkend=\"ST_Point\"/>, <xref linkend=" 6920"\"ST_MakeEnvelope\"/>, <xref linkend=\"ST_Intersects\"/>, <xref linkend=" 6921"\"ST_Intersection\"/>" 6922msgstr "" 6923 6924#. Tag: refname 6925#: reference_raster.xml:3650 6926#, no-c-format 6927msgid "ST_NearestValue" 6928msgstr "ST_NearestValue" 6929 6930#. Tag: refpurpose 6931#: reference_raster.xml:3651 6932#, no-c-format 6933msgid "" 6934"Returns the nearest non-<varname>NODATA</varname> value of a given band's " 6935"pixel specified by a columnx and rowy or a geometric point expressed in the " 6936"same spatial reference coordinate system as the raster." 6937msgstr "" 6938 6939#. Tag: funcsynopsis 6940#: reference_raster.xml:3657 6941#, no-c-format 6942msgid "" 6943"<funcprototype> <funcdef>double precision <function>ST_NearestValue</" 6944"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 6945"parameter></paramdef> <paramdef><type>integer </type> <parameter>bandnum</" 6946"parameter></paramdef> <paramdef><type>geometry </type> <parameter>pt</" 6947"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6948"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 6949"<funcprototype> <funcdef>double precision <function>ST_NearestValue</" 6950"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 6951"parameter></paramdef> <paramdef><type>geometry </type> <parameter>pt</" 6952"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6953"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 6954"<funcprototype> <funcdef>double precision <function>ST_NearestValue</" 6955"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 6956"parameter></paramdef> <paramdef><type>integer </type> <parameter>bandnum</" 6957"parameter></paramdef> <paramdef><type>integer </type> <parameter>columnx</" 6958"parameter></paramdef> <paramdef><type>integer </type> <parameter>rowy</" 6959"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6960"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 6961"<funcprototype> <funcdef>double precision <function>ST_NearestValue</" 6962"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 6963"parameter></paramdef> <paramdef><type>integer </type> <parameter>columnx</" 6964"parameter></paramdef> <paramdef><type>integer </type> <parameter>rowy</" 6965"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6966"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype>" 6967msgstr "" 6968"<funcprototype> <funcdef>double precision <function>ST_NearestValue</" 6969"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 6970"parameter></paramdef> <paramdef><type>integer </type> <parameter>bandnum</" 6971"parameter></paramdef> <paramdef><type>geometry </type> <parameter>pt</" 6972"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6973"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 6974"<funcprototype> <funcdef>double precision <function>ST_NearestValue</" 6975"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 6976"parameter></paramdef> <paramdef><type>geometry </type> <parameter>pt</" 6977"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6978"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 6979"<funcprototype> <funcdef>double precision <function>ST_NearestValue</" 6980"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 6981"parameter></paramdef> <paramdef><type>integer </type> <parameter>bandnum</" 6982"parameter></paramdef> <paramdef><type>integer </type> <parameter>columnx</" 6983"parameter></paramdef> <paramdef><type>integer </type> <parameter>rowy</" 6984"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6985"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 6986"<funcprototype> <funcdef>double precision <function>ST_NearestValue</" 6987"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 6988"parameter></paramdef> <paramdef><type>integer </type> <parameter>columnx</" 6989"parameter></paramdef> <paramdef><type>integer </type> <parameter>rowy</" 6990"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 6991"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype>" 6992 6993#. Tag: para 6994#: reference_raster.xml:3694 6995#, no-c-format 6996msgid "" 6997"Returns the nearest non-<varname>NODATA</varname> value of a given band in a " 6998"given columnx, rowy pixel or at a specific geometric point. If the columnx, " 6999"rowy pixel or the pixel at the specified geometric point is <varname>NODATA</" 7000"varname>, the function will find the nearest pixel to the columnx, rowy " 7001"pixel or geometric point whose value is not <varname>NODATA</varname>." 7002msgstr "" 7003 7004#. Tag: para 7005#: reference_raster.xml:3697 reference_raster.xml:3784 7006#, no-c-format 7007msgid "" 7008"Band numbers start at 1 and <varname>bandnum</varname> is assumed to be 1 if " 7009"not specified. If <varname>exclude_nodata_value</varname> is set to false, " 7010"then all pixels include <varname>nodata</varname> pixels are considered to " 7011"intersect and return value. If <varname>exclude_nodata_value</varname> is " 7012"not passed in then reads it from metadata of raster." 7013msgstr "" 7014 7015#. Tag: para 7016#: reference_raster.xml:3702 7017#, no-c-format 7018msgid "ST_NearestValue is a drop-in replacement for ST_Value." 7019msgstr "" 7020 7021#. Tag: programlisting 7022#: reference_raster.xml:3711 7023#, fuzzy, no-c-format 7024msgid "" 7025"-- pixel 2x2 has value\n" 7026"SELECT\n" 7027" ST_Value(rast, 2, 2) AS value,\n" 7028" ST_NearestValue(rast, 2, 2) AS nearestvalue\n" 7029"FROM (\n" 7030" SELECT\n" 7031" ST_SetValue(\n" 7032" ST_SetValue(\n" 7033" ST_SetValue(\n" 7034" ST_SetValue(\n" 7035" ST_SetValue(\n" 7036" ST_AddBand(\n" 7037" ST_MakeEmptyRaster(5, " 7038"5, -2, 2, 1, -1, 0, 0, 0),\n" 7039" '8BUI'::" 7040"text, 1, 0\n" 7041" ),\n" 7042" 1, 1, 0.\n" 7043" ),\n" 7044" 2, 3, 0.\n" 7045" ),\n" 7046" 3, 5, 0.\n" 7047" ),\n" 7048" 4, 2, 0.\n" 7049" ),\n" 7050" 5, 4, 0.\n" 7051" ) AS rast\n" 7052") AS foo\n" 7053"\n" 7054" value | nearestvalue\n" 7055"-------+--------------\n" 7056" 1 | 1" 7057msgstr "" 7058"-- un pixel 2x2 ha valore\n" 7059"SELECT\n" 7060" ST_Neighborhood(rast, 2, 2, 1, 1)\n" 7061"FROM (\n" 7062" SELECT\n" 7063" ST_SetValues(\n" 7064" ST_AddBand(\n" 7065" ST_MakeEmptyRaster(5, 5, -2, 2, 1, -1, 0, 0, " 7066"0),\n" 7067" '8BUI'::text, 1, 0\n" 7068" ),\n" 7069" 1, 1, 1, ARRAY[\n" 7070" [0, 1, 1, 1, 1],\n" 7071" [1, 1, 1, 0, 1],\n" 7072" [1, 0, 1, 1, 1],\n" 7073" [1, 1, 1, 1, 0],\n" 7074" [1, 1, 0, 1, 1]\n" 7075" ]::double precision[],\n" 7076" 1\n" 7077" ) AS rast\n" 7078") AS foo\n" 7079"\n" 7080" st_neighborhood \n" 7081"---------------------------------\n" 7082" {{NULL,1,1},{1,1,NULL},{1,1,1}}" 7083 7084#. Tag: programlisting 7085#: reference_raster.xml:3713 7086#, no-c-format 7087msgid "" 7088"-- pixel 2x3 is NODATA\n" 7089"SELECT\n" 7090" ST_Value(rast, 2, 3) AS value,\n" 7091" ST_NearestValue(rast, 2, 3) AS nearestvalue\n" 7092"FROM (\n" 7093" SELECT\n" 7094" ST_SetValue(\n" 7095" ST_SetValue(\n" 7096" ST_SetValue(\n" 7097" ST_SetValue(\n" 7098" ST_SetValue(\n" 7099" ST_AddBand(\n" 7100" ST_MakeEmptyRaster(5, " 7101"5, -2, 2, 1, -1, 0, 0, 0),\n" 7102" '8BUI'::" 7103"text, 1, 0\n" 7104" ),\n" 7105" 1, 1, 0.\n" 7106" ),\n" 7107" 2, 3, 0.\n" 7108" ),\n" 7109" 3, 5, 0.\n" 7110" ),\n" 7111" 4, 2, 0.\n" 7112" ),\n" 7113" 5, 4, 0.\n" 7114" ) AS rast\n" 7115") AS foo\n" 7116"\n" 7117" value | nearestvalue\n" 7118"-------+--------------\n" 7119" | 1" 7120msgstr "" 7121 7122#. Tag: para 7123#: reference_raster.xml:3719 7124#, no-c-format 7125msgid ", <xref linkend=\"RT_ST_Value\"/>" 7126msgstr ", <xref linkend=\"RT_ST_Value\"/>" 7127 7128#. Tag: refname 7129#: reference_raster.xml:3729 7130#, no-c-format 7131msgid "ST_Neighborhood" 7132msgstr "ST_Neighborhood" 7133 7134#. Tag: refpurpose 7135#: reference_raster.xml:3730 7136#, no-c-format 7137msgid "" 7138"Returns a 2-D double precision array of the non-<varname>NODATA</varname> " 7139"values around a given band's pixel specified by either a columnX and rowY or " 7140"a geometric point expressed in the same spatial reference coordinate system " 7141"as the raster." 7142msgstr "" 7143 7144#. Tag: funcsynopsis 7145#: reference_raster.xml:3736 7146#, no-c-format 7147msgid "" 7148"<funcprototype> <funcdef>double precision[][] <function>ST_Neighborhood</" 7149"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 7150"parameter></paramdef> <paramdef><type>integer </type> <parameter>bandnum</" 7151"parameter></paramdef> <paramdef><type>integer </type> <parameter>columnX</" 7152"parameter></paramdef> <paramdef><type>integer </type> <parameter>rowY</" 7153"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceX</" 7154"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceY</" 7155"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 7156"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 7157"<funcprototype> <funcdef>double precision[][] <function>ST_Neighborhood</" 7158"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 7159"parameter></paramdef> <paramdef><type>integer </type> <parameter>columnX</" 7160"parameter></paramdef> <paramdef><type>integer </type> <parameter>rowY</" 7161"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceX</" 7162"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceY</" 7163"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 7164"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 7165"<funcprototype> <funcdef>double precision[][] <function>ST_Neighborhood</" 7166"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 7167"parameter></paramdef> <paramdef><type>integer </type> <parameter>bandnum</" 7168"parameter></paramdef> <paramdef><type>geometry </type> <parameter>pt</" 7169"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceX</" 7170"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceY</" 7171"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 7172"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 7173"<funcprototype> <funcdef>double precision[][] <function>ST_Neighborhood</" 7174"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 7175"parameter></paramdef> <paramdef><type>geometry </type> <parameter>pt</" 7176"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceX</" 7177"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceY</" 7178"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 7179"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype>" 7180msgstr "" 7181"<funcprototype> <funcdef>double precision[][] <function>ST_Neighborhood</" 7182"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 7183"parameter></paramdef> <paramdef><type>integer </type> <parameter>bandnum</" 7184"parameter></paramdef> <paramdef><type>integer </type> <parameter>columnX</" 7185"parameter></paramdef> <paramdef><type>integer </type> <parameter>rowY</" 7186"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceX</" 7187"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceY</" 7188"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 7189"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 7190"<funcprototype> <funcdef>double precision[][] <function>ST_Neighborhood</" 7191"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 7192"parameter></paramdef> <paramdef><type>integer </type> <parameter>columnX</" 7193"parameter></paramdef> <paramdef><type>integer </type> <parameter>rowY</" 7194"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceX</" 7195"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceY</" 7196"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 7197"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 7198"<funcprototype> <funcdef>double precision[][] <function>ST_Neighborhood</" 7199"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 7200"parameter></paramdef> <paramdef><type>integer </type> <parameter>bandnum</" 7201"parameter></paramdef> <paramdef><type>geometry </type> <parameter>pt</" 7202"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceX</" 7203"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceY</" 7204"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 7205"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 7206"<funcprototype> <funcdef>double precision[][] <function>ST_Neighborhood</" 7207"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 7208"parameter></paramdef> <paramdef><type>geometry </type> <parameter>pt</" 7209"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceX</" 7210"parameter></paramdef> <paramdef><type>integer </type> <parameter>distanceY</" 7211"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 7212"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype>" 7213 7214#. Tag: para 7215#: reference_raster.xml:3781 7216#, no-c-format 7217msgid "" 7218"Returns a 2-D double precision array of the non-<varname>NODATA</varname> " 7219"values around a given band's pixel specified by either a columnX and rowY or " 7220"a geometric point expressed in the same spatial reference coordinate system " 7221"as the raster. The <varname>distanceX</varname> and <varname>distanceY</" 7222"varname> parameters define the number of pixels around the specified pixel " 7223"in the X and Y axes, e.g. I want all values within 3 pixel distance along " 7224"the X axis and 2 pixel distance along the Y axis around my pixel of " 7225"interest. The center value of the 2-D array will be the value at the pixel " 7226"specified by the columnX and rowY or the geometric point." 7227msgstr "" 7228 7229#. Tag: para 7230#: reference_raster.xml:3788 7231#, no-c-format 7232msgid "" 7233"The number of elements along each axis of the returning 2-D array is 2 * " 7234"(<varname>distanceX</varname>|<varname>distanceY</varname>) + 1. So for a " 7235"<varname>distanceX</varname> and <varname>distanceY</varname> of 1, the " 7236"returning array will be 3x3." 7237msgstr "" 7238 7239#. Tag: para 7240#: reference_raster.xml:3793 7241#, no-c-format 7242msgid "" 7243"The 2-D array output can be passed to any of the raster processing builtin " 7244"functions, e.g. ST_Min4ma, ST_Sum4ma, ST_Mean4ma." 7245msgstr "" 7246 7247#. Tag: programlisting 7248#: reference_raster.xml:3803 7249#, fuzzy, no-c-format 7250msgid "" 7251"-- pixel 2x2 has value\n" 7252"SELECT\n" 7253" ST_Neighborhood(rast, 2, 2, 1, 1)\n" 7254"FROM (\n" 7255" SELECT\n" 7256" ST_SetValues(\n" 7257" ST_AddBand(\n" 7258" ST_MakeEmptyRaster(5, 5, -2, 2, 1, -1, 0, 0, " 7259"0),\n" 7260" '8BUI'::text, 1, 0\n" 7261" ),\n" 7262" 1, 1, 1, ARRAY[\n" 7263" [0, 1, 1, 1, 1],\n" 7264" [1, 1, 1, 0, 1],\n" 7265" [1, 0, 1, 1, 1],\n" 7266" [1, 1, 1, 1, 0],\n" 7267" [1, 1, 0, 1, 1]\n" 7268" ]::double precision[],\n" 7269" 1\n" 7270" ) AS rast\n" 7271") AS foo\n" 7272"\n" 7273" st_neighborhood\n" 7274"---------------------------------\n" 7275" {{NULL,1,1},{1,1,NULL},{1,1,1}}" 7276msgstr "" 7277"-- un pixel 2x2 ha valore\n" 7278"SELECT\n" 7279" ST_Neighborhood(rast, 2, 2, 1, 1)\n" 7280"FROM (\n" 7281" SELECT\n" 7282" ST_SetValues(\n" 7283" ST_AddBand(\n" 7284" ST_MakeEmptyRaster(5, 5, -2, 2, 1, -1, 0, 0, " 7285"0),\n" 7286" '8BUI'::text, 1, 0\n" 7287" ),\n" 7288" 1, 1, 1, ARRAY[\n" 7289" [0, 1, 1, 1, 1],\n" 7290" [1, 1, 1, 0, 1],\n" 7291" [1, 0, 1, 1, 1],\n" 7292" [1, 1, 1, 1, 0],\n" 7293" [1, 1, 0, 1, 1]\n" 7294" ]::double precision[],\n" 7295" 1\n" 7296" ) AS rast\n" 7297") AS foo\n" 7298"\n" 7299" st_neighborhood \n" 7300"---------------------------------\n" 7301" {{NULL,1,1},{1,1,NULL},{1,1,1}}" 7302 7303#. Tag: programlisting 7304#: reference_raster.xml:3805 7305#, fuzzy, no-c-format 7306msgid "" 7307"-- pixel 2x3 is NODATA\n" 7308"SELECT\n" 7309" ST_Neighborhood(rast, 2, 3, 1, 1)\n" 7310"FROM (\n" 7311" SELECT\n" 7312" ST_SetValues(\n" 7313" ST_AddBand(\n" 7314" ST_MakeEmptyRaster(5, 5, -2, 2, 1, -1, 0, 0, " 7315"0),\n" 7316" '8BUI'::text, 1, 0\n" 7317" ),\n" 7318" 1, 1, 1, ARRAY[\n" 7319" [0, 1, 1, 1, 1],\n" 7320" [1, 1, 1, 0, 1],\n" 7321" [1, 0, 1, 1, 1],\n" 7322" [1, 1, 1, 1, 0],\n" 7323" [1, 1, 0, 1, 1]\n" 7324" ]::double precision[],\n" 7325" 1\n" 7326" ) AS rast\n" 7327") AS foo\n" 7328"\n" 7329" st_neighborhood\n" 7330"------------------------------\n" 7331" {{1,1,1},{1,NULL,1},{1,1,1}}" 7332msgstr "" 7333"-- un pixel 2x2 ha valore\n" 7334"SELECT\n" 7335" ST_Neighborhood(rast, 2, 2, 1, 1)\n" 7336"FROM (\n" 7337" SELECT\n" 7338" ST_SetValues(\n" 7339" ST_AddBand(\n" 7340" ST_MakeEmptyRaster(5, 5, -2, 2, 1, -1, 0, 0, " 7341"0),\n" 7342" '8BUI'::text, 1, 0\n" 7343" ),\n" 7344" 1, 1, 1, ARRAY[\n" 7345" [0, 1, 1, 1, 1],\n" 7346" [1, 1, 1, 0, 1],\n" 7347" [1, 0, 1, 1, 1],\n" 7348" [1, 1, 1, 1, 0],\n" 7349" [1, 1, 0, 1, 1]\n" 7350" ]::double precision[],\n" 7351" 1\n" 7352" ) AS rast\n" 7353") AS foo\n" 7354"\n" 7355" st_neighborhood \n" 7356"---------------------------------\n" 7357" {{NULL,1,1},{1,1,NULL},{1,1,1}}" 7358 7359#. Tag: programlisting 7360#: reference_raster.xml:3807 7361#, fuzzy, no-c-format 7362msgid "" 7363"-- pixel 3x3 has value\n" 7364"-- exclude_nodata_value = FALSE\n" 7365"SELECT\n" 7366" ST_Neighborhood(rast, 3, 3, 1, 1, false)\n" 7367"FROM (\n" 7368" ST_SetValues(\n" 7369" ST_AddBand(\n" 7370" ST_MakeEmptyRaster(5, 5, -2, 2, 1, -1, 0, 0, " 7371"0),\n" 7372" '8BUI'::text, 1, 0\n" 7373" ),\n" 7374" 1, 1, 1, ARRAY[\n" 7375" [0, 1, 1, 1, 1],\n" 7376" [1, 1, 1, 0, 1],\n" 7377" [1, 0, 1, 1, 1],\n" 7378" [1, 1, 1, 1, 0],\n" 7379" [1, 1, 0, 1, 1]\n" 7380" ]::double precision[],\n" 7381" 1\n" 7382" ) AS rast\n" 7383") AS foo\n" 7384"\n" 7385" st_neighborhood\n" 7386"---------------------------\n" 7387" {{1,0,1},{1,1,1},{0,1,1}}" 7388msgstr "" 7389"-- un pixel 2x2 ha valore\n" 7390"SELECT\n" 7391" ST_Neighborhood(rast, 2, 2, 1, 1)\n" 7392"FROM (\n" 7393" SELECT\n" 7394" ST_SetValues(\n" 7395" ST_AddBand(\n" 7396" ST_MakeEmptyRaster(5, 5, -2, 2, 1, -1, 0, 0, " 7397"0),\n" 7398" '8BUI'::text, 1, 0\n" 7399" ),\n" 7400" 1, 1, 1, ARRAY[\n" 7401" [0, 1, 1, 1, 1],\n" 7402" [1, 1, 1, 0, 1],\n" 7403" [1, 0, 1, 1, 1],\n" 7404" [1, 1, 1, 1, 0],\n" 7405" [1, 1, 0, 1, 1]\n" 7406" ]::double precision[],\n" 7407" 1\n" 7408" ) AS rast\n" 7409") AS foo\n" 7410"\n" 7411" st_neighborhood \n" 7412"---------------------------------\n" 7413" {{NULL,1,1},{1,1,NULL},{1,1,1}}" 7414 7415#. Tag: para 7416#: reference_raster.xml:3813 7417#, no-c-format 7418msgid "" 7419", <xref linkend=\"RT_ST_Min4ma\"/>, <xref linkend=\"RT_ST_Max4ma\"/>, <xref " 7420"linkend=\"RT_ST_Sum4ma\"/>, <xref linkend=\"RT_ST_Mean4ma\"/>, <xref linkend=" 7421"\"RT_ST_Range4ma\"/>, <xref linkend=\"RT_ST_Distinct4ma\"/>, <xref linkend=" 7422"\"RT_ST_StdDev4ma\"/>" 7423msgstr "" 7424", <xref linkend=\"RT_ST_Min4ma\"/>, <xref linkend=\"RT_ST_Max4ma\"/>, <xref " 7425"linkend=\"RT_ST_Sum4ma\"/>, <xref linkend=\"RT_ST_Mean4ma\"/>, <xref linkend=" 7426"\"RT_ST_Range4ma\"/>, <xref linkend=\"RT_ST_Distinct4ma\"/>, <xref linkend=" 7427"\"RT_ST_StdDev4ma\"/>" 7428 7429#. Tag: refname 7430#: reference_raster.xml:3830 7431#, no-c-format 7432msgid "ST_SetValue" 7433msgstr "ST_SetValue" 7434 7435#. Tag: refpurpose 7436#: reference_raster.xml:3831 7437#, no-c-format 7438msgid "" 7439"Returns modified raster resulting from setting the value of a given band in " 7440"a given columnx, rowy pixel or the pixels that intersect a particular " 7441"geometry. Band numbers start at 1 and assumed to be 1 if not specified." 7442msgstr "" 7443 7444#. Tag: funcsynopsis 7445#: reference_raster.xml:3835 7446#, no-c-format 7447msgid "" 7448"<funcprototype> <funcdef>raster <function>ST_SetValue</function></funcdef> " 7449"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 7450"<paramdef><type>integer </type> <parameter>bandnum</parameter></paramdef> " 7451"<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef> " 7452"<paramdef><type>double precision </type> <parameter>newvalue</parameter></" 7453"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 7454"<function>ST_SetValue</function></funcdef> <paramdef><type>raster </type> " 7455"<parameter>rast</parameter></paramdef> <paramdef><type>geometry </type> " 7456"<parameter>geom</parameter></paramdef> <paramdef><type>double precision </" 7457"type> <parameter>newvalue</parameter></paramdef> </funcprototype> " 7458"<funcprototype> <funcdef>raster <function>ST_SetValue</function></funcdef> " 7459"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 7460"<paramdef><type>integer </type> <parameter>bandnum</parameter></paramdef> " 7461"<paramdef><type>integer </type> <parameter>columnx</parameter></paramdef> " 7462"<paramdef><type>integer </type> <parameter>rowy</parameter></paramdef> " 7463"<paramdef><type>double precision </type> <parameter>newvalue</parameter></" 7464"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 7465"<function>ST_SetValue</function></funcdef> <paramdef><type>raster </type> " 7466"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 7467"<parameter>columnx</parameter></paramdef> <paramdef><type>integer </type> " 7468"<parameter>rowy</parameter></paramdef> <paramdef><type>double precision </" 7469"type> <parameter>newvalue</parameter></paramdef> </funcprototype>" 7470msgstr "" 7471 7472#. Tag: para 7473#: reference_raster.xml:3869 7474#, no-c-format 7475msgid "" 7476"Returns modified raster resulting from setting the specified pixels' values " 7477"to new value for the designated band given the raster's row and column or a " 7478"geometry. If no band is specified, then band 1 is assumed." 7479msgstr "" 7480 7481#. Tag: para 7482#: reference_raster.xml:3872 7483#, no-c-format 7484msgid "" 7485"Enhanced: 2.1.0 Geometry variant of ST_SetValue() now supports any geometry " 7486"type, not just point. The geometry variant is a wrapper around the geomval[] " 7487"variant of ST_SetValues()" 7488msgstr "" 7489 7490#. Tag: programlisting 7491#: reference_raster.xml:3878 7492#, no-c-format 7493msgid "" 7494"-- Geometry example\n" 7495"SELECT (foo.geomval).val, ST_AsText(ST_Union((foo.geomval).geom))\n" 7496"FROM (SELECT ST_DumpAsPolygons(\n" 7497" ST_SetValue(rast,1,\n" 7498" ST_Point(3427927.75, 5793243.95),\n" 7499" 50)\n" 7500" ) As geomval\n" 7501"FROM dummy_rast\n" 7502"where rid = 2) As foo\n" 7503"WHERE (foo.geomval).val < 250\n" 7504"GROUP BY (foo.geomval).val;\n" 7505"\n" 7506" val | st_astext\n" 7507"-----+-------------------------------------------------------------------\n" 7508" 50 | POLYGON((3427927.75 5793244,3427927.75 5793243.95,3427927.8 " 7509"579324 ...\n" 7510" 249 | POLYGON((3427927.95 5793243.95,3427927.95 5793243.85,3427928 57932 ..." 7511msgstr "" 7512 7513#. Tag: programlisting 7514#: reference_raster.xml:3880 7515#, no-c-format 7516msgid "" 7517"-- Store the changed raster --\n" 7518" UPDATE dummy_rast SET rast = ST_SetValue(rast,1, " 7519"ST_Point(3427927.75, 5793243.95),100)\n" 7520" WHERE rid = 2 ;" 7521msgstr "" 7522 7523#. Tag: para 7524#: reference_raster.xml:3884 reference_raster.xml:9962 7525#, no-c-format 7526msgid ", <xref linkend=\"RT_ST_DumpAsPolygons\"/>" 7527msgstr ", <xref linkend=\"RT_ST_DumpAsPolygons\"/>" 7528 7529#. Tag: refname 7530#: reference_raster.xml:3890 7531#, no-c-format 7532msgid "ST_SetValues" 7533msgstr "ST_SetValues" 7534 7535#. Tag: refpurpose 7536#: reference_raster.xml:3891 7537#, no-c-format 7538msgid "" 7539"Returns modified raster resulting from setting the values of a given band." 7540msgstr "" 7541 7542#. Tag: funcsynopsis 7543#: reference_raster.xml:3895 7544#, no-c-format 7545msgid "" 7546"<funcprototype> <funcdef>raster <function>ST_SetValues</function></funcdef> " 7547"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 7548"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 7549"<paramdef><type>integer </type> <parameter>columnx</parameter></paramdef> " 7550"<paramdef><type>integer </type> <parameter>rowy</parameter></paramdef> " 7551"<paramdef><type>double precision[][] </type> <parameter>newvalueset</" 7552"parameter></paramdef> <paramdef><type>boolean[][] </type> " 7553"<parameter>noset=NULL</parameter></paramdef> <paramdef><type>boolean </type> " 7554"<parameter>keepnodata=FALSE</parameter></paramdef> </funcprototype> " 7555"<funcprototype> <funcdef>raster <function>ST_SetValues</function></funcdef> " 7556"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 7557"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 7558"<paramdef><type>integer </type> <parameter>columnx</parameter></paramdef> " 7559"<paramdef><type>integer </type> <parameter>rowy</parameter></paramdef> " 7560"<paramdef><type>double precision[][] </type> <parameter>newvalueset</" 7561"parameter></paramdef> <paramdef><type>double precision </type> " 7562"<parameter>nosetvalue</parameter></paramdef> <paramdef><type>boolean </type> " 7563"<parameter>keepnodata=FALSE</parameter></paramdef> </funcprototype> " 7564"<funcprototype> <funcdef>raster <function>ST_SetValues</function></funcdef> " 7565"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 7566"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 7567"<paramdef><type>integer </type> <parameter>columnx</parameter></paramdef> " 7568"<paramdef><type>integer </type> <parameter>rowy</parameter></paramdef> " 7569"<paramdef><type>integer </type> <parameter>width</parameter></paramdef> " 7570"<paramdef><type>integer </type> <parameter>height</parameter></paramdef> " 7571"<paramdef><type>double precision </type> <parameter>newvalue</parameter></" 7572"paramdef> <paramdef><type>boolean </type> <parameter>keepnodata=FALSE</" 7573"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 7574"<function>ST_SetValues</function></funcdef> <paramdef><type>raster </type> " 7575"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 7576"<parameter>columnx</parameter></paramdef> <paramdef><type>integer </type> " 7577"<parameter>rowy</parameter></paramdef> <paramdef><type>integer </type> " 7578"<parameter>width</parameter></paramdef> <paramdef><type>integer </type> " 7579"<parameter>height</parameter></paramdef> <paramdef><type>double precision </" 7580"type> <parameter>newvalue</parameter></paramdef> <paramdef><type>boolean </" 7581"type> <parameter>keepnodata=FALSE</parameter></paramdef> </funcprototype> " 7582"<funcprototype> <funcdef>raster <function>ST_SetValues</function></funcdef> " 7583"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 7584"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 7585"<paramdef><type>geomval[] </type> <parameter>geomvalset</parameter></" 7586"paramdef> <paramdef><type>boolean </type> <parameter>keepnodata=FALSE</" 7587"parameter></paramdef> </funcprototype>" 7588msgstr "" 7589 7590#. Tag: para 7591#: reference_raster.xml:3954 7592#, no-c-format 7593msgid "" 7594"Returns modified raster resulting from setting specified pixels to new " 7595"value(s) for the designated band." 7596msgstr "" 7597 7598#. Tag: para 7599#: reference_raster.xml:3958 7600#, no-c-format 7601msgid "" 7602"If <varname>keepnodata</varname> is TRUE, those pixels whose values are " 7603"NODATA will not be set with the corresponding value in <varname>newvalueset</" 7604"varname>." 7605msgstr "" 7606 7607#. Tag: para 7608#: reference_raster.xml:3962 7609#, no-c-format 7610msgid "" 7611"For Variant 1, the specific pixels to be set are determined by the " 7612"<varname>columnx</varname>, <varname>rowy</varname> pixel coordinates and " 7613"the dimensions of the <varname>newvalueset</varname> array. <varname>noset</" 7614"varname> can be used to prevent pixels with values present in " 7615"<varname>newvalueset</varname> from being set (due to PostgreSQL not " 7616"permitting ragged/jagged arrays). See example Variant 1." 7617msgstr "" 7618 7619#. Tag: para 7620#: reference_raster.xml:3966 7621#, no-c-format 7622msgid "" 7623"Variant 2 is like Variant 1 but with a simple double precision " 7624"<varname>nosetvalue</varname> instead of a boolean <varname>noset</varname> " 7625"array. Elements in <varname>newvalueset</varname> with the " 7626"<varname>nosetvalue</varname> value with be skipped. See example Variant 2." 7627msgstr "" 7628 7629#. Tag: para 7630#: reference_raster.xml:3970 7631#, no-c-format 7632msgid "" 7633"For Variant 3, the specific pixels to be set are determined by the " 7634"<varname>columnx</varname>, <varname>rowy</varname> pixel coordinates, " 7635"<varname>width</varname> and <varname>height</varname>. See example Variant " 7636"3." 7637msgstr "" 7638 7639#. Tag: para 7640#: reference_raster.xml:3974 7641#, no-c-format 7642msgid "" 7643"Variant 4 is the same as Variant 3 with the exception that it assumes that " 7644"the first band's pixels of <varname>rast</varname> will be set." 7645msgstr "" 7646 7647#. Tag: para 7648#: reference_raster.xml:3978 7649#, no-c-format 7650msgid "" 7651"For Variant 5, an array of <xref linkend=\"geomval\"/> is used to determine " 7652"the specific pixels to be set. If all the geometries in the array are of " 7653"type POINT or MULTIPOINT, the function uses a shortcut where the longitude " 7654"and latitude of each point is used to set a pixel directly. Otherwise, the " 7655"geometries are converted to rasters and then iterated through in one pass. " 7656"See example Variant 5." 7657msgstr "" 7658 7659#. Tag: programlisting 7660#: reference_raster.xml:3989 7661#, no-c-format 7662msgid "" 7663"/*\n" 7664"The ST_SetValues() does the following...\n" 7665"\n" 7666"+ - + - + - + + - + - + - +\n" 7667"| 1 | 1 | 1 | | 1 | 1 | 1 |\n" 7668"+ - + - + - + + - + - + - +\n" 7669"| 1 | 1 | 1 | => | 1 | 9 | 9 |\n" 7670"+ - + - + - + + - + - + - +\n" 7671"| 1 | 1 | 1 | | 1 | 9 | 9 |\n" 7672"+ - + - + - + + - + - + - +\n" 7673"*/\n" 7674"SELECT\n" 7675" (poly).x,\n" 7676" (poly).y,\n" 7677" (poly).val\n" 7678"FROM (\n" 7679"SELECT\n" 7680" ST_PixelAsPolygons(\n" 7681" ST_SetValues(\n" 7682" ST_AddBand(\n" 7683" ST_MakeEmptyRaster(3, 3, 0, 0, 1, -1, 0, 0, " 7684"0),\n" 7685" 1, '8BUI', 1, 0\n" 7686" ),\n" 7687" 1, 2, 2, ARRAY[[9, 9], [9, 9]]::double precision[]" 7688"[]\n" 7689" )\n" 7690" ) AS poly\n" 7691") foo\n" 7692"ORDER BY 1, 2;\n" 7693"\n" 7694" x | y | val\n" 7695"---+---+-----\n" 7696" 1 | 1 | 1\n" 7697" 1 | 2 | 1\n" 7698" 1 | 3 | 1\n" 7699" 2 | 1 | 1\n" 7700" 2 | 2 | 9\n" 7701" 2 | 3 | 9\n" 7702" 3 | 1 | 1\n" 7703" 3 | 2 | 9\n" 7704" 3 | 3 | 9" 7705msgstr "" 7706 7707#. Tag: programlisting 7708#: reference_raster.xml:3991 7709#, no-c-format 7710msgid "" 7711"/*\n" 7712"The ST_SetValues() does the following...\n" 7713"\n" 7714"+ - + - + - + + - + - + - +\n" 7715"| 1 | 1 | 1 | | 9 | 9 | 9 |\n" 7716"+ - + - + - + + - + - + - +\n" 7717"| 1 | 1 | 1 | => | 9 | | 9 |\n" 7718"+ - + - + - + + - + - + - +\n" 7719"| 1 | 1 | 1 | | 9 | 9 | 9 |\n" 7720"+ - + - + - + + - + - + - +\n" 7721"*/\n" 7722"SELECT\n" 7723" (poly).x,\n" 7724" (poly).y,\n" 7725" (poly).val\n" 7726"FROM (\n" 7727"SELECT\n" 7728" ST_PixelAsPolygons(\n" 7729" ST_SetValues(\n" 7730" ST_AddBand(\n" 7731" ST_MakeEmptyRaster(3, 3, 0, 0, 1, -1, 0, 0, " 7732"0),\n" 7733" 1, '8BUI', 1, 0\n" 7734" ),\n" 7735" 1, 1, 1, ARRAY[[9, 9, 9], [9, NULL, 9], [9, 9, 9]]::" 7736"double precision[][]\n" 7737" )\n" 7738" ) AS poly\n" 7739") foo\n" 7740"ORDER BY 1, 2;\n" 7741"\n" 7742" x | y | val\n" 7743"---+---+-----\n" 7744" 1 | 1 | 9\n" 7745" 1 | 2 | 9\n" 7746" 1 | 3 | 9\n" 7747" 2 | 1 | 9\n" 7748" 2 | 2 |\n" 7749" 2 | 3 | 9\n" 7750" 3 | 1 | 9\n" 7751" 3 | 2 | 9\n" 7752" 3 | 3 | 9" 7753msgstr "" 7754 7755#. Tag: programlisting 7756#: reference_raster.xml:3993 7757#, no-c-format 7758msgid "" 7759"/*\n" 7760"The ST_SetValues() does the following...\n" 7761"\n" 7762"+ - + - + - + + - + - + - +\n" 7763"| 1 | 1 | 1 | | 9 | 9 | 9 |\n" 7764"+ - + - + - + + - + - + - +\n" 7765"| 1 | 1 | 1 | => | 1 | | 9 |\n" 7766"+ - + - + - + + - + - + - +\n" 7767"| 1 | 1 | 1 | | 9 | 9 | 9 |\n" 7768"+ - + - + - + + - + - + - +\n" 7769"*/\n" 7770"SELECT\n" 7771" (poly).x,\n" 7772" (poly).y,\n" 7773" (poly).val\n" 7774"FROM (\n" 7775"SELECT\n" 7776" ST_PixelAsPolygons(\n" 7777" ST_SetValues(\n" 7778" ST_AddBand(\n" 7779" ST_MakeEmptyRaster(3, 3, 0, 0, 1, -1, 0, 0, " 7780"0),\n" 7781" 1, '8BUI', 1, 0\n" 7782" ),\n" 7783" 1, 1, 1,\n" 7784" ARRAY[[9, 9, 9], [9, NULL, 9], [9, 9, 9]]::" 7785"double precision[][],\n" 7786" ARRAY[[false], [true]]::boolean[][]\n" 7787" )\n" 7788" ) AS poly\n" 7789") foo\n" 7790"ORDER BY 1, 2;\n" 7791"\n" 7792" x | y | val\n" 7793"---+---+-----\n" 7794" 1 | 1 | 9\n" 7795" 1 | 2 | 1\n" 7796" 1 | 3 | 9\n" 7797" 2 | 1 | 9\n" 7798" 2 | 2 |\n" 7799" 2 | 3 | 9\n" 7800" 3 | 1 | 9\n" 7801" 3 | 2 | 9\n" 7802" 3 | 3 | 9" 7803msgstr "" 7804 7805#. Tag: programlisting 7806#: reference_raster.xml:3995 7807#, no-c-format 7808msgid "" 7809"/*\n" 7810"The ST_SetValues() does the following...\n" 7811"\n" 7812"+ - + - + - + + - + - + - +\n" 7813"| | 1 | 1 | | | 9 | 9 |\n" 7814"+ - + - + - + + - + - + - +\n" 7815"| 1 | 1 | 1 | => | 1 | | 9 |\n" 7816"+ - + - + - + + - + - + - +\n" 7817"| 1 | 1 | 1 | | 9 | 9 | 9 |\n" 7818"+ - + - + - + + - + - + - +\n" 7819"*/\n" 7820"SELECT\n" 7821" (poly).x,\n" 7822" (poly).y,\n" 7823" (poly).val\n" 7824"FROM (\n" 7825"SELECT\n" 7826" ST_PixelAsPolygons(\n" 7827" ST_SetValues(\n" 7828" ST_SetValue(\n" 7829" ST_AddBand(\n" 7830" ST_MakeEmptyRaster(3, 3, 0, 0, 1, " 7831"-1, 0, 0, 0),\n" 7832" 1, '8BUI', 1, 0\n" 7833" ),\n" 7834" 1, 1, 1, NULL\n" 7835" ),\n" 7836" 1, 1, 1,\n" 7837" ARRAY[[9, 9, 9], [9, NULL, 9], [9, 9, 9]]::" 7838"double precision[][],\n" 7839" ARRAY[[false], [true]]::boolean[][],\n" 7840" TRUE\n" 7841" )\n" 7842" ) AS poly\n" 7843") foo\n" 7844"ORDER BY 1, 2;\n" 7845"\n" 7846" x | y | val\n" 7847"---+---+-----\n" 7848" 1 | 1 |\n" 7849" 1 | 2 | 1\n" 7850" 1 | 3 | 9\n" 7851" 2 | 1 | 9\n" 7852" 2 | 2 |\n" 7853" 2 | 3 | 9\n" 7854" 3 | 1 | 9\n" 7855" 3 | 2 | 9\n" 7856" 3 | 3 | 9" 7857msgstr "" 7858 7859#. Tag: programlisting 7860#: reference_raster.xml:4002 7861#, no-c-format 7862msgid "" 7863"/*\n" 7864"The ST_SetValues() does the following...\n" 7865"\n" 7866"+ - + - + - + + - + - + - +\n" 7867"| 1 | 1 | 1 | | 1 | 1 | 1 |\n" 7868"+ - + - + - + + - + - + - +\n" 7869"| 1 | 1 | 1 | => | 1 | 9 | 9 |\n" 7870"+ - + - + - + + - + - + - +\n" 7871"| 1 | 1 | 1 | | 1 | 9 | 9 |\n" 7872"+ - + - + - + + - + - + - +\n" 7873"*/\n" 7874"SELECT\n" 7875" (poly).x,\n" 7876" (poly).y,\n" 7877" (poly).val\n" 7878"FROM (\n" 7879"SELECT\n" 7880" ST_PixelAsPolygons(\n" 7881" ST_SetValues(\n" 7882" ST_AddBand(\n" 7883" ST_MakeEmptyRaster(3, 3, 0, 0, 1, -1, 0, 0, " 7884"0),\n" 7885" 1, '8BUI', 1, 0\n" 7886" ),\n" 7887" 1, 1, 1, ARRAY[[-1, -1, -1], [-1, 9, 9], [-1, 9, " 7888"9]]::double precision[][], -1\n" 7889" )\n" 7890" ) AS poly\n" 7891") foo\n" 7892"ORDER BY 1, 2;\n" 7893"\n" 7894" x | y | val\n" 7895"---+---+-----\n" 7896" 1 | 1 | 1\n" 7897" 1 | 2 | 1\n" 7898" 1 | 3 | 1\n" 7899" 2 | 1 | 1\n" 7900" 2 | 2 | 9\n" 7901" 2 | 3 | 9\n" 7902" 3 | 1 | 1\n" 7903" 3 | 2 | 9\n" 7904" 3 | 3 | 9" 7905msgstr "" 7906 7907#. Tag: programlisting 7908#: reference_raster.xml:4004 7909#, no-c-format 7910msgid "" 7911"/*\n" 7912"This example is like the previous one. Instead of nosetvalue = -1, " 7913"nosetvalue = NULL\n" 7914"\n" 7915"The ST_SetValues() does the following...\n" 7916"\n" 7917"+ - + - + - + + - + - + - +\n" 7918"| 1 | 1 | 1 | | 1 | 1 | 1 |\n" 7919"+ - + - + - + + - + - + - +\n" 7920"| 1 | 1 | 1 | => | 1 | 9 | 9 |\n" 7921"+ - + - + - + + - + - + - +\n" 7922"| 1 | 1 | 1 | | 1 | 9 | 9 |\n" 7923"+ - + - + - + + - + - + - +\n" 7924"*/\n" 7925"SELECT\n" 7926" (poly).x,\n" 7927" (poly).y,\n" 7928" (poly).val\n" 7929"FROM (\n" 7930"SELECT\n" 7931" ST_PixelAsPolygons(\n" 7932" ST_SetValues(\n" 7933" ST_AddBand(\n" 7934" ST_MakeEmptyRaster(3, 3, 0, 0, 1, -1, 0, 0, " 7935"0),\n" 7936" 1, '8BUI', 1, 0\n" 7937" ),\n" 7938" 1, 1, 1, ARRAY[[NULL, NULL, NULL], [NULL, 9, 9], " 7939"[NULL, 9, 9]]::double precision[][], NULL::double precision\n" 7940" )\n" 7941" ) AS poly\n" 7942") foo\n" 7943"ORDER BY 1, 2;\n" 7944"\n" 7945" x | y | val\n" 7946"---+---+-----\n" 7947" 1 | 1 | 1\n" 7948" 1 | 2 | 1\n" 7949" 1 | 3 | 1\n" 7950" 2 | 1 | 1\n" 7951" 2 | 2 | 9\n" 7952" 2 | 3 | 9\n" 7953" 3 | 1 | 1\n" 7954" 3 | 2 | 9\n" 7955" 3 | 3 | 9" 7956msgstr "" 7957 7958#. Tag: title 7959#: reference_raster.xml:4009 reference_raster.xml:4954 7960#, no-c-format 7961msgid "Examples: Variant 3" 7962msgstr "" 7963 7964#. Tag: programlisting 7965#: reference_raster.xml:4011 7966#, no-c-format 7967msgid "" 7968"/*\n" 7969"The ST_SetValues() does the following...\n" 7970"\n" 7971"+ - + - + - + + - + - + - +\n" 7972"| 1 | 1 | 1 | | 1 | 1 | 1 |\n" 7973"+ - + - + - + + - + - + - +\n" 7974"| 1 | 1 | 1 | => | 1 | 9 | 9 |\n" 7975"+ - + - + - + + - + - + - +\n" 7976"| 1 | 1 | 1 | | 1 | 9 | 9 |\n" 7977"+ - + - + - + + - + - + - +\n" 7978"*/\n" 7979"SELECT\n" 7980" (poly).x,\n" 7981" (poly).y,\n" 7982" (poly).val\n" 7983"FROM (\n" 7984"SELECT\n" 7985" ST_PixelAsPolygons(\n" 7986" ST_SetValues(\n" 7987" ST_AddBand(\n" 7988" ST_MakeEmptyRaster(3, 3, 0, 0, 1, -1, 0, 0, " 7989"0),\n" 7990" 1, '8BUI', 1, 0\n" 7991" ),\n" 7992" 1, 2, 2, 2, 2, 9\n" 7993" )\n" 7994" ) AS poly\n" 7995") foo\n" 7996"ORDER BY 1, 2;\n" 7997"\n" 7998" x | y | val\n" 7999"---+---+-----\n" 8000" 1 | 1 | 1\n" 8001" 1 | 2 | 1\n" 8002" 1 | 3 | 1\n" 8003" 2 | 1 | 1\n" 8004" 2 | 2 | 9\n" 8005" 2 | 3 | 9\n" 8006" 3 | 1 | 1\n" 8007" 3 | 2 | 9\n" 8008" 3 | 3 | 9" 8009msgstr "" 8010 8011#. Tag: programlisting 8012#: reference_raster.xml:4013 8013#, no-c-format 8014msgid "" 8015"/*\n" 8016"The ST_SetValues() does the following...\n" 8017"\n" 8018"+ - + - + - + + - + - + - +\n" 8019"| 1 | 1 | 1 | | 1 | 1 | 1 |\n" 8020"+ - + - + - + + - + - + - +\n" 8021"| 1 | | 1 | => | 1 | | 9 |\n" 8022"+ - + - + - + + - + - + - +\n" 8023"| 1 | 1 | 1 | | 1 | 9 | 9 |\n" 8024"+ - + - + - + + - + - + - +\n" 8025"*/\n" 8026"SELECT\n" 8027" (poly).x,\n" 8028" (poly).y,\n" 8029" (poly).val\n" 8030"FROM (\n" 8031"SELECT\n" 8032" ST_PixelAsPolygons(\n" 8033" ST_SetValues(\n" 8034" ST_SetValue(\n" 8035" ST_AddBand(\n" 8036" ST_MakeEmptyRaster(3, 3, 0, 0, 1, " 8037"-1, 0, 0, 0),\n" 8038" 1, '8BUI', 1, 0\n" 8039" ),\n" 8040" 1, 2, 2, NULL\n" 8041" ),\n" 8042" 1, 2, 2, 2, 2, 9, TRUE\n" 8043" )\n" 8044" ) AS poly\n" 8045") foo\n" 8046"ORDER BY 1, 2;\n" 8047"\n" 8048" x | y | val\n" 8049"---+---+-----\n" 8050" 1 | 1 | 1\n" 8051" 1 | 2 | 1\n" 8052" 1 | 3 | 1\n" 8053" 2 | 1 | 1\n" 8054" 2 | 2 |\n" 8055" 2 | 3 | 9\n" 8056" 3 | 1 | 1\n" 8057" 3 | 2 | 9\n" 8058" 3 | 3 | 9" 8059msgstr "" 8060 8061#. Tag: title 8062#: reference_raster.xml:4018 8063#, no-c-format 8064msgid "Examples: Variant 5" 8065msgstr "" 8066 8067#. Tag: programlisting 8068#: reference_raster.xml:4020 8069#, no-c-format 8070msgid "" 8071"WITH foo AS (\n" 8072" SELECT 1 AS rid, ST_AddBand(ST_MakeEmptyRaster(5, 5, 0, 0, 1, -1, 0, " 8073"0, 0), 1, '8BUI', 0, 0) AS rast\n" 8074"), bar AS (\n" 8075" SELECT 1 AS gid, 'SRID=0;POINT(2.5 -2.5)'::geometry geom UNION ALL\n" 8076" SELECT 2 AS gid, 'SRID=0;POLYGON((1 -1, 4 -1, 4 -4, 1 -4, 1 -1))'::" 8077"geometry geom UNION ALL\n" 8078" SELECT 3 AS gid, 'SRID=0;POLYGON((0 0, 5 0, 5 -1, 1 -1, 1 -4, 0 -4, " 8079"0 0))'::geometry geom UNION ALL\n" 8080" SELECT 4 AS gid, 'SRID=0;MULTIPOINT(0 0, 4 4, 4 -4)'::geometry\n" 8081")\n" 8082"SELECT\n" 8083" rid, gid, ST_DumpValues(ST_SetValue(rast, 1, geom, gid))\n" 8084"FROM foo t1\n" 8085"CROSS JOIN bar t2\n" 8086"ORDER BY rid, gid;\n" 8087"\n" 8088" rid | gid | " 8089"st_dumpvalues\n" 8090"-----+-----" 8091"+---------------------------------------------------------------------------------------------------------------------------------------------\n" 8092" 1 | 1 | (1,\"{{NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL}," 8093"{NULL,NULL,1,NULL,NULL},{NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL," 8094"NULL}}\")\n" 8095" 1 | 2 | (1,\"{{NULL,NULL,NULL,NULL,NULL},{NULL,2,2,2,NULL},{NULL,2,2,2," 8096"NULL},{NULL,2,2,2,NULL},{NULL,NULL,NULL,NULL,NULL}}\")\n" 8097" 1 | 3 | (1,\"{{3,3,3,3,3},{3,NULL,NULL,NULL,NULL},{3,NULL,NULL,NULL," 8098"NULL},{3,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL}}\")\n" 8099" 1 | 4 | (1,\"{{4,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL},{NULL," 8100"NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL,4}}\")\n" 8101"(4 rows)" 8102msgstr "" 8103 8104#. Tag: para 8105#: reference_raster.xml:4022 8106#, no-c-format 8107msgid "" 8108"The following shows that geomvals later in the array can overwrite prior " 8109"geomvals" 8110msgstr "" 8111 8112#. Tag: programlisting 8113#: reference_raster.xml:4023 8114#, no-c-format 8115msgid "" 8116"WITH foo AS (\n" 8117" SELECT 1 AS rid, ST_AddBand(ST_MakeEmptyRaster(5, 5, 0, 0, 1, -1, 0, " 8118"0, 0), 1, '8BUI', 0, 0) AS rast\n" 8119"), bar AS (\n" 8120" SELECT 1 AS gid, 'SRID=0;POINT(2.5 -2.5)'::geometry geom UNION ALL\n" 8121" SELECT 2 AS gid, 'SRID=0;POLYGON((1 -1, 4 -1, 4 -4, 1 -4, 1 -1))'::" 8122"geometry geom UNION ALL\n" 8123" SELECT 3 AS gid, 'SRID=0;POLYGON((0 0, 5 0, 5 -1, 1 -1, 1 -4, 0 -4, " 8124"0 0))'::geometry geom UNION ALL\n" 8125" SELECT 4 AS gid, 'SRID=0;MULTIPOINT(0 0, 4 4, 4 -4)'::geometry\n" 8126")\n" 8127"SELECT\n" 8128" t1.rid, t2.gid, t3.gid, ST_DumpValues(ST_SetValues(rast, 1, " 8129"ARRAY[ROW(t2.geom, t2.gid), ROW(t3.geom, t3.gid)]::geomval[]))\n" 8130"FROM foo t1\n" 8131"CROSS JOIN bar t2\n" 8132"CROSS JOIN bar t3\n" 8133"WHERE t2.gid = 1\n" 8134" AND t3.gid = 2\n" 8135"ORDER BY t1.rid, t2.gid, t3.gid;\n" 8136"\n" 8137" rid | gid | gid | " 8138"st_dumpvalues\n" 8139"-----+-----+-----" 8140"+---------------------------------------------------------------------------------------------------------------------\n" 8141" 1 | 1 | 2 | (1,\"{{NULL,NULL,NULL,NULL,NULL},{NULL,2,2,2,NULL}," 8142"{NULL,2,2,2,NULL},{NULL,2,2,2,NULL},{NULL,NULL,NULL,NULL,NULL}}\")\n" 8143"(1 row)" 8144msgstr "" 8145 8146#. Tag: para 8147#: reference_raster.xml:4025 8148#, no-c-format 8149msgid "This example is the opposite of the prior example" 8150msgstr "" 8151 8152#. Tag: programlisting 8153#: reference_raster.xml:4026 8154#, no-c-format 8155msgid "" 8156"WITH foo AS (\n" 8157" SELECT 1 AS rid, ST_AddBand(ST_MakeEmptyRaster(5, 5, 0, 0, 1, -1, 0, " 8158"0, 0), 1, '8BUI', 0, 0) AS rast\n" 8159"), bar AS (\n" 8160" SELECT 1 AS gid, 'SRID=0;POINT(2.5 -2.5)'::geometry geom UNION ALL\n" 8161" SELECT 2 AS gid, 'SRID=0;POLYGON((1 -1, 4 -1, 4 -4, 1 -4, 1 -1))'::" 8162"geometry geom UNION ALL\n" 8163" SELECT 3 AS gid, 'SRID=0;POLYGON((0 0, 5 0, 5 -1, 1 -1, 1 -4, 0 -4, " 8164"0 0))'::geometry geom UNION ALL\n" 8165" SELECT 4 AS gid, 'SRID=0;MULTIPOINT(0 0, 4 4, 4 -4)'::geometry\n" 8166")\n" 8167"SELECT\n" 8168" t1.rid, t2.gid, t3.gid, ST_DumpValues(ST_SetValues(rast, 1, " 8169"ARRAY[ROW(t2.geom, t2.gid), ROW(t3.geom, t3.gid)]::geomval[]))\n" 8170"FROM foo t1\n" 8171"CROSS JOIN bar t2\n" 8172"CROSS JOIN bar t3\n" 8173"WHERE t2.gid = 2\n" 8174" AND t3.gid = 1\n" 8175"ORDER BY t1.rid, t2.gid, t3.gid;\n" 8176"\n" 8177" rid | gid | gid | " 8178"st_dumpvalues\n" 8179"-----+-----+-----" 8180"+---------------------------------------------------------------------------------------------------------------------\n" 8181" 1 | 2 | 1 | (1,\"{{NULL,NULL,NULL,NULL,NULL},{NULL,2,2,2,NULL}," 8182"{NULL,2,1,2,NULL},{NULL,2,2,2,NULL},{NULL,NULL,NULL,NULL,NULL}}\")\n" 8183"(1 row)" 8184msgstr "" 8185 8186#. Tag: para 8187#: reference_raster.xml:4033 8188#, no-c-format 8189msgid "" 8190", <xref linkend=\"RT_ST_SetValue\"/>, <xref linkend=\"RT_ST_PixelAsPolygons" 8191"\"/>" 8192msgstr "" 8193", <xref linkend=\"RT_ST_SetValue\"/>, <xref linkend=\"RT_ST_PixelAsPolygons" 8194"\"/>" 8195 8196#. Tag: refname 8197#: reference_raster.xml:4043 8198#, no-c-format 8199msgid "ST_DumpValues" 8200msgstr "" 8201 8202#. Tag: refpurpose 8203#: reference_raster.xml:4044 8204#, no-c-format 8205msgid "Get the values of the specified band as a 2-dimension array." 8206msgstr "" 8207 8208#. Tag: funcsynopsis 8209#: reference_raster.xml:4050 8210#, no-c-format 8211msgid "" 8212"<funcprototype> <funcdef>setof record <function>ST_DumpValues</function></" 8213"funcdef> <paramdef> <type>raster </type> <parameter>rast</parameter> </" 8214"paramdef> <paramdef> <type>integer[] </type> <parameter>nband=NULL</" 8215"parameter> </paramdef> <paramdef> <type>boolean </type> " 8216"<parameter>exclude_nodata_value=true</parameter> </paramdef> </" 8217"funcprototype> <funcprototype> <funcdef>double precision[][] " 8218"<function>ST_DumpValues</function></funcdef> <paramdef> <type>raster </type> " 8219"<parameter>rast</parameter> </paramdef> <paramdef> <type>integer </type> " 8220"<parameter>nband</parameter> </paramdef> <paramdef> <type>boolean </type> " 8221"<parameter>exclude_nodata_value=true</parameter> </paramdef> </funcprototype>" 8222msgstr "" 8223 8224#. Tag: para 8225#: reference_raster.xml:4081 8226#, no-c-format 8227msgid "" 8228"Get the values of the specified band as a 2-dimension array (first index is " 8229"row, second is column). If <varname>nband</varname> is NULL or not provided, " 8230"all raster bands are processed." 8231msgstr "" 8232 8233#. Tag: programlisting 8234#: reference_raster.xml:4091 8235#, no-c-format 8236msgid "" 8237"WITH foo AS (\n" 8238" SELECT ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, " 8239"0, 1, -1, 0, 0, 0), 1, '8BUI'::text, 1, 0), 2, '32BF'::text, 3, -9999), 3, " 8240"'16BSI', 0, 0) AS rast\n" 8241")\n" 8242"SELECT\n" 8243" (ST_DumpValues(rast)).*\n" 8244"FROM foo;\n" 8245"\n" 8246" nband | valarray\n" 8247"-------+------------------------------------------------------\n" 8248" 1 | {{1,1,1},{1,1,1},{1,1,1}}\n" 8249" 2 | {{3,3,3},{3,3,3},{3,3,3}}\n" 8250" 3 | {{NULL,NULL,NULL},{NULL,NULL,NULL},{NULL,NULL,NULL}}\n" 8251"(3 rows)" 8252msgstr "" 8253 8254#. Tag: programlisting 8255#: reference_raster.xml:4093 8256#, no-c-format 8257msgid "" 8258"WITH foo AS (\n" 8259" SELECT ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, " 8260"0, 1, -1, 0, 0, 0), 1, '8BUI'::text, 1, 0), 2, '32BF'::text, 3, -9999), 3, " 8261"'16BSI', 0, 0) AS rast\n" 8262")\n" 8263"SELECT\n" 8264" (ST_DumpValues(rast, ARRAY[3, 1])).*\n" 8265"FROM foo;\n" 8266"\n" 8267" nband | valarray\n" 8268"-------+------------------------------------------------------\n" 8269" 3 | {{NULL,NULL,NULL},{NULL,NULL,NULL},{NULL,NULL,NULL}}\n" 8270" 1 | {{1,1,1},{1,1,1},{1,1,1}}\n" 8271"(2 rows)" 8272msgstr "" 8273 8274#. Tag: programlisting 8275#: reference_raster.xml:4094 8276#, no-c-format 8277msgid "" 8278"WITH foo AS (\n" 8279" SELECT ST_SetValue(ST_AddBand(ST_MakeEmptyRaster(3, 3, 0, 0, 1, -1, " 8280"0, 0, 0), 1, '8BUI', 1, 0), 1, 2, 5) AS rast\n" 8281")\n" 8282"SELECT\n" 8283" (ST_DumpValues(rast, 1))[2][1]\n" 8284"FROM foo;\n" 8285"\n" 8286" st_dumpvalues\n" 8287"---------------\n" 8288" 5\n" 8289"(1 row)" 8290msgstr "" 8291 8292#. Tag: para 8293#: reference_raster.xml:4099 8294#, no-c-format 8295msgid "" 8296", <xref linkend=\"RT_ST_SetValue\"/>, <xref linkend=\"RT_ST_SetValues\"/>" 8297msgstr "" 8298 8299#. Tag: refname 8300#: reference_raster.xml:4110 8301#, no-c-format 8302msgid "ST_PixelOfValue" 8303msgstr "ST_PixelOfValue" 8304 8305#. Tag: refpurpose 8306#: reference_raster.xml:4111 8307#, no-c-format 8308msgid "" 8309"Get the columnx, rowy coordinates of the pixel whose value equals the search " 8310"value." 8311msgstr "" 8312 8313#. Tag: funcsynopsis 8314#: reference_raster.xml:4117 8315#, no-c-format 8316msgid "" 8317"<funcprototype> <funcdef>setof record <function>ST_PixelOfValue</function></" 8318"funcdef> <paramdef> <type>raster </type> <parameter>rast</parameter> </" 8319"paramdef> <paramdef> <type>integer </type> <parameter>nband</parameter> </" 8320"paramdef> <paramdef> <type>double precision[] </type> <parameter>search</" 8321"parameter> </paramdef> <paramdef> <type>boolean </type> " 8322"<parameter>exclude_nodata_value=true</parameter> </paramdef> </" 8323"funcprototype> <funcprototype> <funcdef>setof record " 8324"<function>ST_PixelOfValue</function></funcdef> <paramdef> <type>raster </" 8325"type> <parameter>rast</parameter> </paramdef> <paramdef> <type>double " 8326"precision[] </type> <parameter>search</parameter> </paramdef> <paramdef> " 8327"<type>boolean </type> <parameter>exclude_nodata_value=true</parameter> </" 8328"paramdef> </funcprototype> <funcprototype> <funcdef>setof record " 8329"<function>ST_PixelOfValue</function></funcdef> <paramdef> <type>raster </" 8330"type> <parameter>rast</parameter> </paramdef> <paramdef> <type>integer </" 8331"type> <parameter>nband</parameter> </paramdef> <paramdef> <type>double " 8332"precision </type> <parameter>search</parameter> </paramdef> <paramdef> " 8333"<type>boolean </type> <parameter>exclude_nodata_value=true</parameter> </" 8334"paramdef> </funcprototype> <funcprototype> <funcdef>setof record " 8335"<function>ST_PixelOfValue</function></funcdef> <paramdef> <type>raster </" 8336"type> <parameter>rast</parameter> </paramdef> <paramdef> <type>double " 8337"precision </type> <parameter>search</parameter> </paramdef> <paramdef> " 8338"<type>boolean </type> <parameter>exclude_nodata_value=true</parameter> </" 8339"paramdef> </funcprototype>" 8340msgstr "" 8341"<funcprototype> <funcdef>setof record <function>ST_PixelOfValue</function></" 8342"funcdef> <paramdef> <type>raster </type> <parameter>rast</parameter> </" 8343"paramdef> <paramdef> <type>integer </type> <parameter>nband</parameter> </" 8344"paramdef> <paramdef> <type>double precision[] </type> <parameter>search</" 8345"parameter> </paramdef> <paramdef> <type>boolean </type> " 8346"<parameter>exclude_nodata_value=true</parameter> </paramdef> </" 8347"funcprototype> <funcprototype> <funcdef>setof record " 8348"<function>ST_PixelOfValue</function></funcdef> <paramdef> <type>raster </" 8349"type> <parameter>rast</parameter> </paramdef> <paramdef> <type>double " 8350"precision[] </type> <parameter>search</parameter> </paramdef> <paramdef> " 8351"<type>boolean </type> <parameter>exclude_nodata_value=true</parameter> </" 8352"paramdef> </funcprototype> <funcprototype> <funcdef>setof record " 8353"<function>ST_PixelOfValue</function></funcdef> <paramdef> <type>raster </" 8354"type> <parameter>rast</parameter> </paramdef> <paramdef> <type>integer </" 8355"type> <parameter>nband</parameter> </paramdef> <paramdef> <type>double " 8356"precision </type> <parameter>search</parameter> </paramdef> <paramdef> " 8357"<type>boolean </type> <parameter>exclude_nodata_value=true</parameter> </" 8358"paramdef> </funcprototype> <funcprototype> <funcdef>setof record " 8359"<function>ST_PixelOfValue</function></funcdef> <paramdef> <type>raster </" 8360"type> <parameter>rast</parameter> </paramdef> <paramdef> <type>double " 8361"precision </type> <parameter>search</parameter> </paramdef> <paramdef> " 8362"<type>boolean </type> <parameter>exclude_nodata_value=true</parameter> </" 8363"paramdef> </funcprototype>" 8364 8365#. Tag: para 8366#: reference_raster.xml:4178 8367#, no-c-format 8368msgid "" 8369"Get the columnx, rowy coordinates of the pixel whose value equals the search " 8370"value. If no band is specified, then band 1 is assumed." 8371msgstr "" 8372 8373#. Tag: programlisting 8374#: reference_raster.xml:4187 8375#, no-c-format 8376msgid "" 8377"SELECT\n" 8378" (pixels).*\n" 8379"FROM (\n" 8380" SELECT\n" 8381" ST_PixelOfValue(\n" 8382" ST_SetValue(\n" 8383" ST_SetValue(\n" 8384" ST_SetValue(\n" 8385" ST_SetValue(\n" 8386" ST_SetValue(\n" 8387" ST_AddBand(\n" 8388" ST_MakeEmptyRaster(5, " 8389"5, -2, 2, 1, -1, 0, 0, 0),\n" 8390" '8BUI'::" 8391"text, 1, 0\n" 8392" ),\n" 8393" 1, 1, 0\n" 8394" ),\n" 8395" 2, 3, 0\n" 8396" ),\n" 8397" 3, 5, 0\n" 8398" ),\n" 8399" 4, 2, 0\n" 8400" ),\n" 8401" 5, 4, 255\n" 8402" )\n" 8403" , 1, ARRAY[1, 255]) AS pixels\n" 8404") AS foo\n" 8405"\n" 8406" val | x | y\n" 8407"-----+---+---\n" 8408" 1 | 1 | 2\n" 8409" 1 | 1 | 3\n" 8410" 1 | 1 | 4\n" 8411" 1 | 1 | 5\n" 8412" 1 | 2 | 1\n" 8413" 1 | 2 | 2\n" 8414" 1 | 2 | 4\n" 8415" 1 | 2 | 5\n" 8416" 1 | 3 | 1\n" 8417" 1 | 3 | 2\n" 8418" 1 | 3 | 3\n" 8419" 1 | 3 | 4\n" 8420" 1 | 4 | 1\n" 8421" 1 | 4 | 3\n" 8422" 1 | 4 | 4\n" 8423" 1 | 4 | 5\n" 8424" 1 | 5 | 1\n" 8425" 1 | 5 | 2\n" 8426" 1 | 5 | 3\n" 8427" 255 | 5 | 4\n" 8428" 1 | 5 | 5" 8429msgstr "" 8430 8431#. Tag: title 8432#: reference_raster.xml:4195 8433#, no-c-format 8434msgid "Raster Editors" 8435msgstr "" 8436 8437#. Tag: refname 8438#: reference_raster.xml:4199 8439#, no-c-format 8440msgid "ST_SetGeoReference" 8441msgstr "ST_SetGeoReference" 8442 8443#. Tag: refpurpose 8444#: reference_raster.xml:4200 8445#, no-c-format 8446msgid "" 8447"Set Georeference 6 georeference parameters in a single call. Numbers should " 8448"be separated by white space. Accepts inputs in GDAL or ESRI format. Default " 8449"is GDAL." 8450msgstr "" 8451 8452#. Tag: funcsynopsis 8453#: reference_raster.xml:4204 8454#, no-c-format 8455msgid "" 8456"<funcprototype> <funcdef>raster <function>ST_SetGeoReference</function></" 8457"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 8458"paramdef> <paramdef><type>text </type> <parameter>georefcoords</parameter></" 8459"paramdef> <paramdef choice=\"opt\"><type>text </type> " 8460"<parameter>format=GDAL</parameter></paramdef> </funcprototype> " 8461"<funcprototype> <funcdef>raster <function>ST_SetGeoReference</function></" 8462"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 8463"paramdef> <paramdef><type>double precision </type> <parameter>upperleftx</" 8464"parameter></paramdef> <paramdef><type>double precision </type> " 8465"<parameter>upperlefty</parameter></paramdef> <paramdef><type>double " 8466"precision </type> <parameter>scalex</parameter></paramdef> " 8467"<paramdef><type>double precision </type> <parameter>scaley</parameter></" 8468"paramdef> <paramdef><type>double precision </type> <parameter>skewx</" 8469"parameter></paramdef> <paramdef><type>double precision </type> " 8470"<parameter>skewy</parameter></paramdef> </funcprototype>" 8471msgstr "" 8472 8473#. Tag: para 8474#: reference_raster.xml:4230 8475#, no-c-format 8476msgid "" 8477"Set Georeference 6 georeference parameters in a single call. Accepts inputs " 8478"in 'GDAL' or 'ESRI' format. Default is GDAL. If 6 coordinates are not " 8479"provided will return null." 8480msgstr "" 8481 8482#. Tag: programlisting 8483#: reference_raster.xml:4233 8484#, no-c-format 8485msgid "scalex skewy skewx scaley upperleftx upperlefty" 8486msgstr "scalex skewy skewx scaley upperleftx upperlefty" 8487 8488#. Tag: programlisting 8489#: reference_raster.xml:4235 8490#, no-c-format 8491msgid "" 8492"scalex skewy skewx scaley upperleftx + scalex*0.5 upperlefty + scaley*0.5" 8493msgstr "" 8494"scalex skewy skewx scaley upperleftx + scalex*0.5 upperlefty + scaley*0.5" 8495 8496#. Tag: para 8497#: reference_raster.xml:4238 8498#, no-c-format 8499msgid "" 8500"If the raster has out-db bands, changing the georeference may result in " 8501"incorrect access of the band's externally stored data." 8502msgstr "" 8503 8504#. Tag: para 8505#: reference_raster.xml:4243 8506#, no-c-format 8507msgid "" 8508"Enhanced: 2.1.0 Addition of ST_SetGeoReference(raster, double " 8509"precision, ...) variant" 8510msgstr "" 8511 8512#. Tag: programlisting 8513#: reference_raster.xml:4250 8514#, no-c-format 8515msgid "" 8516"WITH foo AS (\n" 8517" SELECT ST_MakeEmptyRaster(5, 5, 0, 0, 1, -1, 0, 0, 0) AS rast\n" 8518")\n" 8519"SELECT\n" 8520" 0 AS rid, (ST_Metadata(rast)).*\n" 8521"FROM foo\n" 8522"UNION ALL\n" 8523"SELECT\n" 8524" 1, (ST_Metadata(ST_SetGeoReference(rast, '10 0 0 -10 0.1 0.1', " 8525"'GDAL'))).*\n" 8526"FROM foo\n" 8527"UNION ALL\n" 8528"SELECT\n" 8529" 2, (ST_Metadata(ST_SetGeoReference(rast, '10 0 0 -10 5.1 -4.9', " 8530"'ESRI'))).*\n" 8531"FROM foo\n" 8532"UNION ALL\n" 8533"SELECT\n" 8534" 3, (ST_Metadata(ST_SetGeoReference(rast, 1, 1, 10, -10, 0.001, " 8535"0.001))).*\n" 8536"FROM foo\n" 8537"\n" 8538" rid | upperleftx | upperlefty | width | height | scalex | " 8539"scaley | skewx | skewy | srid | numbands\n" 8540"-----+--------------------+--------------------+-------+--------+--------" 8541"+--------+-------+-------+------+----------\n" 8542" 0 | 0 | 0 | 5 | 5 | 1 " 8543"| -1 | 0 | 0 | 0 | 0\n" 8544" 1 | 0.1 | 0.1 | 5 | 5 | 10 " 8545"| -10 | 0 | 0 | 0 | 0\n" 8546" 2 | 0.0999999999999996 | 0.0999999999999996 | 5 | 5 | 10 " 8547"| -10 | 0 | 0 | 0 | 0\n" 8548" 3 | 1 | 1 | 5 | 5 | 10 " 8549"| -10 | 0.001 | 0.001 | 0 | 0" 8550msgstr "" 8551 8552#. Tag: para 8553#: reference_raster.xml:4255 8554#, no-c-format 8555msgid "" 8556", <xref linkend=\"RT_ST_ScaleX\"/>, <xref linkend=\"RT_ST_ScaleY\"/>, <xref " 8557"linkend=\"RT_ST_UpperLeftX\"/>, <xref linkend=\"RT_ST_UpperLeftY\"/>" 8558msgstr "" 8559", <xref linkend=\"RT_ST_ScaleX\"/>, <xref linkend=\"RT_ST_ScaleY\"/>, <xref " 8560"linkend=\"RT_ST_UpperLeftX\"/>, <xref linkend=\"RT_ST_UpperLeftY\"/>" 8561 8562#. Tag: refname 8563#: reference_raster.xml:4261 8564#, no-c-format 8565msgid "ST_SetRotation" 8566msgstr "ST_SetRotation" 8567 8568#. Tag: refpurpose 8569#: reference_raster.xml:4262 8570#, no-c-format 8571msgid "Set the rotation of the raster in radian." 8572msgstr "" 8573 8574#. Tag: funcprototype 8575#: reference_raster.xml:4267 8576#, no-c-format 8577msgid "" 8578"<funcdef>float8 <function>ST_SetRotation</function></funcdef> " 8579"<paramdef><type>raster</type> <parameter>rast</parameter></paramdef> " 8580"<paramdef><type>float8</type> <parameter>rotation</parameter></paramdef>" 8581msgstr "" 8582"<funcdef>float8 <function>ST_SetRotation</function></funcdef> " 8583"<paramdef><type>raster</type> <parameter>rast</parameter></paramdef> " 8584"<paramdef><type>float8</type> <parameter>rotation</parameter></paramdef>" 8585 8586#. Tag: para 8587#: reference_raster.xml:4278 8588#, no-c-format 8589msgid "" 8590"Uniformly rotate the raster. Rotation is in radian. Refer to <ulink url=" 8591"\"http://en.wikipedia.org/wiki/World_file\">World File</ulink> for more " 8592"details." 8593msgstr "" 8594 8595#. Tag: programlisting 8596#: reference_raster.xml:4284 8597#, fuzzy, no-c-format 8598msgid "" 8599"SELECT\n" 8600" ST_ScaleX(rast1), ST_ScaleY(rast1), ST_SkewX(rast1), ST_SkewY(rast1),\n" 8601" ST_ScaleX(rast2), ST_ScaleY(rast2), ST_SkewX(rast2), ST_SkewY(rast2)\n" 8602"FROM (\n" 8603" SELECT ST_SetRotation(rast, 15) AS rast1, rast as rast2 FROM dummy_rast\n" 8604") AS foo;\n" 8605" st_scalex | st_scaley | st_skewx | " 8606"st_skewy | st_scalex | st_scaley | st_skewx | st_skewy\n" 8607"---------------------+---------------------+--------------------" 8608"+--------------------+-----------+-----------+----------+----------\n" 8609" -1.51937582571764 | -2.27906373857646 | 1.95086352047135 | " 8610"1.30057568031423 | 2 | 3 | 0 | 0\n" 8611" -0.0379843956429411 | -0.0379843956429411 | 0.0325143920078558 | " 8612"0.0325143920078558 | 0.05 | -0.05 | 0 | 0" 8613msgstr "" 8614"SELECT \n" 8615" ST_ScaleX(rast1), ST_ScaleY(rast1), ST_SkewX(rast1), ST_SkewY(rast1),\n" 8616" ST_ScaleX(rast2), ST_ScaleY(rast2), ST_SkewX(rast2), ST_SkewY(rast2) \n" 8617"FROM (\n" 8618" SELECT ST_SetRotation(rast, 15) AS rast1, rast as rast2 FROM dummy_rast\n" 8619") AS foo;\n" 8620" st_scalex | st_scaley | st_skewx | " 8621"st_skewy | st_scalex | st_scaley | st_skewx | st_skewy\n" 8622"---------------------+---------------------+--------------------" 8623"+--------------------+-----------+-----------+----------+----------\n" 8624" -1.51937582571764 | -2.27906373857646 | 1.95086352047135 | " 8625"1.30057568031423 | 2 | 3 | 0 | 0\n" 8626" -0.0379843956429411 | -0.0379843956429411 | 0.0325143920078558 | " 8627"0.0325143920078558 | 0.05 | -0.05 | 0 | 0" 8628 8629#. Tag: refname 8630#: reference_raster.xml:4297 8631#, no-c-format 8632msgid "ST_SetScale" 8633msgstr "ST_SetScale" 8634 8635#. Tag: refpurpose 8636#: reference_raster.xml:4298 8637#, no-c-format 8638msgid "" 8639"Sets the X and Y size of pixels in units of coordinate reference system. " 8640"Number units/pixel width/height." 8641msgstr "" 8642 8643#. Tag: funcsynopsis 8644#: reference_raster.xml:4302 8645#, no-c-format 8646msgid "" 8647"<funcprototype> <funcdef>raster <function>ST_SetScale</function></funcdef> " 8648"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 8649"<paramdef><type>float8 </type> <parameter>xy</parameter></paramdef> </" 8650"funcprototype> <funcprototype> <funcdef>raster <function>ST_SetScale</" 8651"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 8652"parameter></paramdef> <paramdef><type>float8 </type> <parameter>x</" 8653"parameter></paramdef> <paramdef><type>float8 </type> <parameter>y</" 8654"parameter></paramdef> </funcprototype>" 8655msgstr "" 8656"<funcprototype> <funcdef>raster <function>ST_SetScale</function></funcdef> " 8657"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 8658"<paramdef><type>float8 </type> <parameter>xy</parameter></paramdef> </" 8659"funcprototype> <funcprototype> <funcdef>raster <function>ST_SetScale</" 8660"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 8661"parameter></paramdef> <paramdef><type>float8 </type> <parameter>x</" 8662"parameter></paramdef> <paramdef><type>float8 </type> <parameter>y</" 8663"parameter></paramdef> </funcprototype>" 8664 8665#. Tag: para 8666#: reference_raster.xml:4321 8667#, no-c-format 8668msgid "" 8669"Sets the X and Y size of pixels in units of coordinate reference system. " 8670"Number units/pixel width/height. If only one unit passed in, assumed X and Y " 8671"are the same number." 8672msgstr "" 8673 8674#. Tag: para 8675#: reference_raster.xml:4324 8676#, no-c-format 8677msgid "" 8678"ST_SetScale is different from <xref linkend=\"RT_ST_Rescale\"/> in that " 8679"ST_SetScale do not resample the raster to match the raster extent. It only " 8680"changes the metadata (or georeference) of the raster to correct an " 8681"originally mis-specified scaling. ST_Rescale results in a raster having " 8682"different width and height computed to fit the geographic extent of the " 8683"input raster. ST_SetScale do not modify the width, nor the height of the " 8684"raster." 8685msgstr "" 8686 8687#. Tag: para 8688#: reference_raster.xml:4326 8689#, no-c-format 8690msgid "" 8691"Changed: 2.0.0 In WKTRaster versions this was called ST_SetPixelSize. This " 8692"was changed in 2.0.0." 8693msgstr "" 8694"Changed: 2.0.0 In WKTRaster versions this was called ST_SetPixelSize. This " 8695"was changed in 2.0.0." 8696 8697#. Tag: programlisting 8698#: reference_raster.xml:4332 8699#, fuzzy, no-c-format 8700msgid "" 8701"UPDATE dummy_rast\n" 8702" SET rast = ST_SetScale(rast, 1.5)\n" 8703"WHERE rid = 2;\n" 8704"\n" 8705"SELECT ST_ScaleX(rast) As pixx, ST_ScaleY(rast) As pixy, Box3D(rast) As " 8706"newbox\n" 8707"FROM dummy_rast\n" 8708"WHERE rid = 2;\n" 8709"\n" 8710" pixx | pixy | newbox\n" 8711"------+------+----------------------------------------------\n" 8712" 1.5 | 1.5 | BOX(3427927.75 5793244 0, 3427935.25 5793251.5 0)" 8713msgstr "" 8714"UPDATE dummy_rast \n" 8715" SET rast = ST_SetScale(rast, 1.5)\n" 8716"WHERE rid = 2;\n" 8717"\n" 8718"SELECT ST_ScaleX(rast) As pixx, ST_ScaleY(rast) As pixy, Box3D(rast) As " 8719"newbox\n" 8720"FROM dummy_rast\n" 8721"WHERE rid = 2;\n" 8722"\n" 8723" pixx | pixy | newbox\n" 8724"------+------+----------------------------------------------\n" 8725" 1.5 | 1.5 | BOX(3427927.75 5793244 0, 3427935.25 5793251.5 0)" 8726 8727#. Tag: programlisting 8728#: reference_raster.xml:4333 8729#, fuzzy, no-c-format 8730msgid "" 8731"UPDATE dummy_rast\n" 8732" SET rast = ST_SetScale(rast, 1.5, 0.55)\n" 8733"WHERE rid = 2;\n" 8734"\n" 8735"SELECT ST_ScaleX(rast) As pixx, ST_ScaleY(rast) As pixy, Box3D(rast) As " 8736"newbox\n" 8737"FROM dummy_rast\n" 8738"WHERE rid = 2;\n" 8739"\n" 8740" pixx | pixy | newbox\n" 8741"------+------+--------------------------------------------\n" 8742" 1.5 | 0.55 | BOX(3427927.75 5793244 0,3427935.25 5793247 0)" 8743msgstr "" 8744"UPDATE dummy_rast \n" 8745" SET rast = ST_SetScale(rast, 1.5, 0.55)\n" 8746"WHERE rid = 2;\n" 8747"\n" 8748"SELECT ST_ScaleX(rast) As pixx, ST_ScaleY(rast) As pixy, Box3D(rast) As " 8749"newbox\n" 8750"FROM dummy_rast\n" 8751"WHERE rid = 2;\n" 8752"\n" 8753" pixx | pixy | newbox\n" 8754"------+------+--------------------------------------------\n" 8755" 1.5 | 0.55 | BOX(3427927.75 5793244 0,3427935.25 5793247 0)" 8756 8757#. Tag: para 8758#: reference_raster.xml:4339 8759#, no-c-format 8760msgid ", <xref linkend=\"RT_ST_ScaleY\"/>, <xref linkend=\"RT_Box3D\"/>" 8761msgstr ", <xref linkend=\"RT_ST_ScaleY\"/>, <xref linkend=\"RT_Box3D\"/>" 8762 8763#. Tag: refname 8764#: reference_raster.xml:4345 8765#, no-c-format 8766msgid "ST_SetSkew" 8767msgstr "ST_SetSkew" 8768 8769#. Tag: refpurpose 8770#: reference_raster.xml:4346 8771#, no-c-format 8772msgid "" 8773"Sets the georeference X and Y skew (or rotation parameter). If only one is " 8774"passed in, sets X and Y to the same value." 8775msgstr "" 8776 8777#. Tag: funcsynopsis 8778#: reference_raster.xml:4350 8779#, no-c-format 8780msgid "" 8781"<funcprototype> <funcdef>raster <function>ST_SetSkew</function></funcdef> " 8782"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 8783"<paramdef><type>float8 </type> <parameter>skewxy</parameter></paramdef> </" 8784"funcprototype> <funcprototype> <funcdef>raster <function>ST_SetSkew</" 8785"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 8786"parameter></paramdef> <paramdef><type>float8 </type> <parameter>skewx</" 8787"parameter></paramdef> <paramdef><type>float8 </type> <parameter>skewy</" 8788"parameter></paramdef> </funcprototype>" 8789msgstr "" 8790 8791#. Tag: para 8792#: reference_raster.xml:4368 8793#, no-c-format 8794msgid "" 8795"Sets the georeference X and Y skew (or rotation parameter). If only one is " 8796"passed in, sets X and Y to the same value. Refer to <ulink url=\"http://en." 8797"wikipedia.org/wiki/World_file\">World File</ulink> for more details." 8798msgstr "" 8799 8800#. Tag: programlisting 8801#: reference_raster.xml:4375 8802#, fuzzy, no-c-format 8803msgid "" 8804"-- Example 1\n" 8805"UPDATE dummy_rast SET rast = ST_SetSkew(rast,1,2) WHERE rid = 1;\n" 8806"SELECT rid, ST_SkewX(rast) As skewx, ST_SkewY(rast) As skewy,\n" 8807" ST_GeoReference(rast) as georef\n" 8808"FROM dummy_rast WHERE rid = 1;\n" 8809"\n" 8810"rid | skewx | skewy | georef\n" 8811"----+-------+-------+--------------\n" 8812" 1 | 1 | 2 | 2.0000000000\n" 8813" : 2.0000000000\n" 8814" : 1.0000000000\n" 8815" : 3.0000000000\n" 8816" : 0.5000000000\n" 8817" : 0.5000000000" 8818msgstr "" 8819"SELECT rid, ST_SkewX(rast) As skewx, ST_SkewY(rast) As skewy, \n" 8820" ST_GeoReference(rast) as georef\n" 8821"FROM dummy_rast;\n" 8822"\n" 8823" rid | skewx | skewy | georef\n" 8824"-----+-------+-------+--------------------\n" 8825" 1 | 0 | 0 | 2.0000000000\n" 8826" : 0.0000000000\n" 8827" : 0.0000000000\n" 8828" : 3.0000000000\n" 8829" : 0.5000000000\n" 8830" : 0.5000000000\n" 8831" :\n" 8832" 2 | 0 | 0 | 0.0500000000\n" 8833" : 0.0000000000\n" 8834" : 0.0000000000\n" 8835" : -0.0500000000\n" 8836" : 3427927.7500000000\n" 8837" : 5793244.0000000000" 8838 8839#. Tag: programlisting 8840#: reference_raster.xml:4377 8841#, fuzzy, no-c-format 8842msgid "" 8843"-- Example 2 set both to same number:\n" 8844"UPDATE dummy_rast SET rast = ST_SetSkew(rast,0) WHERE rid = 1;\n" 8845"SELECT rid, ST_SkewX(rast) As skewx, ST_SkewY(rast) As skewy,\n" 8846" ST_GeoReference(rast) as georef\n" 8847"FROM dummy_rast WHERE rid = 1;\n" 8848"\n" 8849" rid | skewx | skewy | georef\n" 8850"-----+-------+-------+--------------\n" 8851" 1 | 0 | 0 | 2.0000000000\n" 8852" : 0.0000000000\n" 8853" : 0.0000000000\n" 8854" : 3.0000000000\n" 8855" : 0.5000000000\n" 8856" : 0.5000000000" 8857msgstr "" 8858"SELECT rid, ST_SkewX(rast) As skewx, ST_SkewY(rast) As skewy, \n" 8859" ST_GeoReference(rast) as georef\n" 8860"FROM dummy_rast;\n" 8861"\n" 8862" rid | skewx | skewy | georef\n" 8863"-----+-------+-------+--------------------\n" 8864" 1 | 0 | 0 | 2.0000000000\n" 8865" : 0.0000000000\n" 8866" : 0.0000000000\n" 8867" : 3.0000000000\n" 8868" : 0.5000000000\n" 8869" : 0.5000000000\n" 8870" :\n" 8871" 2 | 0 | 0 | 0.0500000000\n" 8872" : 0.0000000000\n" 8873" : 0.0000000000\n" 8874" : -0.0500000000\n" 8875" : 3427927.7500000000\n" 8876" : 5793244.0000000000" 8877 8878#. Tag: para 8879#: reference_raster.xml:4384 8880#, no-c-format 8881msgid "" 8882", <xref linkend=\"RT_ST_SetGeoReference\"/>, <xref linkend=\"RT_ST_SkewX\"/" 8883">, <xref linkend=\"RT_ST_SkewY\"/>" 8884msgstr "" 8885", <xref linkend=\"RT_ST_SetGeoReference\"/>, <xref linkend=\"RT_ST_SkewX\"/" 8886">, <xref linkend=\"RT_ST_SkewY\"/>" 8887 8888#. Tag: refname 8889#: reference_raster.xml:4390 8890#, no-c-format 8891msgid "ST_SetSRID" 8892msgstr "ST_SetSRID" 8893 8894#. Tag: refpurpose 8895#: reference_raster.xml:4392 8896#, no-c-format 8897msgid "" 8898"Sets the SRID of a raster to a particular integer srid defined in the " 8899"spatial_ref_sys table." 8900msgstr "" 8901 8902#. Tag: funcprototype 8903#: reference_raster.xml:4397 8904#, no-c-format 8905msgid "" 8906"<funcdef>raster <function>ST_SetSRID</function></funcdef> " 8907"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 8908"<paramdef><type>integer </type> <parameter>srid</parameter></paramdef>" 8909msgstr "" 8910"<funcdef>raster <function>ST_SetSRID</function></funcdef> " 8911"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 8912"<paramdef><type>integer </type> <parameter>srid</parameter></paramdef>" 8913 8914#. Tag: para 8915#: reference_raster.xml:4412 8916#, no-c-format 8917msgid "Sets the SRID on a raster to a particular integer value." 8918msgstr "" 8919 8920#. Tag: para 8921#: reference_raster.xml:4415 8922#, no-c-format 8923msgid "" 8924"This function does not transform the raster in any way - it simply sets meta " 8925"data defining the spatial ref of the coordinate reference system that it's " 8926"currently in. Useful for transformations later." 8927msgstr "" 8928 8929#. Tag: para 8930#: reference_raster.xml:4425 8931#, no-c-format 8932msgid ", <xref linkend=\"RT_ST_SRID\"/>" 8933msgstr ", <xref linkend=\"RT_ST_SRID\"/>" 8934 8935#. Tag: refname 8936#: reference_raster.xml:4432 8937#, no-c-format 8938msgid "ST_SetUpperLeft" 8939msgstr "ST_SetUpperLeft" 8940 8941#. Tag: refpurpose 8942#: reference_raster.xml:4433 8943#, no-c-format 8944msgid "" 8945"Sets the value of the upper left corner of the pixel of the raster to " 8946"projected X and Y coordinates." 8947msgstr "" 8948 8949#. Tag: funcprototype 8950#: reference_raster.xml:4438 8951#, no-c-format 8952msgid "" 8953"<funcdef>raster <function>ST_SetUpperLeft</function></funcdef> " 8954"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 8955"<paramdef><type>double precision </type> <parameter>x</parameter></paramdef> " 8956"<paramdef><type>double precision </type> <parameter>y</parameter></paramdef>" 8957msgstr "" 8958"<funcdef>raster <function>ST_SetUpperLeft</function></funcdef> " 8959"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 8960"<paramdef><type>double precision </type> <parameter>x</parameter></paramdef> " 8961"<paramdef><type>double precision </type> <parameter>y</parameter></paramdef>" 8962 8963#. Tag: para 8964#: reference_raster.xml:4450 8965#, no-c-format 8966msgid "" 8967"Set the value of the upper left corner of raster to the projected X and Y " 8968"coordinates" 8969msgstr "" 8970 8971#. Tag: programlisting 8972#: reference_raster.xml:4456 8973#, fuzzy, no-c-format 8974msgid "" 8975"SELECT ST_SetUpperLeft(rast,-71.01,42.37)\n" 8976"FROM dummy_rast\n" 8977"WHERE rid = 2;" 8978msgstr "" 8979"SELECT ST_SetUpperLeft(rast,-71.01,42.37) \n" 8980"FROM dummy_rast\n" 8981"WHERE rid = 2;" 8982 8983#. Tag: para 8984#: reference_raster.xml:4462 8985#, no-c-format 8986msgid ", <xref linkend=\"RT_ST_UpperLeftY\"/>" 8987msgstr ", <xref linkend=\"RT_ST_UpperLeftY\"/>" 8988 8989#. Tag: refname 8990#: reference_raster.xml:4468 8991#, no-c-format 8992msgid "ST_Resample" 8993msgstr "ST_Resample" 8994 8995#. Tag: refpurpose 8996#: reference_raster.xml:4469 8997#, no-c-format 8998msgid "" 8999"Resample a raster using a specified resampling algorithm, new dimensions, an " 9000"arbitrary grid corner and a set of raster georeferencing attributes defined " 9001"or borrowed from another raster." 9002msgstr "" 9003 9004#. Tag: funcsynopsis 9005#: reference_raster.xml:4475 9006#, no-c-format 9007msgid "" 9008"<funcprototype> <funcdef>raster <function>ST_Resample</function></funcdef> " 9009"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 9010"<paramdef><type>integer </type> <parameter>width</parameter></paramdef> " 9011"<paramdef><type>integer </type> <parameter>height</parameter></paramdef> " 9012"<paramdef choice=\"opt\"><type>double precision </type> " 9013"<parameter>gridx=NULL</parameter></paramdef> <paramdef choice=\"opt" 9014"\"><type>double precision </type> <parameter>gridy=NULL</parameter></" 9015"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 9016"<parameter>skewx=0</parameter></paramdef> <paramdef choice=\"opt" 9017"\"><type>double precision </type> <parameter>skewy=0</parameter></paramdef> " 9018"<paramdef choice=\"opt\"><type>text </type> " 9019"<parameter>algorithm=NearestNeighbour</parameter></paramdef> <paramdef " 9020"choice=\"opt\"><type>double precision </type> <parameter>maxerr=0.125</" 9021"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 9022"<function>ST_Resample</function></funcdef> <paramdef><type>raster </type> " 9023"<parameter>rast</parameter></paramdef> <paramdef choice=\"opt\"><type>double " 9024"precision </type> <parameter>scalex=0</parameter></paramdef> <paramdef " 9025"choice=\"opt\"><type>double precision </type> <parameter>scaley=0</" 9026"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 9027"type> <parameter>gridx=NULL</parameter></paramdef> <paramdef choice=\"opt" 9028"\"><type>double precision </type> <parameter>gridy=NULL</parameter></" 9029"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 9030"<parameter>skewx=0</parameter></paramdef> <paramdef choice=\"opt" 9031"\"><type>double precision </type> <parameter>skewy=0</parameter></paramdef> " 9032"<paramdef choice=\"opt\"><type>text </type> " 9033"<parameter>algorithm=NearestNeighbor</parameter></paramdef> <paramdef choice=" 9034"\"opt\"><type>double precision </type> <parameter>maxerr=0.125</parameter></" 9035"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 9036"<function>ST_Resample</function></funcdef> <paramdef><type>raster </type> " 9037"<parameter>rast</parameter></paramdef> <paramdef><type>raster </type> " 9038"<parameter>ref</parameter></paramdef> <paramdef choice=\"opt\"><type>text </" 9039"type> <parameter>algorithm=NearestNeighbour</parameter></paramdef> <paramdef " 9040"choice=\"opt\"><type>double precision </type> <parameter>maxerr=0.125</" 9041"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 9042"<parameter>usescale=true</parameter></paramdef> </funcprototype> " 9043"<funcprototype> <funcdef>raster <function>ST_Resample</function></funcdef> " 9044"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 9045"<paramdef><type>raster </type> <parameter>ref</parameter></paramdef> " 9046"<paramdef><type>boolean </type> <parameter>usescale</parameter></paramdef> " 9047"<paramdef choice=\"opt\"><type>text </type> " 9048"<parameter>algorithm=NearestNeighbour</parameter></paramdef> <paramdef " 9049"choice=\"opt\"><type>double precision </type> <parameter>maxerr=0.125</" 9050"parameter></paramdef> </funcprototype>" 9051msgstr "" 9052 9053#. Tag: para 9054#: reference_raster.xml:4525 9055#, no-c-format 9056msgid "" 9057"Resample a raster using a specified resampling algorithm, new dimensions " 9058"(width & height), a grid corner (gridx & gridy) and a set of raster " 9059"georeferencing attributes (scalex, scaley, skewx & skewy) defined or " 9060"borrowed from another raster. If using a reference raster, the two rasters " 9061"must have the same SRID." 9062msgstr "" 9063 9064#. Tag: para 9065#: reference_raster.xml:4529 9066#, no-c-format 9067msgid "" 9068"New pixel values are computed using the NearestNeighbor (English or American " 9069"spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling algorithm. " 9070"Default is NearestNeighbor which is the fastest but produce the worst " 9071"interpolation." 9072msgstr "" 9073 9074#. Tag: para 9075#: reference_raster.xml:4533 reference_raster.xml:4600 9076#, no-c-format 9077msgid "" 9078"A maxerror percent of 0.125 is used if no <varname>maxerr</varname> is " 9079"specified." 9080msgstr "" 9081 9082#. Tag: para 9083#: reference_raster.xml:4538 reference_raster.xml:4602 9084#: reference_raster.xml:4670 reference_raster.xml:4748 9085#, no-c-format 9086msgid "" 9087"Refer to: <ulink url=\"http://www.gdal.org/gdalwarp.html\">GDAL Warp " 9088"resampling methods</ulink> for more details." 9089msgstr "" 9090 9091#. Tag: para 9092#: reference_raster.xml:4542 reference_raster.xml:4606 9093#: reference_raster.xml:4674 reference_raster.xml:4752 9094#: reference_raster.xml:4908 9095#, no-c-format 9096msgid "Availability: 2.0.0 Requires GDAL 1.6.1+" 9097msgstr "" 9098 9099#. Tag: para 9100#: reference_raster.xml:4543 9101#, no-c-format 9102msgid "" 9103"Changed: 2.1.0 Parameter srid removed. Variants with a reference raster no " 9104"longer applies the reference raster's SRID. Use ST_Transform() to reproject " 9105"raster. Works on rasters with no SRID." 9106msgstr "" 9107 9108#. Tag: programlisting 9109#: reference_raster.xml:4549 9110#, fuzzy, no-c-format 9111msgid "" 9112"SELECT\n" 9113" ST_Width(orig) AS orig_width,\n" 9114" ST_Width(reduce_100) AS new_width\n" 9115"FROM (\n" 9116" SELECT\n" 9117" rast AS orig,\n" 9118" ST_Resample(rast,100,100) AS reduce_100\n" 9119" FROM aerials.boston\n" 9120" WHERE ST_Intersects(rast,\n" 9121" ST_Transform(\n" 9122" ST_MakeEnvelope(-71.128, 42.2392,-71.1277, 42.2397, " 9123"4326),26986)\n" 9124" )\n" 9125" LIMIT 1\n" 9126") AS foo;\n" 9127"\n" 9128" orig_width | new_width\n" 9129"------------+-------------\n" 9130" 200 | 100" 9131msgstr "" 9132"SELECT ST_Width(mass_stm) As w_before, ST_Width(wgs_84) As w_after,\n" 9133" ST_Height(mass_stm) As h_before, ST_Height(wgs_84) As h_after\n" 9134" FROM \n" 9135" ( SELECT rast As mass_stm, ST_Transform(rast,4326) As wgs_84\n" 9136" , ST_Transform(rast,4326, 'Bilinear') AS wgs_84_bilin\n" 9137" FROM aerials.o_2_boston \n" 9138" WHERE ST_Intersects(rast,\n" 9139" ST_Transform(ST_MakeEnvelope(-71.128, " 9140"42.2392,-71.1277, 42.2397, 4326),26986) )\n" 9141" LIMIT 1) As foo;\n" 9142" \n" 9143" w_before | w_after | h_before | h_after\n" 9144"----------+---------+----------+---------\n" 9145" 200 | 228 | 200 | 170" 9146 9147#. Tag: para 9148#: reference_raster.xml:4554 9149#, no-c-format 9150msgid ", <xref linkend=\"RT_ST_Resize\"/>, <xref linkend=\"RT_ST_Transform\"/>" 9151msgstr "" 9152 9153#. Tag: refname 9154#: reference_raster.xml:4564 9155#, no-c-format 9156msgid "ST_Rescale" 9157msgstr "ST_Rescale" 9158 9159#. Tag: refpurpose 9160#: reference_raster.xml:4565 9161#, no-c-format 9162msgid "" 9163"Resample a raster by adjusting only its scale (or pixel size). New pixel " 9164"values are computed using the NearestNeighbor (english or american " 9165"spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling algorithm. " 9166"Default is NearestNeighbor." 9167msgstr "" 9168 9169#. Tag: funcsynopsis 9170#: reference_raster.xml:4570 9171#, no-c-format 9172msgid "" 9173"<funcprototype> <funcdef>raster <function>ST_Rescale</function></funcdef> " 9174"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 9175"<paramdef><type>double precision </type> <parameter>scalexy</parameter></" 9176"paramdef> <paramdef choice=\"opt\"><type>text </type> " 9177"<parameter>algorithm=NearestNeighbour</parameter></paramdef> <paramdef " 9178"choice=\"opt\"><type>double precision </type> <parameter>maxerr=0.125</" 9179"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 9180"<function>ST_Rescale</function></funcdef> <paramdef><type>raster </type> " 9181"<parameter>rast</parameter></paramdef> <paramdef><type>double precision </" 9182"type> <parameter>scalex</parameter></paramdef> <paramdef><type>double " 9183"precision </type> <parameter>scaley</parameter></paramdef> <paramdef choice=" 9184"\"opt\"><type>text </type> <parameter>algorithm=NearestNeighbour</" 9185"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 9186"type> <parameter>maxerr=0.125</parameter></paramdef> </funcprototype>" 9187msgstr "" 9188"<funcprototype> <funcdef>raster <function>ST_Rescale</function></funcdef> " 9189"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 9190"<paramdef><type>double precision </type> <parameter>scalexy</parameter></" 9191"paramdef> <paramdef choice=\"opt\"><type>text </type> " 9192"<parameter>algorithm=NearestNeighbour</parameter></paramdef> <paramdef " 9193"choice=\"opt\"><type>double precision </type> <parameter>maxerr=0.125</" 9194"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 9195"<function>ST_Rescale</function></funcdef> <paramdef><type>raster </type> " 9196"<parameter>rast</parameter></paramdef> <paramdef><type>double precision </" 9197"type> <parameter>scalex</parameter></paramdef> <paramdef><type>double " 9198"precision </type> <parameter>scaley</parameter></paramdef> <paramdef choice=" 9199"\"opt\"><type>text </type> <parameter>algorithm=NearestNeighbour</" 9200"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 9201"type> <parameter>maxerr=0.125</parameter></paramdef> </funcprototype>" 9202 9203#. Tag: para 9204#: reference_raster.xml:4594 9205#, no-c-format 9206msgid "" 9207"Resample a raster by adjusting only its scale (or pixel size). New pixel " 9208"values are computed using the NearestNeighbor (english or american " 9209"spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling algorithm. The " 9210"default is NearestNeighbor which is the fastest but results in the worst " 9211"interpolation." 9212msgstr "" 9213 9214#. Tag: para 9215#: reference_raster.xml:4596 9216#, no-c-format 9217msgid "" 9218"<varname>scalex</varname> and <varname>scaley</varname> define the new pixel " 9219"size. scaley must often be negative to get well oriented raster." 9220msgstr "" 9221 9222#. Tag: para 9223#: reference_raster.xml:4598 9224#, no-c-format 9225msgid "" 9226"When the new scalex or scaley is not a divisor of the raster width or " 9227"height, the extent of the resulting raster is expanded to encompass the " 9228"extent of the provided raster. If you want to be sure to retain exact input " 9229"extent see <xref linkend=\"RT_ST_Resize\"/>" 9230msgstr "" 9231 9232#. Tag: para 9233#: reference_raster.xml:4604 9234#, no-c-format 9235msgid "" 9236"ST_Rescale is different from <xref linkend=\"RT_ST_SetScale\"/> in that " 9237"ST_SetScale do not resample the raster to match the raster extent. " 9238"ST_SetScale only changes the metadata (or georeference) of the raster to " 9239"correct an originally mis-specified scaling. ST_Rescale results in a raster " 9240"having different width and height computed to fit the geographic extent of " 9241"the input raster. ST_SetScale do not modify the width, nor the height of the " 9242"raster." 9243msgstr "" 9244 9245#. Tag: para 9246#: reference_raster.xml:4607 reference_raster.xml:4675 9247#: reference_raster.xml:4753 9248#, no-c-format 9249msgid "Changed: 2.1.0 Works on rasters with no SRID" 9250msgstr "" 9251 9252#. Tag: para 9253#: reference_raster.xml:4612 9254#, no-c-format 9255msgid "" 9256"A simple example rescaling a raster from a pixel size of 0.001 degree to a " 9257"pixel size of 0.0015 degree." 9258msgstr "" 9259 9260#. Tag: programlisting 9261#: reference_raster.xml:4614 9262#, no-c-format 9263msgid "" 9264"-- the original raster pixel size\n" 9265"SELECT ST_PixelWidth(ST_AddBand(ST_MakeEmptyRaster(100, 100, 0, 0, 0.001, " 9266"-0.001, 0, 0, 4269), '8BUI'::text, 1, 0)) width\n" 9267"\n" 9268" width\n" 9269"----------\n" 9270"0.001\n" 9271"\n" 9272"-- the rescaled raster raster pixel size\n" 9273"SELECT ST_PixelWidth(ST_Rescale(ST_AddBand(ST_MakeEmptyRaster(100, 100, 0, " 9274"0, 0.001, -0.001, 0, 0, 4269), '8BUI'::text, 1, 0), 0.0015)) width\n" 9275"\n" 9276" width\n" 9277"----------\n" 9278"0.0015" 9279msgstr "" 9280 9281#. Tag: para 9282#: reference_raster.xml:4619 9283#, no-c-format 9284msgid "" 9285", <xref linkend=\"RT_ST_Resample\"/>, <xref linkend=\"RT_ST_SetScale\"/>, " 9286"<xref linkend=\"RT_ST_ScaleX\"/>, <xref linkend=\"RT_ST_ScaleY\"/>, <xref " 9287"linkend=\"RT_ST_Transform\"/>" 9288msgstr "" 9289 9290#. Tag: refname 9291#: reference_raster.xml:4632 9292#, no-c-format 9293msgid "ST_Reskew" 9294msgstr "ST_Reskew" 9295 9296#. Tag: refpurpose 9297#: reference_raster.xml:4633 9298#, no-c-format 9299msgid "" 9300"Resample a raster by adjusting only its skew (or rotation parameters). New " 9301"pixel values are computed using the NearestNeighbor (english or american " 9302"spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling algorithm. " 9303"Default is NearestNeighbor." 9304msgstr "" 9305 9306#. Tag: funcsynopsis 9307#: reference_raster.xml:4638 9308#, no-c-format 9309msgid "" 9310"<funcprototype> <funcdef>raster <function>ST_Reskew</function></funcdef> " 9311"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 9312"<paramdef><type>double precision </type> <parameter>skewxy</parameter></" 9313"paramdef> <paramdef choice=\"opt\"><type>text </type> " 9314"<parameter>algorithm=NearestNeighbour</parameter></paramdef> <paramdef " 9315"choice=\"opt\"><type>double precision </type> <parameter>maxerr=0.125</" 9316"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 9317"<function>ST_Reskew</function></funcdef> <paramdef><type>raster </type> " 9318"<parameter>rast</parameter></paramdef> <paramdef><type>double precision </" 9319"type> <parameter>skewx</parameter></paramdef> <paramdef><type>double " 9320"precision </type> <parameter>skewy</parameter></paramdef> <paramdef choice=" 9321"\"opt\"><type>text </type> <parameter>algorithm=NearestNeighbour</" 9322"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 9323"type> <parameter>maxerr=0.125</parameter></paramdef> </funcprototype>" 9324msgstr "" 9325"<funcprototype> <funcdef>raster <function>ST_Reskew</function></funcdef> " 9326"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 9327"<paramdef><type>double precision </type> <parameter>skewxy</parameter></" 9328"paramdef> <paramdef choice=\"opt\"><type>text </type> " 9329"<parameter>algorithm=NearestNeighbour</parameter></paramdef> <paramdef " 9330"choice=\"opt\"><type>double precision </type> <parameter>maxerr=0.125</" 9331"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 9332"<function>ST_Reskew</function></funcdef> <paramdef><type>raster </type> " 9333"<parameter>rast</parameter></paramdef> <paramdef><type>double precision </" 9334"type> <parameter>skewx</parameter></paramdef> <paramdef><type>double " 9335"precision </type> <parameter>skewy</parameter></paramdef> <paramdef choice=" 9336"\"opt\"><type>text </type> <parameter>algorithm=NearestNeighbour</" 9337"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 9338"type> <parameter>maxerr=0.125</parameter></paramdef> </funcprototype>" 9339 9340#. Tag: para 9341#: reference_raster.xml:4662 9342#, no-c-format 9343msgid "" 9344"Resample a raster by adjusting only its skew (or rotation parameters). New " 9345"pixel values are computed using the NearestNeighbor (english or american " 9346"spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling algorithm. The " 9347"default is NearestNeighbor which is the fastest but results in the worst " 9348"interpolation." 9349msgstr "" 9350 9351#. Tag: para 9352#: reference_raster.xml:4664 9353#, no-c-format 9354msgid "" 9355"<varname>skewx</varname> and <varname>skewy</varname> define the new skew." 9356msgstr "" 9357 9358#. Tag: para 9359#: reference_raster.xml:4666 reference_raster.xml:4744 9360#, no-c-format 9361msgid "" 9362"The extent of the new raster will encompass the extent of the provided " 9363"raster." 9364msgstr "" 9365 9366#. Tag: para 9367#: reference_raster.xml:4668 reference_raster.xml:4746 9368#, no-c-format 9369msgid "" 9370"A maxerror percent of 0.125 if no <varname>maxerr</varname> is specified." 9371msgstr "" 9372 9373#. Tag: para 9374#: reference_raster.xml:4672 9375#, no-c-format 9376msgid "" 9377"ST_Reskew is different from <xref linkend=\"RT_ST_SetSkew\"/> in that " 9378"ST_SetSkew do not resample the raster to match the raster extent. ST_SetSkew " 9379"only changes the metadata (or georeference) of the raster to correct an " 9380"originally mis-specified skew. ST_Reskew results in a raster having " 9381"different width and height computed to fit the geographic extent of the " 9382"input raster. ST_SetSkew do not modify the width, nor the height of the " 9383"raster." 9384msgstr "" 9385 9386#. Tag: para 9387#: reference_raster.xml:4680 9388#, no-c-format 9389msgid "" 9390"A simple example reskewing a raster from a skew of 0.0 to a skew of 0.0015." 9391msgstr "" 9392 9393#. Tag: programlisting 9394#: reference_raster.xml:4682 9395#, no-c-format 9396msgid "" 9397"-- the original raster non-rotated\n" 9398"SELECT ST_Rotation(ST_AddBand(ST_MakeEmptyRaster(100, 100, 0, 0, 0.001, " 9399"-0.001, 0, 0, 4269), '8BUI'::text, 1, 0));\n" 9400"\n" 9401"-- result\n" 9402"0\n" 9403"\n" 9404"-- the reskewed raster raster rotation\n" 9405"SELECT ST_Rotation(ST_Reskew(ST_AddBand(ST_MakeEmptyRaster(100, 100, 0, 0, " 9406"0.001, -0.001, 0, 0, 4269), '8BUI'::text, 1, 0), 0.0015));\n" 9407"\n" 9408"-- result\n" 9409"-0.982793723247329" 9410msgstr "" 9411 9412#. Tag: para 9413#: reference_raster.xml:4688 9414#, no-c-format 9415msgid "" 9416", <xref linkend=\"RT_ST_Rescale\"/>, <xref linkend=\"RT_ST_SetSkew\"/>, " 9417"<xref linkend=\"RT_ST_SetRotation\"/>, <xref linkend=\"RT_ST_SkewX\"/>, " 9418"<xref linkend=\"RT_ST_SkewY\"/>, <xref linkend=\"RT_ST_Transform\"/>" 9419msgstr "" 9420", <xref linkend=\"RT_ST_Rescale\"/>, <xref linkend=\"RT_ST_SetSkew\"/>, " 9421"<xref linkend=\"RT_ST_SetRotation\"/>, <xref linkend=\"RT_ST_SkewX\"/>, " 9422"<xref linkend=\"RT_ST_SkewY\"/>, <xref linkend=\"RT_ST_Transform\"/>" 9423 9424#. Tag: refname 9425#: reference_raster.xml:4694 9426#, no-c-format 9427msgid "ST_SnapToGrid" 9428msgstr "ST_SnapToGrid" 9429 9430#. Tag: refpurpose 9431#: reference_raster.xml:4695 9432#, no-c-format 9433msgid "" 9434"Resample a raster by snapping it to a grid. New pixel values are computed " 9435"using the NearestNeighbor (english or american spelling), Bilinear, Cubic, " 9436"CubicSpline or Lanczos resampling algorithm. Default is NearestNeighbor." 9437msgstr "" 9438 9439#. Tag: funcsynopsis 9440#: reference_raster.xml:4700 9441#, no-c-format 9442msgid "" 9443"<funcprototype> <funcdef>raster <function>ST_SnapToGrid</function></funcdef> " 9444"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 9445"<paramdef><type>double precision </type> <parameter>gridx</parameter></" 9446"paramdef> <paramdef><type>double precision </type> <parameter>gridy</" 9447"parameter></paramdef> <paramdef choice=\"opt\"><type>text </type> " 9448"<parameter>algorithm=NearestNeighbour</parameter></paramdef> <paramdef " 9449"choice=\"opt\"><type>double precision </type> <parameter>maxerr=0.125</" 9450"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 9451"type> <parameter>scalex=DEFAULT 0</parameter></paramdef> <paramdef choice=" 9452"\"opt\"><type>double precision </type> <parameter>scaley=DEFAULT 0</" 9453"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 9454"<function>ST_SnapToGrid</function></funcdef> <paramdef><type>raster </type> " 9455"<parameter>rast</parameter></paramdef> <paramdef><type>double precision </" 9456"type> <parameter>gridx</parameter></paramdef> <paramdef><type>double " 9457"precision </type> <parameter>gridy</parameter></paramdef> " 9458"<paramdef><type>double precision </type> <parameter>scalex</parameter></" 9459"paramdef> <paramdef><type>double precision </type> <parameter>scaley</" 9460"parameter></paramdef> <paramdef choice=\"opt\"><type>text </type> " 9461"<parameter>algorithm=NearestNeighbour</parameter></paramdef> <paramdef " 9462"choice=\"opt\"><type>double precision </type> <parameter>maxerr=0.125</" 9463"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 9464"<function>ST_SnapToGrid</function></funcdef> <paramdef><type>raster </type> " 9465"<parameter>rast</parameter></paramdef> <paramdef><type>double precision </" 9466"type> <parameter>gridx</parameter></paramdef> <paramdef><type>double " 9467"precision </type> <parameter>gridy</parameter></paramdef> " 9468"<paramdef><type>double precision </type> <parameter>scalexy</parameter></" 9469"paramdef> <paramdef choice=\"opt\"><type>text </type> " 9470"<parameter>algorithm=NearestNeighbour</parameter></paramdef> <paramdef " 9471"choice=\"opt\"><type>double precision </type> <parameter>maxerr=0.125</" 9472"parameter></paramdef> </funcprototype>" 9473msgstr "" 9474 9475#. Tag: para 9476#: reference_raster.xml:4739 9477#, no-c-format 9478msgid "" 9479"Resample a raster by snapping it to a grid defined by an arbitrary pixel " 9480"corner (gridx & gridy) and optionally a pixel size (scalex & " 9481"scaley). New pixel values are computed using the NearestNeighbor (english or " 9482"american spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling " 9483"algorithm. The default is NearestNeighbor which is the fastest but results " 9484"in the worst interpolation." 9485msgstr "" 9486 9487#. Tag: para 9488#: reference_raster.xml:4741 9489#, no-c-format 9490msgid "" 9491"<varname>gridx</varname> and <varname>gridy</varname> define any arbitrary " 9492"pixel corner of the new grid. This is not necessarily the upper left corner " 9493"of the new raster and it does not have to be inside or on the edge of the " 9494"new raster extent." 9495msgstr "" 9496 9497#. Tag: para 9498#: reference_raster.xml:4743 9499#, no-c-format 9500msgid "" 9501"You can optionally define the pixel size of the new grid with " 9502"<varname>scalex</varname> and <varname>scaley</varname>." 9503msgstr "" 9504 9505#. Tag: para 9506#: reference_raster.xml:4750 9507#, no-c-format 9508msgid "" 9509"Use <xref linkend=\"RT_ST_Resample\"/> if you need more control over the " 9510"grid parameters." 9511msgstr "" 9512 9513#. Tag: para 9514#: reference_raster.xml:4758 9515#, no-c-format 9516msgid "A simple example snapping a raster to a slightly different grid." 9517msgstr "" 9518 9519#. Tag: programlisting 9520#: reference_raster.xml:4760 9521#, no-c-format 9522msgid "" 9523"-- the original raster upper left X\n" 9524"SELECT ST_UpperLeftX(ST_AddBand(ST_MakeEmptyRaster(10, 10, 0, 0, 0.001, " 9525"-0.001, 0, 0, 4269), '8BUI'::text, 1, 0));\n" 9526"-- result\n" 9527"0\n" 9528"\n" 9529"-- the upper left of raster after snapping\n" 9530"SELECT ST_UpperLeftX(ST_SnapToGrid(ST_AddBand(ST_MakeEmptyRaster(10, 10, 0, " 9531"0, 0.001, -0.001, 0, 0, 4269), '8BUI'::text, 1, 0), 0.0002, 0.0002));\n" 9532"\n" 9533"--result\n" 9534"-0.0008" 9535msgstr "" 9536 9537#. Tag: para 9538#: reference_raster.xml:4766 9539#, no-c-format 9540msgid "" 9541", <xref linkend=\"RT_ST_Rescale\"/>, <xref linkend=\"RT_ST_UpperLeftX\"/>, " 9542"<xref linkend=\"RT_ST_UpperLeftY\"/>" 9543msgstr "" 9544", <xref linkend=\"RT_ST_Rescale\"/>, <xref linkend=\"RT_ST_UpperLeftX\"/>, " 9545"<xref linkend=\"RT_ST_UpperLeftY\"/>" 9546 9547#. Tag: refname 9548#: reference_raster.xml:4772 9549#, no-c-format 9550msgid "ST_Resize" 9551msgstr "" 9552 9553#. Tag: refpurpose 9554#: reference_raster.xml:4773 9555#, no-c-format 9556msgid "Resize a raster to a new width/height" 9557msgstr "" 9558 9559#. Tag: funcsynopsis 9560#: reference_raster.xml:4777 9561#, no-c-format 9562msgid "" 9563"<funcprototype> <funcdef>raster <function>ST_Resize</function></funcdef> " 9564"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 9565"<paramdef><type>integer </type> <parameter>width</parameter></paramdef> " 9566"<paramdef><type>integer </type> <parameter>height</parameter></paramdef> " 9567"<paramdef choice=\"opt\"><type>text </type> " 9568"<parameter>algorithm=NearestNeighbor</parameter></paramdef> <paramdef choice=" 9569"\"opt\"><type>double precision </type> <parameter>maxerr=0.125</parameter></" 9570"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 9571"<function>ST_Resize</function></funcdef> <paramdef><type>raster </type> " 9572"<parameter>rast</parameter></paramdef> <paramdef><type>double precision </" 9573"type> <parameter>percentwidth</parameter></paramdef> <paramdef><type>double " 9574"precision </type> <parameter>percentheight</parameter></paramdef> <paramdef " 9575"choice=\"opt\"><type>text </type> <parameter>algorithm=NearestNeighbor</" 9576"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 9577"type> <parameter>maxerr=0.125</parameter></paramdef> </funcprototype> " 9578"<funcprototype> <funcdef>raster <function>ST_Resize</function></funcdef> " 9579"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 9580"<paramdef><type>text </type> <parameter>width</parameter></paramdef> " 9581"<paramdef><type>text </type> <parameter>height</parameter></paramdef> " 9582"<paramdef choice=\"opt\"><type>text </type> " 9583"<parameter>algorithm=NearestNeighbor</parameter></paramdef> <paramdef choice=" 9584"\"opt\"><type>double precision </type> <parameter>maxerr=0.125</parameter></" 9585"paramdef> </funcprototype>" 9586msgstr "" 9587 9588#. Tag: para 9589#: reference_raster.xml:4811 9590#, no-c-format 9591msgid "" 9592"Resize a raster to a new width/height. The new width/height can be specified " 9593"in exact number of pixels or a percentage of the raster's width/height. The " 9594"extent of the the new raster will be the same as the extent of the provided " 9595"raster." 9596msgstr "" 9597 9598#. Tag: para 9599#: reference_raster.xml:4815 9600#, no-c-format 9601msgid "" 9602"New pixel values are computed using the NearestNeighbor (english or american " 9603"spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling algorithm. The " 9604"default is NearestNeighbor which is the fastest but results in the worst " 9605"interpolation." 9606msgstr "" 9607 9608#. Tag: para 9609#: reference_raster.xml:4819 9610#, no-c-format 9611msgid "Variant 1 expects the actual width/height of the output raster." 9612msgstr "" 9613 9614#. Tag: para 9615#: reference_raster.xml:4823 9616#, no-c-format 9617msgid "" 9618"Variant 2 expects decimal values between zero (0) and one (1) indicating the " 9619"percentage of the input raster's width/height." 9620msgstr "" 9621 9622#. Tag: para 9623#: reference_raster.xml:4827 9624#, no-c-format 9625msgid "" 9626"Variant 3 takes either the actual width/height of the output raster or a " 9627"textual percentage (\"20%\") indicating the percentage of the input raster's " 9628"width/height." 9629msgstr "" 9630 9631#. Tag: para 9632#: reference_raster.xml:4831 9633#, no-c-format 9634msgid "Availability: 2.1.0 Requires GDAL 1.6.1+" 9635msgstr "" 9636 9637#. Tag: programlisting 9638#: reference_raster.xml:4835 9639#, no-c-format 9640msgid "" 9641"WITH foo AS(\n" 9642"SELECT\n" 9643" 1 AS rid,\n" 9644" ST_Resize(\n" 9645" ST_AddBand(\n" 9646" ST_MakeEmptyRaster(1000, 1000, 0, 0, 1, -1, 0, 0, " 9647"0)\n" 9648" , 1, '8BUI', 255, 0\n" 9649" )\n" 9650" , '50%', '500') AS rast\n" 9651"UNION ALL\n" 9652"SELECT\n" 9653" 2 AS rid,\n" 9654" ST_Resize(\n" 9655" ST_AddBand(\n" 9656" ST_MakeEmptyRaster(1000, 1000, 0, 0, 1, -1, 0, 0, " 9657"0)\n" 9658" , 1, '8BUI', 255, 0\n" 9659" )\n" 9660" , 500, 100) AS rast\n" 9661"UNION ALL\n" 9662"SELECT\n" 9663" 3 AS rid,\n" 9664" ST_Resize(\n" 9665" ST_AddBand(\n" 9666" ST_MakeEmptyRaster(1000, 1000, 0, 0, 1, -1, 0, 0, " 9667"0)\n" 9668" , 1, '8BUI', 255, 0\n" 9669" )\n" 9670" , 0.25, 0.9) AS rast\n" 9671"), bar AS (\n" 9672" SELECT rid, ST_Metadata(rast) AS meta, rast FROM foo\n" 9673")\n" 9674"SELECT rid, (meta).* FROM bar\n" 9675"\n" 9676" rid | upperleftx | upperlefty | width | height | scalex | scaley | skewx | " 9677"skewy | srid | numbands\n" 9678"-----+------------+------------+-------+--------+--------+--------+-------" 9679"+-------+------+----------\n" 9680" 1 | 0 | 0 | 500 | 500 | 1 | -1 | 0 " 9681"| 0 | 0 | 1\n" 9682" 2 | 0 | 0 | 500 | 100 | 1 | -1 | 0 " 9683"| 0 | 0 | 1\n" 9684" 3 | 0 | 0 | 250 | 900 | 1 | -1 | 0 " 9685"| 0 | 0 | 1\n" 9686"(3 rows)" 9687msgstr "" 9688 9689#. Tag: para 9690#: reference_raster.xml:4840 9691#, no-c-format 9692msgid "" 9693", <xref linkend=\"RT_ST_Rescale\"/>, <xref linkend=\"RT_ST_Reskew\"/>, <xref " 9694"linkend=\"RT_ST_SnapToGrid\"/>" 9695msgstr "" 9696 9697#. Tag: refname 9698#: reference_raster.xml:4851 9699#, no-c-format 9700msgid "ST_Transform" 9701msgstr "ST_Transform" 9702 9703#. Tag: refpurpose 9704#: reference_raster.xml:4852 9705#, no-c-format 9706msgid "" 9707"Reprojects a raster in a known spatial reference system to another known " 9708"spatial reference system using specified resampling algorithm. Options are " 9709"NearestNeighbor, Bilinear, Cubic, CubicSpline, Lanczos defaulting to " 9710"NearestNeighbor." 9711msgstr "" 9712 9713#. Tag: funcsynopsis 9714#: reference_raster.xml:4856 9715#, no-c-format 9716msgid "" 9717"<funcprototype> <funcdef>raster <function>ST_Transform</function></funcdef> " 9718"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 9719"<paramdef><type>integer </type> <parameter>srid</parameter></paramdef> " 9720"<paramdef choice=\"opt\"><type>text </type> " 9721"<parameter>algorithm=NearestNeighbor</parameter></paramdef> <paramdef choice=" 9722"\"opt\"><type>double precision </type> <parameter>maxerr=0.125</parameter></" 9723"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 9724"<parameter>scalex</parameter></paramdef> <paramdef choice=\"opt" 9725"\"><type>double precision </type> <parameter>scaley</parameter></paramdef> </" 9726"funcprototype> <funcprototype> <funcdef>raster <function>ST_Transform</" 9727"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 9728"parameter></paramdef> <paramdef><type>integer </type> <parameter>srid</" 9729"parameter></paramdef> <paramdef><type>double precision </type> " 9730"<parameter>scalex</parameter></paramdef> <paramdef><type>double precision </" 9731"type> <parameter>scaley</parameter></paramdef> <paramdef choice=\"opt" 9732"\"><type>text </type> <parameter>algorithm=NearestNeighbor</parameter></" 9733"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 9734"<parameter>maxerr=0.125</parameter></paramdef> </funcprototype> " 9735"<funcprototype> <funcdef>raster <function>ST_Transform</function></funcdef> " 9736"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 9737"<paramdef><type>raster </type> <parameter>alignto</parameter></paramdef> " 9738"<paramdef choice=\"opt\"><type>text </type> " 9739"<parameter>algorithm=NearestNeighbor</parameter></paramdef> <paramdef choice=" 9740"\"opt\"><type>double precision </type> <parameter>maxerr=0.125</parameter></" 9741"paramdef> </funcprototype>" 9742msgstr "" 9743 9744#. Tag: para 9745#: reference_raster.xml:4890 9746#, no-c-format 9747msgid "" 9748"Reprojects a raster in a known spatial reference system to another known " 9749"spatial reference system using specified pixel warping algorithm. Uses " 9750"'NearestNeighbor' if no algorithm is specified and maxerror percent of 0.125 " 9751"if no maxerr is specified." 9752msgstr "" 9753 9754#. Tag: para 9755#: reference_raster.xml:4894 9756#, no-c-format 9757msgid "" 9758"ST_Transform is often confused with ST_SetSRID(). ST_Transform actually " 9759"changes the coordinates of a raster (and resamples the pixel values) from " 9760"one spatial reference system to another, while ST_SetSRID() simply changes " 9761"the SRID identifier of the raster." 9762msgstr "" 9763 9764#. Tag: para 9765#: reference_raster.xml:4898 9766#, no-c-format 9767msgid "" 9768"Unlike the other variants, Variant 3 requires a reference raster as " 9769"<varname>alignto</varname>. The transformed raster will be transformed to " 9770"the spatial reference system (SRID) of the reference raster and be aligned " 9771"(ST_SameAlignment = TRUE) to the reference raster." 9772msgstr "" 9773 9774#. Tag: para 9775#: reference_raster.xml:4903 9776#, no-c-format 9777msgid "" 9778"If you find your transformation support is not working right, you may need " 9779"to set the environment variable PROJSO to the .so or .dll projection library " 9780"your PostGIS is using. This just needs to have the name of the file. So for " 9781"example on windows, you would in Control Panel -> System -> Environment " 9782"Variables add a system variable called <varname>PROJSO</varname> and set it " 9783"to <varname>libproj.dll</varname> (if you are using proj 4.6.1). You'll have " 9784"to restart your PostgreSQL service/daemon after this change." 9785msgstr "" 9786 9787#. Tag: para 9788#: reference_raster.xml:4909 9789#, no-c-format 9790msgid "Enhanced: 2.1.0 Addition of ST_Transform(rast, alignto) variant" 9791msgstr "" 9792 9793#. Tag: programlisting 9794#: reference_raster.xml:4915 9795#, fuzzy, no-c-format 9796msgid "" 9797"SELECT ST_Width(mass_stm) As w_before, ST_Width(wgs_84) As w_after,\n" 9798" ST_Height(mass_stm) As h_before, ST_Height(wgs_84) As h_after\n" 9799" FROM\n" 9800" ( SELECT rast As mass_stm, ST_Transform(rast,4326) As wgs_84\n" 9801" , ST_Transform(rast,4326, 'Bilinear') AS wgs_84_bilin\n" 9802" FROM aerials.o_2_boston\n" 9803" WHERE ST_Intersects(rast,\n" 9804" ST_Transform(ST_MakeEnvelope(-71.128, " 9805"42.2392,-71.1277, 42.2397, 4326),26986) )\n" 9806" LIMIT 1) As foo;\n" 9807"\n" 9808" w_before | w_after | h_before | h_after\n" 9809"----------+---------+----------+---------\n" 9810" 200 | 228 | 200 | 170" 9811msgstr "" 9812"SELECT ST_Width(mass_stm) As w_before, ST_Width(wgs_84) As w_after,\n" 9813" ST_Height(mass_stm) As h_before, ST_Height(wgs_84) As h_after\n" 9814" FROM \n" 9815" ( SELECT rast As mass_stm, ST_Transform(rast,4326) As wgs_84\n" 9816" , ST_Transform(rast,4326, 'Bilinear') AS wgs_84_bilin\n" 9817" FROM aerials.o_2_boston \n" 9818" WHERE ST_Intersects(rast,\n" 9819" ST_Transform(ST_MakeEnvelope(-71.128, " 9820"42.2392,-71.1277, 42.2397, 4326),26986) )\n" 9821" LIMIT 1) As foo;\n" 9822" \n" 9823" w_before | w_after | h_before | h_after\n" 9824"----------+---------+----------+---------\n" 9825" 200 | 228 | 200 | 170" 9826 9827#. Tag: para 9828#: reference_raster.xml:4925 9829#, no-c-format 9830msgid "original mass state plane meters (mass_stm)" 9831msgstr "" 9832 9833#. Tag: para 9834#: reference_raster.xml:4934 9835#, no-c-format 9836msgid "After transform to wgs 84 long lat (wgs_84)" 9837msgstr "" 9838 9839#. Tag: para 9840#: reference_raster.xml:4943 9841#, no-c-format 9842msgid "" 9843"After transform to wgs 84 long lat with bilinear algorithm instead of NN " 9844"default (wgs_84_bilin)" 9845msgstr "" 9846 9847#. Tag: para 9848#: reference_raster.xml:4956 9849#, no-c-format 9850msgid "" 9851"The following shows the difference between using ST_Transform(raster, srid) " 9852"and ST_Transform(raster, alignto)" 9853msgstr "" 9854 9855#. Tag: programlisting 9856#: reference_raster.xml:4957 9857#, no-c-format 9858msgid "" 9859"WITH foo AS (\n" 9860" SELECT 0 AS rid, ST_AddBand(ST_MakeEmptyRaster(2, 2, -500000, " 9861"600000, 100, -100, 0, 0, 2163), 1, '16BUI', 1, 0) AS rast UNION ALL\n" 9862" SELECT 1, ST_AddBand(ST_MakeEmptyRaster(2, 2, -499800, 600000, 100, " 9863"-100, 0, 0, 2163), 1, '16BUI', 2, 0) AS rast UNION ALL\n" 9864" SELECT 2, ST_AddBand(ST_MakeEmptyRaster(2, 2, -499600, 600000, 100, " 9865"-100, 0, 0, 2163), 1, '16BUI', 3, 0) AS rast UNION ALL\n" 9866"\n" 9867" SELECT 3, ST_AddBand(ST_MakeEmptyRaster(2, 2, -500000, 599800, 100, " 9868"-100, 0, 0, 2163), 1, '16BUI', 10, 0) AS rast UNION ALL\n" 9869" SELECT 4, ST_AddBand(ST_MakeEmptyRaster(2, 2, -499800, 599800, 100, " 9870"-100, 0, 0, 2163), 1, '16BUI', 20, 0) AS rast UNION ALL\n" 9871" SELECT 5, ST_AddBand(ST_MakeEmptyRaster(2, 2, -499600, 599800, 100, " 9872"-100, 0, 0, 2163), 1, '16BUI', 30, 0) AS rast UNION ALL\n" 9873"\n" 9874" SELECT 6, ST_AddBand(ST_MakeEmptyRaster(2, 2, -500000, 599600, 100, " 9875"-100, 0, 0, 2163), 1, '16BUI', 100, 0) AS rast UNION ALL\n" 9876" SELECT 7, ST_AddBand(ST_MakeEmptyRaster(2, 2, -499800, 599600, 100, " 9877"-100, 0, 0, 2163), 1, '16BUI', 200, 0) AS rast UNION ALL\n" 9878" SELECT 8, ST_AddBand(ST_MakeEmptyRaster(2, 2, -499600, 599600, 100, " 9879"-100, 0, 0, 2163), 1, '16BUI', 300, 0) AS rast\n" 9880"), bar AS (\n" 9881" SELECT\n" 9882" ST_Transform(rast, 4269) AS alignto\n" 9883" FROM foo\n" 9884" LIMIT 1\n" 9885"), baz AS (\n" 9886" SELECT\n" 9887" rid,\n" 9888" rast,\n" 9889" ST_Transform(rast, 4269) AS not_aligned,\n" 9890" ST_Transform(rast, alignto) AS aligned\n" 9891" FROM foo\n" 9892" CROSS JOIN bar\n" 9893")\n" 9894"SELECT\n" 9895" ST_SameAlignment(rast) AS rast,\n" 9896" ST_SameAlignment(not_aligned) AS not_aligned,\n" 9897" ST_SameAlignment(aligned) AS aligned\n" 9898"FROM baz\n" 9899"\n" 9900" rast | not_aligned | aligned\n" 9901"------+-------------+---------\n" 9902" t | f | t" 9903msgstr "" 9904 9905#. Tag: para 9906#: reference_raster.xml:4962 9907#, no-c-format 9908msgid ", <xref linkend=\"RT_ST_SetSRID\"/>" 9909msgstr ", <xref linkend=\"RT_ST_SetSRID\"/>" 9910 9911#. Tag: title 9912#: reference_raster.xml:4968 9913#, no-c-format 9914msgid "Raster Band Editors" 9915msgstr "" 9916 9917#. Tag: refname 9918#: reference_raster.xml:4972 9919#, no-c-format 9920msgid "ST_SetBandNoDataValue" 9921msgstr "" 9922 9923#. Tag: refpurpose 9924#: reference_raster.xml:4973 9925#, no-c-format 9926msgid "" 9927"Sets the value for the given band that represents no data. Band 1 is assumed " 9928"if no band is specified. To mark a band as having no nodata value, set the " 9929"nodata value = NULL." 9930msgstr "" 9931 9932#. Tag: funcsynopsis 9933#: reference_raster.xml:4977 9934#, no-c-format 9935msgid "" 9936"<funcprototype> <funcdef>raster <function>ST_SetBandNoDataValue</function></" 9937"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 9938"paramdef> <paramdef><type>double precision </type> <parameter>nodatavalue</" 9939"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 9940"<function>ST_SetBandNoDataValue</function></funcdef> <paramdef><type>raster " 9941"</type> <parameter>rast</parameter></paramdef> <paramdef><type>integer </" 9942"type> <parameter>band</parameter></paramdef> <paramdef><type>double " 9943"precision </type> <parameter>nodatavalue</parameter></paramdef> <paramdef " 9944"choice=\"opt\"><type>boolean </type> <parameter>forcechecking=false</" 9945"parameter></paramdef> </funcprototype>" 9946msgstr "" 9947"<funcprototype> <funcdef>raster <function>ST_SetBandNoDataValue</function></" 9948"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 9949"paramdef> <paramdef><type>double precision </type> <parameter>nodatavalue</" 9950"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 9951"<function>ST_SetBandNoDataValue</function></funcdef> <paramdef><type>raster " 9952"</type> <parameter>rast</parameter></paramdef> <paramdef><type>integer </" 9953"type> <parameter>band</parameter></paramdef> <paramdef><type>double " 9954"precision </type> <parameter>nodatavalue</parameter></paramdef> <paramdef " 9955"choice=\"opt\"><type>boolean </type> <parameter>forcechecking=false</" 9956"parameter></paramdef> </funcprototype>" 9957 9958#. Tag: para 9959#: reference_raster.xml:4998 9960#, no-c-format 9961msgid "" 9962"Sets the value that represents no data for the band. Band 1 is assumed if " 9963"not specified. This will affect results from <xref linkend=\"RT_ST_Polygon\"/" 9964">, <xref linkend=\"RT_ST_DumpAsPolygons\"/>, and the ST_PixelAs...() " 9965"functions." 9966msgstr "" 9967 9968#. Tag: programlisting 9969#: reference_raster.xml:5004 9970#, no-c-format 9971msgid "" 9972"-- change just first band no data value\n" 9973"UPDATE dummy_rast\n" 9974" SET rast = ST_SetBandNoDataValue(rast,1, 254)\n" 9975"WHERE rid = 2;\n" 9976"\n" 9977"-- change no data band value of bands 1,2,3\n" 9978"UPDATE dummy_rast\n" 9979" SET rast =\n" 9980" ST_SetBandNoDataValue(\n" 9981" ST_SetBandNoDataValue(\n" 9982" ST_SetBandNoDataValue(\n" 9983" rast,1, 254)\n" 9984" ,2,99),\n" 9985" 3,108)\n" 9986" WHERE rid = 2;\n" 9987"\n" 9988"-- wipe out the nodata value this will ensure all pixels are considered for " 9989"all processing functions\n" 9990"UPDATE dummy_rast\n" 9991" SET rast = ST_SetBandNoDataValue(rast,1, NULL)\n" 9992"WHERE rid = 2;" 9993msgstr "" 9994 9995#. Tag: refname 9996#: reference_raster.xml:5016 9997#, no-c-format 9998msgid "ST_SetBandIsNoData" 9999msgstr "ST_SetBandIsNoData" 10000 10001#. Tag: refpurpose 10002#: reference_raster.xml:5017 10003#, no-c-format 10004msgid "Sets the isnodata flag of the band to TRUE." 10005msgstr "" 10006 10007#. Tag: funcprototype 10008#: reference_raster.xml:5022 10009#, no-c-format 10010msgid "" 10011"<funcdef>raster <function>ST_SetBandIsNoData</function></funcdef> " 10012"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 10013"<paramdef choice=\"opt\"><type>integer </type> <parameter>band=1</" 10014"parameter></paramdef>" 10015msgstr "" 10016 10017#. Tag: para 10018#: reference_raster.xml:5033 10019#, no-c-format 10020msgid "" 10021"Sets the isnodata flag for the band to true. Band 1 is assumed if not " 10022"specified. This function should be called only when the flag is considered " 10023"dirty. That is, when the result calling <xref linkend=\"RT_ST_BandIsNoData\"/" 10024"> is different using TRUE as last argument and without using it" 10025msgstr "" 10026 10027#. Tag: programlisting 10028#: reference_raster.xml:5045 10029#, no-c-format 10030msgid "" 10031"-- Create dummy table with one raster column\n" 10032"create table dummy_rast (rid integer, rast raster);\n" 10033"\n" 10034"-- Add raster with two bands, one pixel/band. In the first band, nodatavalue " 10035"= pixel value = 3.\n" 10036"-- In the second band, nodatavalue = 13, pixel value = 4\n" 10037"insert into dummy_rast values(1,\n" 10038"(\n" 10039"'01' -- little endian (uint8 ndr)\n" 10040"||\n" 10041"'0000' -- version (uint16 0)\n" 10042"||\n" 10043"'0200' -- nBands (uint16 0)\n" 10044"||\n" 10045"'17263529ED684A3F' -- scaleX (float64 0.000805965234044584)\n" 10046"||\n" 10047"'F9253529ED684ABF' -- scaleY (float64 -0.00080596523404458)\n" 10048"||\n" 10049"'1C9F33CE69E352C0' -- ipX (float64 -75.5533328537098)\n" 10050"||\n" 10051"'718F0E9A27A44840' -- ipY (float64 49.2824585505576)\n" 10052"||\n" 10053"'ED50EB853EC32B3F' -- skewX (float64 0.000211812383858707)\n" 10054"||\n" 10055"'7550EB853EC32B3F' -- skewY (float64 0.000211812383858704)\n" 10056"||\n" 10057"'E6100000' -- SRID (int32 4326)\n" 10058"||\n" 10059"'0100' -- width (uint16 1)\n" 10060"||\n" 10061"'0100' -- height (uint16 1)\n" 10062"||\n" 10063"'4' -- hasnodatavalue set to true, isnodata value set to false (when it " 10064"should be true)\n" 10065"||\n" 10066"'2' -- first band type (4BUI)\n" 10067"||\n" 10068"'03' -- novalue==3\n" 10069"||\n" 10070"'03' -- pixel(0,0)==3 (same that nodata)\n" 10071"||\n" 10072"'0' -- hasnodatavalue set to false\n" 10073"||\n" 10074"'5' -- second band type (16BSI)\n" 10075"||\n" 10076"'0D00' -- novalue==13\n" 10077"||\n" 10078"'0400' -- pixel(0,0)==4\n" 10079")::raster\n" 10080");\n" 10081"\n" 10082"select st_bandisnodata(rast, 1) from dummy_rast where rid = 1; -- Expected " 10083"false\n" 10084"select st_bandisnodata(rast, 1, TRUE) from dummy_rast where rid = 1; -- " 10085"Expected true\n" 10086"\n" 10087"-- The isnodata flag is dirty. We are going to set it to true\n" 10088"update dummy_rast set rast = st_setbandisnodata(rast, 1) where rid = 1;\n" 10089"\n" 10090"\n" 10091"select st_bandisnodata(rast, 1) from dummy_rast where rid = 1; -- Expected " 10092"true" 10093msgstr "" 10094 10095#. Tag: para 10096#: reference_raster.xml:5051 10097#, no-c-format 10098msgid "" 10099", <xref linkend=\"RT_ST_NumBands\"/>, <xref linkend=" 10100"\"RT_ST_SetBandNoDataValue\"/>, <xref linkend=\"RT_ST_BandIsNoData\"/>" 10101msgstr "" 10102", <xref linkend=\"RT_ST_NumBands\"/>, <xref linkend=" 10103"\"RT_ST_SetBandNoDataValue\"/>, <xref linkend=\"RT_ST_BandIsNoData\"/>" 10104 10105#. Tag: refname 10106#: reference_raster.xml:5060 10107#, fuzzy, no-c-format 10108msgid "ST_SetBandPath" 10109msgstr "ST_BandPath" 10110 10111#. Tag: refpurpose 10112#: reference_raster.xml:5061 10113#, no-c-format 10114msgid "Update the external path and band number of an out-db band" 10115msgstr "" 10116 10117#. Tag: funcprototype 10118#: reference_raster.xml:5066 10119#, fuzzy, no-c-format 10120msgid "" 10121"<funcdef>raster <function>ST_SetBandPath</function></funcdef> " 10122"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 10123"<paramdef><type>integer </type> <parameter>band</parameter></paramdef> " 10124"<paramdef><type>text </type> <parameter>outdbpath</parameter></paramdef> " 10125"<paramdef><type>integer </type> <parameter>outdbindex</parameter></paramdef> " 10126"<paramdef choice=\"opt\"><type>boolean </type> <parameter>force=false</" 10127"parameter></paramdef>" 10128msgstr "" 10129"<funcdef>bytea <function>ST_AsGDALRaster</function></funcdef> " 10130"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 10131"<paramdef><type>text </type> <parameter>format</parameter></paramdef> " 10132"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=NULL</" 10133"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 10134"<parameter>srid=sameassource</parameter></paramdef>" 10135 10136#. Tag: para 10137#: reference_raster.xml:5080 10138#, no-c-format 10139msgid "" 10140"Updates an out-db band's external raster file path and external band number." 10141msgstr "" 10142 10143#. Tag: para 10144#: reference_raster.xml:5083 10145#, no-c-format 10146msgid "" 10147"If <varname>force</varname> is set to true, no tests are done to ensure " 10148"compatibility (e.g. alignment, pixel support) between the external raster " 10149"file and the PostGIS raster. This mode is intended for file system changes " 10150"where the external raster resides." 10151msgstr "" 10152 10153#. Tag: para 10154#: reference_raster.xml:5089 reference_raster.xml:5142 10155#, no-c-format 10156msgid "" 10157"Internally, this method replaces the PostGIS raster's band at index " 10158"<varname>band</varname> with a new band instead of updating the existing " 10159"path information." 10160msgstr "" 10161 10162#. Tag: programlisting 10163#: reference_raster.xml:5099 10164#, no-c-format 10165msgid "" 10166"WITH foo AS (\n" 10167" SELECT\n" 10168" ST_AddBand(NULL::raster, '/home/pele/devel/geo/postgis-git/" 10169"raster/test/regress/loader/Projected.tif', NULL::int[]) AS rast\n" 10170")\n" 10171"SELECT\n" 10172" 1 AS query,\n" 10173" *\n" 10174"FROM ST_BandMetadata(\n" 10175" (SELECT rast FROM foo),\n" 10176" ARRAY[1,3,2]::int[]\n" 10177")\n" 10178"UNION ALL\n" 10179"SELECT\n" 10180" 2,\n" 10181" *\n" 10182"FROM ST_BandMetadata(\n" 10183" (\n" 10184" SELECT\n" 10185" <emphasis role=\"strong\">ST_SetBandPath(\n" 10186" rast,\n" 10187" 2,\n" 10188" '/home/pele/devel/geo/postgis-git/raster/" 10189"test/regress/loader/Projected2.tif',\n" 10190" 1\n" 10191" )</emphasis> AS rast\n" 10192" FROM foo\n" 10193" ),\n" 10194" ARRAY[1,3,2]::int[]\n" 10195")\n" 10196"ORDER BY 1, 2;\n" 10197"\n" 10198" query | bandnum | pixeltype | nodatavalue | isoutdb " 10199"| " 10200"path | outdbbandnum\n" 10201"-------+---------+-----------+-------------+---------" 10202"+---------------------------------------------------------------------------------" 10203"+--------------\n" 10204" 1 | 1 | 8BUI | | t | /home/pele/devel/geo/" 10205"postgis-git/raster/test/regress/loader/Projected.tif | 1\n" 10206" 1 | 2 | 8BUI | | t | /home/pele/devel/geo/" 10207"postgis-git/raster/test/regress/loader/Projected.tif | 2\n" 10208" 1 | 3 | 8BUI | | t | /home/pele/devel/geo/" 10209"postgis-git/raster/test/regress/loader/Projected.tif | 3\n" 10210" 2 | 1 | 8BUI | | t | /home/pele/devel/geo/" 10211"postgis-git/raster/test/regress/loader/Projected.tif | 1\n" 10212"<emphasis role=\"strong\"> 2 | 2 | 8BUI | | " 10213"t | /home/pele/devel/geo/postgis-git/raster/test/regress/loader/" 10214"Projected2.tif | 1</emphasis>\n" 10215" 2 | 3 | 8BUI | | t | /home/pele/devel/geo/" 10216"postgis-git/raster/test/regress/loader/Projected.tif | 3" 10217msgstr "" 10218 10219#. Tag: para 10220#: reference_raster.xml:5104 10221#, fuzzy, no-c-format 10222msgid ", <xref linkend=\"RT_ST_SetBandIndex\"/>" 10223msgstr ", <xref linkend=\"RT_ST_SetSRID\"/>" 10224 10225#. Tag: refname 10226#: reference_raster.xml:5114 10227#, fuzzy, no-c-format 10228msgid "ST_SetBandIndex" 10229msgstr "ST_SetBandIsNoData" 10230 10231#. Tag: refpurpose 10232#: reference_raster.xml:5115 10233#, no-c-format 10234msgid "Update the external band number of an out-db band" 10235msgstr "" 10236 10237#. Tag: funcprototype 10238#: reference_raster.xml:5120 10239#, fuzzy, no-c-format 10240msgid "" 10241"<funcdef>raster <function>ST_SetBandIndex</function></funcdef> " 10242"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 10243"<paramdef><type>integer </type> <parameter>band</parameter></paramdef> " 10244"<paramdef><type>integer </type> <parameter>outdbindex</parameter></paramdef> " 10245"<paramdef choice=\"opt\"><type>boolean </type> <parameter>force=false</" 10246"parameter></paramdef>" 10247msgstr "" 10248"<funcdef>bytea <function>ST_AsGDALRaster</function></funcdef> " 10249"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 10250"<paramdef><type>text </type> <parameter>format</parameter></paramdef> " 10251"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=NULL</" 10252"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 10253"<parameter>srid=sameassource</parameter></paramdef>" 10254 10255#. Tag: para 10256#: reference_raster.xml:5133 10257#, no-c-format 10258msgid "" 10259"Updates an out-db band's external band number. This does not touch the " 10260"external raster file associated with the out-db band" 10261msgstr "" 10262 10263#. Tag: para 10264#: reference_raster.xml:5136 10265#, no-c-format 10266msgid "" 10267"If <varname>force</varname> is set to true, no tests are done to ensure " 10268"compatibility (e.g. alignment, pixel support) between the external raster " 10269"file and the PostGIS raster. This mode is intended for where bands are moved " 10270"around in the external raster file." 10271msgstr "" 10272 10273#. Tag: programlisting 10274#: reference_raster.xml:5152 10275#, no-c-format 10276msgid "" 10277"WITH foo AS (\n" 10278" SELECT\n" 10279" ST_AddBand(NULL::raster, '/home/pele/devel/geo/postgis-git/" 10280"raster/test/regress/loader/Projected.tif', NULL::int[]) AS rast\n" 10281")\n" 10282"SELECT\n" 10283" 1 AS query,\n" 10284" *\n" 10285"FROM ST_BandMetadata(\n" 10286" (SELECT rast FROM foo),\n" 10287" ARRAY[1,3,2]::int[]\n" 10288")\n" 10289"UNION ALL\n" 10290"SELECT\n" 10291" 2,\n" 10292" *\n" 10293"FROM ST_BandMetadata(\n" 10294" (\n" 10295" SELECT\n" 10296" <emphasis role=\"strong\">ST_SetBandIndex(\n" 10297" rast,\n" 10298" 2,\n" 10299" 1\n" 10300" )</emphasis> AS rast\n" 10301" FROM foo\n" 10302" ),\n" 10303" ARRAY[1,3,2]::int[]\n" 10304")\n" 10305"ORDER BY 1, 2;\n" 10306"\n" 10307" query | bandnum | pixeltype | nodatavalue | isoutdb " 10308"| " 10309"path | outdbbandnum\n" 10310"-------+---------+-----------+-------------+---------" 10311"+---------------------------------------------------------------------------------" 10312"+--------------\n" 10313" 1 | 1 | 8BUI | | t | /home/pele/devel/geo/" 10314"postgis-git/raster/test/regress/loader/Projected.tif | 1\n" 10315" 1 | 2 | 8BUI | | t | /home/pele/devel/geo/" 10316"postgis-git/raster/test/regress/loader/Projected.tif | 2\n" 10317" 1 | 3 | 8BUI | | t | /home/pele/devel/geo/" 10318"postgis-git/raster/test/regress/loader/Projected.tif | 3\n" 10319" 2 | 1 | 8BUI | | t | /home/pele/devel/geo/" 10320"postgis-git/raster/test/regress/loader/Projected.tif | 1\n" 10321"<emphasis role=\"strong\"> 2 | 2 | 8BUI | | " 10322"t | /home/pele/devel/geo/postgis-git/raster/test/regress/loader/" 10323"Projected.tif | 1</emphasis>\n" 10324" 2 | 3 | 8BUI | | t | /home/pele/devel/geo/" 10325"postgis-git/raster/test/regress/loader/Projected.tif | 3" 10326msgstr "" 10327 10328#. Tag: para 10329#: reference_raster.xml:5157 10330#, fuzzy, no-c-format 10331msgid ", <xref linkend=\"RT_ST_SetBandPath\"/>" 10332msgstr ", <xref linkend=\"RT_ST_SetBandNoDataValue\"/>" 10333 10334#. Tag: title 10335#: reference_raster.xml:5168 10336#, no-c-format 10337msgid "Raster Band Statistics and Analytics" 10338msgstr "" 10339 10340#. Tag: refname 10341#: reference_raster.xml:5172 10342#, no-c-format 10343msgid "ST_Count" 10344msgstr "ST_Count" 10345 10346#. Tag: refpurpose 10347#: reference_raster.xml:5173 10348#, no-c-format 10349msgid "" 10350"Returns the number of pixels in a given band of a raster or raster coverage. " 10351"If no band is specified defaults to band 1. If exclude_nodata_value is set " 10352"to true, will only count pixels that are not equal to the nodata value." 10353msgstr "" 10354 10355#. Tag: funcsynopsis 10356#: reference_raster.xml:5177 10357#, no-c-format 10358msgid "" 10359"<funcprototype> <funcdef>bigint <function>ST_Count</function></funcdef> " 10360"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 10361"<paramdef choice=\"opt\"><type>integer </type> <parameter>nband=1</" 10362"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 10363"<parameter>exclude_nodata_value=true</parameter></paramdef> </funcprototype> " 10364"<funcprototype> <funcdef>bigint <function>ST_Count</function></funcdef> " 10365"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 10366"<paramdef><type>boolean </type> <parameter>exclude_nodata_value</parameter></" 10367"paramdef> </funcprototype> <funcprototype> <funcdef>bigint " 10368"<function>ST_Count</function></funcdef> <paramdef><type>text </type> " 10369"<parameter>rastertable</parameter></paramdef> <paramdef><type>text </type> " 10370"<parameter>rastercolumn</parameter></paramdef> <paramdef choice=\"opt" 10371"\"><type>integer </type> <parameter>nband=1</parameter></paramdef> <paramdef " 10372"choice=\"opt\"><type>boolean </type> <parameter>exclude_nodata_value=true</" 10373"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>bigint " 10374"<function>ST_Count</function></funcdef> <paramdef><type>text </type> " 10375"<parameter>rastertable</parameter></paramdef> <paramdef><type>text </type> " 10376"<parameter>rastercolumn</parameter></paramdef> <paramdef><type>boolean </" 10377"type> <parameter>exclude_nodata_value</parameter></paramdef> </funcprototype>" 10378msgstr "" 10379 10380#. Tag: para 10381#: reference_raster.xml:5208 10382#, no-c-format 10383msgid "" 10384"Returns the number of pixels in a given band of a raster or raster coverage. " 10385"If no band is specified <varname>nband</varname> defaults to 1." 10386msgstr "" 10387 10388#. Tag: para 10389#: reference_raster.xml:5209 10390#, no-c-format 10391msgid "" 10392"If <varname>exclude_nodata_value</varname> is set to true, will only count " 10393"pixels with value not equal to the <varname>nodata</varname> value of the " 10394"raster. Set <varname>exclude_nodata_value</varname> to false to get count " 10395"all pixels" 10396msgstr "" 10397 10398#. Tag: para 10399#: reference_raster.xml:5213 10400#, no-c-format 10401msgid "" 10402"The ST_Count(rastertable, rastercolumn, ...) variants are deprecated as of " 10403"2.2.0. Use <xref linkend=\"RT_ST_CountAgg\"/> instead." 10404msgstr "" 10405 10406#. Tag: programlisting 10407#: reference_raster.xml:5223 10408#, no-c-format 10409msgid "" 10410"--example will count all pixels not 249 and one will count all pixels. --\n" 10411"SELECT rid, ST_Count(ST_SetBandNoDataValue(rast,249)) As exclude_nodata,\n" 10412" ST_Count(ST_SetBandNoDataValue(rast,249),false) As include_nodata\n" 10413" FROM dummy_rast WHERE rid=2;\n" 10414"\n" 10415"rid | exclude_nodata | include_nodata\n" 10416"-----+----------------+----------------\n" 10417" 2 | 23 | 25" 10418msgstr "" 10419 10420#. Tag: para 10421#: reference_raster.xml:5228 reference_raster.xml:5289 10422#, no-c-format 10423msgid "" 10424", <xref linkend=\"RT_ST_SummaryStats\"/>, <xref linkend=" 10425"\"RT_ST_SetBandNoDataValue\"/>" 10426msgstr "" 10427 10428#. Tag: refname 10429#: reference_raster.xml:5238 10430#, no-c-format 10431msgid "ST_CountAgg" 10432msgstr "" 10433 10434#. Tag: refpurpose 10435#: reference_raster.xml:5239 10436#, no-c-format 10437msgid "" 10438"Aggregate. Returns the number of pixels in a given band of a set of rasters. " 10439"If no band is specified defaults to band 1. If exclude_nodata_value is set " 10440"to true, will only count pixels that are not equal to the NODATA value." 10441msgstr "" 10442 10443#. Tag: funcsynopsis 10444#: reference_raster.xml:5245 10445#, no-c-format 10446msgid "" 10447"<funcprototype> <funcdef>bigint <function>ST_CountAgg</function></funcdef> " 10448"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 10449"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 10450"<paramdef><type>boolean </type> <parameter>exclude_nodata_value</parameter></" 10451"paramdef> <paramdef><type>double precision </type> " 10452"<parameter>sample_percent</parameter></paramdef> </funcprototype> " 10453"<funcprototype> <funcdef>bigint <function>ST_CountAgg</function></funcdef> " 10454"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 10455"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 10456"<paramdef><type>boolean </type> <parameter>exclude_nodata_value</parameter></" 10457"paramdef> </funcprototype> <funcprototype> <funcdef>bigint " 10458"<function>ST_CountAgg</function></funcdef> <paramdef><type>raster </type> " 10459"<parameter>rast</parameter></paramdef> <paramdef><type>boolean </type> " 10460"<parameter>exclude_nodata_value</parameter></paramdef> </funcprototype>" 10461msgstr "" 10462 10463#. Tag: para 10464#: reference_raster.xml:5273 10465#, no-c-format 10466msgid "" 10467"Returns the number of pixels in a given band of a set of rasters. If no band " 10468"is specified <varname>nband</varname> defaults to 1." 10469msgstr "" 10470 10471#. Tag: para 10472#: reference_raster.xml:5274 10473#, no-c-format 10474msgid "" 10475"If <varname>exclude_nodata_value</varname> is set to true, will only count " 10476"pixels with value not equal to the <varname>NODATA</varname> value of the " 10477"raster. Set <varname>exclude_nodata_value</varname> to false to get count " 10478"all pixels" 10479msgstr "" 10480 10481#. Tag: para 10482#: reference_raster.xml:5277 10483#, no-c-format 10484msgid "" 10485"By default will sample all pixels. To get faster response, set " 10486"<varname>sample_percent</varname> to value between zero (0) and one (1)" 10487msgstr "" 10488 10489#. Tag: programlisting 10490#: reference_raster.xml:5284 10491#, fuzzy, no-c-format 10492msgid "" 10493"WITH foo AS (\n" 10494" SELECT\n" 10495" rast.rast\n" 10496" FROM (\n" 10497" SELECT ST_SetValue(\n" 10498" ST_SetValue(\n" 10499" ST_SetValue(\n" 10500" ST_AddBand(\n" 10501" ST_MakeEmptyRaster(10, 10, " 10502"10, 10, 2, 2, 0, 0,0)\n" 10503" , 1, '64BF', 0, 0\n" 10504" )\n" 10505" , 1, 1, 1, -10\n" 10506" )\n" 10507" , 1, 5, 4, 0\n" 10508" )\n" 10509" , 1, 5, 5, 3.14159\n" 10510" ) AS rast\n" 10511" ) AS rast\n" 10512" FULL JOIN (\n" 10513" SELECT generate_series(1, 10) AS id\n" 10514" ) AS id\n" 10515" ON 1 = 1\n" 10516")\n" 10517"SELECT\n" 10518" ST_CountAgg(rast, 1, TRUE)\n" 10519"FROM foo;\n" 10520"\n" 10521" st_countagg\n" 10522"-------------\n" 10523" 20\n" 10524"(1 row)" 10525msgstr "" 10526"-- un pixel 2x2 ha valore\n" 10527"SELECT\n" 10528" ST_Neighborhood(rast, 2, 2, 1, 1)\n" 10529"FROM (\n" 10530" SELECT\n" 10531" ST_SetValues(\n" 10532" ST_AddBand(\n" 10533" ST_MakeEmptyRaster(5, 5, -2, 2, 1, -1, 0, 0, " 10534"0),\n" 10535" '8BUI'::text, 1, 0\n" 10536" ),\n" 10537" 1, 1, 1, ARRAY[\n" 10538" [0, 1, 1, 1, 1],\n" 10539" [1, 1, 1, 0, 1],\n" 10540" [1, 0, 1, 1, 1],\n" 10541" [1, 1, 1, 1, 0],\n" 10542" [1, 1, 0, 1, 1]\n" 10543" ]::double precision[],\n" 10544" 1\n" 10545" ) AS rast\n" 10546") AS foo\n" 10547"\n" 10548" st_neighborhood \n" 10549"---------------------------------\n" 10550" {{NULL,1,1},{1,1,NULL},{1,1,1}}" 10551 10552#. Tag: refname 10553#: reference_raster.xml:5299 10554#, no-c-format 10555msgid "ST_Histogram" 10556msgstr "ST_Histogram" 10557 10558#. Tag: refpurpose 10559#: reference_raster.xml:5300 10560#, no-c-format 10561msgid "" 10562"Returns a set of record summarizing a raster or raster coverage data " 10563"distribution separate bin ranges. Number of bins are autocomputed if not " 10564"specified." 10565msgstr "" 10566 10567#. Tag: funcsynopsis 10568#: reference_raster.xml:5304 10569#, no-c-format 10570msgid "" 10571"<funcprototype> <funcdef>SETOF record <function>ST_Histogram</function></" 10572"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 10573"paramdef> <paramdef choice=\"opt\"><type>integer </type> <parameter>nband=1</" 10574"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 10575"<parameter>exclude_nodata_value=true</parameter></paramdef> <paramdef choice=" 10576"\"opt\"><type>integer </type> <parameter>bins=autocomputed</parameter></" 10577"paramdef> <paramdef choice=\"opt\"><type>double precision[] </type> " 10578"<parameter>width=NULL</parameter></paramdef> <paramdef choice=\"opt" 10579"\"><type>boolean </type> <parameter>right=false</parameter></paramdef> </" 10580"funcprototype> <funcprototype> <funcdef>SETOF record <function>ST_Histogram</" 10581"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 10582"parameter></paramdef> <paramdef><type>integer </type> <parameter>nband</" 10583"parameter></paramdef> <paramdef><type>integer </type> <parameter>bins</" 10584"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision[] </" 10585"type> <parameter>width=NULL</parameter></paramdef> <paramdef choice=\"opt" 10586"\"><type>boolean </type> <parameter>right=false</parameter></paramdef> </" 10587"funcprototype> <funcprototype> <funcdef>SETOF record <function>ST_Histogram</" 10588"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 10589"parameter></paramdef> <paramdef><type>integer </type> <parameter>nband</" 10590"parameter></paramdef> <paramdef><type>boolean </type> " 10591"<parameter>exclude_nodata_value</parameter></paramdef> " 10592"<paramdef><type>integer </type> <parameter>bins</parameter></paramdef> " 10593"<paramdef><type>boolean </type> <parameter>right</parameter></paramdef> </" 10594"funcprototype> <funcprototype> <funcdef>SETOF record <function>ST_Histogram</" 10595"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 10596"parameter></paramdef> <paramdef><type>integer </type> <parameter>nband</" 10597"parameter></paramdef> <paramdef><type>integer </type> <parameter>bins</" 10598"parameter></paramdef> <paramdef><type>boolean </type> <parameter>right</" 10599"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>SETOF record " 10600"<function>ST_Histogram</function></funcdef> <paramdef><type>text </type> " 10601"<parameter>rastertable</parameter></paramdef> <paramdef><type>text </type> " 10602"<parameter>rastercolumn</parameter></paramdef> <paramdef><type>integer </" 10603"type> <parameter>nband</parameter></paramdef> <paramdef><type>integer </" 10604"type> <parameter>bins</parameter></paramdef> <paramdef><type>boolean </type> " 10605"<parameter>right</parameter></paramdef> </funcprototype> <funcprototype> " 10606"<funcdef>SETOF record <function>ST_Histogram</function></funcdef> " 10607"<paramdef><type>text </type> <parameter>rastertable</parameter></paramdef> " 10608"<paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef> " 10609"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 10610"<paramdef><type>boolean </type> <parameter>exclude_nodata_value</parameter></" 10611"paramdef> <paramdef><type>integer </type> <parameter>bins</parameter></" 10612"paramdef> <paramdef><type>boolean </type> <parameter>right</parameter></" 10613"paramdef> </funcprototype> <funcprototype> <funcdef>SETOF record " 10614"<function>ST_Histogram</function></funcdef> <paramdef><type>text </type> " 10615"<parameter>rastertable</parameter></paramdef> <paramdef><type>text </type> " 10616"<parameter>rastercolumn</parameter></paramdef> <paramdef choice=\"opt" 10617"\"><type>integer </type> <parameter>nband=1</parameter></paramdef> <paramdef " 10618"choice=\"opt\"><type>boolean </type> <parameter>exclude_nodata_value=true</" 10619"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 10620"<parameter>bins=autocomputed</parameter></paramdef> <paramdef choice=\"opt" 10621"\"><type>double precision[] </type> <parameter>width=NULL</parameter></" 10622"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 10623"<parameter>right=false</parameter></paramdef> </funcprototype> " 10624"<funcprototype> <funcdef>SETOF record <function>ST_Histogram</function></" 10625"funcdef> <paramdef><type>text </type> <parameter>rastertable</parameter></" 10626"paramdef> <paramdef><type>text </type> <parameter>rastercolumn</parameter></" 10627"paramdef> <paramdef choice=\"opt\"><type>integer </type> <parameter>nband=1</" 10628"parameter></paramdef> <paramdef><type>integer </type> <parameter>bins</" 10629"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision[] </" 10630"type> <parameter>width=NULL</parameter></paramdef> <paramdef choice=\"opt" 10631"\"><type>boolean </type> <parameter>right=false</parameter></paramdef> </" 10632"funcprototype>" 10633msgstr "" 10634"<funcprototype> <funcdef>SETOF record <function>ST_Histogram</function></" 10635"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 10636"paramdef> <paramdef choice=\"opt\"><type>integer </type> <parameter>nband=1</" 10637"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 10638"<parameter>exclude_nodata_value=true</parameter></paramdef> <paramdef choice=" 10639"\"opt\"><type>integer </type> <parameter>bins=autocomputed</parameter></" 10640"paramdef> <paramdef choice=\"opt\"><type>double precision[] </type> " 10641"<parameter>width=NULL</parameter></paramdef> <paramdef choice=\"opt" 10642"\"><type>boolean </type> <parameter>right=false</parameter></paramdef> </" 10643"funcprototype> <funcprototype> <funcdef>SETOF record <function>ST_Histogram</" 10644"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 10645"parameter></paramdef> <paramdef><type>integer </type> <parameter>nband</" 10646"parameter></paramdef> <paramdef><type>integer </type> <parameter>bins</" 10647"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision[] </" 10648"type> <parameter>width=NULL</parameter></paramdef> <paramdef choice=\"opt" 10649"\"><type>boolean </type> <parameter>right=false</parameter></paramdef> </" 10650"funcprototype> <funcprototype> <funcdef>SETOF record <function>ST_Histogram</" 10651"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 10652"parameter></paramdef> <paramdef><type>integer </type> <parameter>nband</" 10653"parameter></paramdef> <paramdef><type>boolean </type> " 10654"<parameter>exclude_nodata_value</parameter></paramdef> " 10655"<paramdef><type>integer </type> <parameter>bins</parameter></paramdef> " 10656"<paramdef><type>boolean </type> <parameter>right</parameter></paramdef> </" 10657"funcprototype> <funcprototype> <funcdef>SETOF record <function>ST_Histogram</" 10658"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 10659"parameter></paramdef> <paramdef><type>integer </type> <parameter>nband</" 10660"parameter></paramdef> <paramdef><type>integer </type> <parameter>bins</" 10661"parameter></paramdef> <paramdef><type>boolean </type> <parameter>right</" 10662"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>SETOF record " 10663"<function>ST_Histogram</function></funcdef> <paramdef><type>text </type> " 10664"<parameter>rastertable</parameter></paramdef> <paramdef><type>text </type> " 10665"<parameter>rastercolumn</parameter></paramdef> <paramdef><type>integer </" 10666"type> <parameter>nband</parameter></paramdef> <paramdef><type>integer </" 10667"type> <parameter>bins</parameter></paramdef> <paramdef><type>boolean </type> " 10668"<parameter>right</parameter></paramdef> </funcprototype> <funcprototype> " 10669"<funcdef>SETOF record <function>ST_Histogram</function></funcdef> " 10670"<paramdef><type>text </type> <parameter>rastertable</parameter></paramdef> " 10671"<paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef> " 10672"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 10673"<paramdef><type>boolean </type> <parameter>exclude_nodata_value</parameter></" 10674"paramdef> <paramdef><type>integer </type> <parameter>bins</parameter></" 10675"paramdef> <paramdef><type>boolean </type> <parameter>right</parameter></" 10676"paramdef> </funcprototype> <funcprototype> <funcdef>SETOF record " 10677"<function>ST_Histogram</function></funcdef> <paramdef><type>text </type> " 10678"<parameter>rastertable</parameter></paramdef> <paramdef><type>text </type> " 10679"<parameter>rastercolumn</parameter></paramdef> <paramdef choice=\"opt" 10680"\"><type>integer </type> <parameter>nband=1</parameter></paramdef> <paramdef " 10681"choice=\"opt\"><type>boolean </type> <parameter>exclude_nodata_value=true</" 10682"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 10683"<parameter>bins=autocomputed</parameter></paramdef> <paramdef choice=\"opt" 10684"\"><type>double precision[] </type> <parameter>width=NULL</parameter></" 10685"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 10686"<parameter>right=false</parameter></paramdef> </funcprototype> " 10687"<funcprototype> <funcdef>SETOF record <function>ST_Histogram</function></" 10688"funcdef> <paramdef><type>text </type> <parameter>rastertable</parameter></" 10689"paramdef> <paramdef><type>text </type> <parameter>rastercolumn</parameter></" 10690"paramdef> <paramdef choice=\"opt\"><type>integer </type> <parameter>nband=1</" 10691"parameter></paramdef> <paramdef><type>integer </type> <parameter>bins</" 10692"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision[] </" 10693"type> <parameter>width=NULL</parameter></paramdef> <paramdef choice=\"opt" 10694"\"><type>boolean </type> <parameter>right=false</parameter></paramdef> </" 10695"funcprototype>" 10696 10697#. Tag: para 10698#: reference_raster.xml:5386 10699#, no-c-format 10700msgid "" 10701"Returns set of records consisting of min, max, count, percent for a given " 10702"raster band for each bin. If no band is specified <varname>nband</varname> " 10703"defaults to 1." 10704msgstr "" 10705 10706#. Tag: para 10707#: reference_raster.xml:5387 10708#, no-c-format 10709msgid "" 10710"By default only considers pixel values not equal to the <varname>nodata</" 10711"varname> value . Set <varname>exclude_nodata_value</varname> to false to get " 10712"count all pixels." 10713msgstr "" 10714 10715#. Tag: term 10716#: reference_raster.xml:5391 10717#, no-c-format 10718msgid "<parameter>width </parameter><type>double precision[]</type>" 10719msgstr "" 10720 10721#. Tag: para 10722#: reference_raster.xml:5392 10723#, no-c-format 10724msgid "" 10725"width: an array indicating the width of each category/bin. If the number of " 10726"bins is greater than the number of widths, the widths are repeated." 10727msgstr "" 10728 10729#. Tag: para 10730#: reference_raster.xml:5393 10731#, no-c-format 10732msgid "" 10733"Example: 9 bins, widths are [a, b, c] will have the output be [a, b, c, a, " 10734"b, c, a, b, c]" 10735msgstr "" 10736 10737#. Tag: term 10738#: reference_raster.xml:5396 10739#, no-c-format 10740msgid "<parameter>bins </parameter><type>integer</type>" 10741msgstr "" 10742 10743#. Tag: para 10744#: reference_raster.xml:5397 10745#, no-c-format 10746msgid "" 10747"Number of breakouts -- this is the number of records you'll get back from " 10748"the function if specified. If not specified then the number of breakouts is " 10749"autocomputed." 10750msgstr "" 10751 10752#. Tag: term 10753#: reference_raster.xml:5401 10754#, no-c-format 10755msgid "<parameter>right </parameter><type>boolean</type>" 10756msgstr "" 10757 10758#. Tag: para 10759#: reference_raster.xml:5402 10760#, no-c-format 10761msgid "" 10762"compute the histogram from the right rather than from the left (default). " 10763"This changes the criteria for evaluating a value x from [a, b) to (a, b]" 10764msgstr "" 10765 10766#. Tag: title 10767#: reference_raster.xml:5409 10768#, no-c-format 10769msgid "" 10770"Example: Single raster tile - compute histograms for bands 1, 2, 3 and " 10771"autocompute bins" 10772msgstr "" 10773 10774#. Tag: programlisting 10775#: reference_raster.xml:5410 10776#, fuzzy, no-c-format 10777msgid "" 10778"SELECT band, (stats).*\n" 10779"FROM (SELECT rid, band, ST_Histogram(rast, band) As stats\n" 10780" FROM dummy_rast CROSS JOIN generate_series(1,3) As band\n" 10781" WHERE rid=2) As foo;\n" 10782"\n" 10783" band | min | max | count | percent\n" 10784"------+-------+-------+-------+---------\n" 10785" 1 | 249 | 250 | 2 | 0.08\n" 10786" 1 | 250 | 251 | 2 | 0.08\n" 10787" 1 | 251 | 252 | 1 | 0.04\n" 10788" 1 | 252 | 253 | 2 | 0.08\n" 10789" 1 | 253 | 254 | 18 | 0.72\n" 10790" 2 | 78 | 113.2 | 11 | 0.44\n" 10791" 2 | 113.2 | 148.4 | 4 | 0.16\n" 10792" 2 | 148.4 | 183.6 | 4 | 0.16\n" 10793" 2 | 183.6 | 218.8 | 1 | 0.04\n" 10794" 2 | 218.8 | 254 | 5 | 0.2\n" 10795" 3 | 62 | 100.4 | 11 | 0.44\n" 10796" 3 | 100.4 | 138.8 | 5 | 0.2\n" 10797" 3 | 138.8 | 177.2 | 4 | 0.16\n" 10798" 3 | 177.2 | 215.6 | 1 | 0.04\n" 10799" 3 | 215.6 | 254 | 4 | 0.16" 10800msgstr "" 10801"SELECT band, (stats).*\n" 10802"FROM (SELECT rid, band, ST_Histogram(rast, band) As stats\n" 10803" FROM dummy_rast CROSS JOIN generate_series(1,3) As band\n" 10804" WHERE rid=2) As foo;\n" 10805" \n" 10806" band | min | max | count | percent\n" 10807"------+-------+-------+-------+---------\n" 10808" 1 | 249 | 250 | 2 | 0.08\n" 10809" 1 | 250 | 251 | 2 | 0.08\n" 10810" 1 | 251 | 252 | 1 | 0.04\n" 10811" 1 | 252 | 253 | 2 | 0.08\n" 10812" 1 | 253 | 254 | 18 | 0.72\n" 10813" 2 | 78 | 113.2 | 11 | 0.44\n" 10814" 2 | 113.2 | 148.4 | 4 | 0.16\n" 10815" 2 | 148.4 | 183.6 | 4 | 0.16\n" 10816" 2 | 183.6 | 218.8 | 1 | 0.04\n" 10817" 2 | 218.8 | 254 | 5 | 0.2\n" 10818" 3 | 62 | 100.4 | 11 | 0.44\n" 10819" 3 | 100.4 | 138.8 | 5 | 0.2\n" 10820" 3 | 138.8 | 177.2 | 4 | 0.16\n" 10821" 3 | 177.2 | 215.6 | 1 | 0.04\n" 10822" 3 | 215.6 | 254 | 4 | 0.16" 10823 10824#. Tag: title 10825#: reference_raster.xml:5414 10826#, no-c-format 10827msgid "Example: Just band 2 but for 6 bins" 10828msgstr "" 10829 10830#. Tag: programlisting 10831#: reference_raster.xml:5415 10832#, no-c-format 10833msgid "" 10834"SELECT (stats).*\n" 10835"FROM (SELECT rid, ST_Histogram(rast, 2,6) As stats\n" 10836" FROM dummy_rast\n" 10837" WHERE rid=2) As foo;\n" 10838"\n" 10839" min | max | count | percent\n" 10840"------------+------------+-------+---------\n" 10841" 78 | 107.333333 | 9 | 0.36\n" 10842" 107.333333 | 136.666667 | 6 | 0.24\n" 10843" 136.666667 | 166 | 0 | 0\n" 10844" 166 | 195.333333 | 4 | 0.16\n" 10845" 195.333333 | 224.666667 | 1 | 0.04\n" 10846" 224.666667 | 254 | 5 | 0.2\n" 10847"(6 rows)\n" 10848"\n" 10849"-- Same as previous but we explicitly control the pixel value range of each " 10850"bin.\n" 10851"SELECT (stats).*\n" 10852"FROM (SELECT rid, ST_Histogram(rast, 2,6,ARRAY[0.5,1,4,100,5]) As stats\n" 10853" FROM dummy_rast\n" 10854" WHERE rid=2) As foo;\n" 10855"\n" 10856" min | max | count | percent\n" 10857"-------+-------+-------+----------\n" 10858" 78 | 78.5 | 1 | 0.08\n" 10859" 78.5 | 79.5 | 1 | 0.04\n" 10860" 79.5 | 83.5 | 0 | 0\n" 10861" 83.5 | 183.5 | 17 | 0.0068\n" 10862" 183.5 | 188.5 | 0 | 0\n" 10863" 188.5 | 254 | 6 | 0.003664\n" 10864"(6 rows)" 10865msgstr "" 10866 10867#. Tag: para 10868#: reference_raster.xml:5420 10869#, no-c-format 10870msgid "" 10871", <xref linkend=\"RT_ST_SummaryStats\"/>, <xref linkend=" 10872"\"RT_ST_SummaryStatsAgg\"/>" 10873msgstr "" 10874 10875#. Tag: refname 10876#: reference_raster.xml:5430 10877#, no-c-format 10878msgid "ST_Quantile" 10879msgstr "ST_Quantile" 10880 10881#. Tag: refpurpose 10882#: reference_raster.xml:5431 10883#, no-c-format 10884msgid "" 10885"<refpurpose>Compute quantiles for a raster or raster table coverage in the " 10886"context of the sample or population. Thus, a value could be examined to be " 10887"at the raster's 25%, 50%, 75% percentile.</refpurpose>" 10888msgstr "" 10889 10890#. Tag: funcsynopsis 10891#: reference_raster.xml:5435 10892#, no-c-format 10893msgid "" 10894"<funcprototype> <funcdef>SETOF record <function>ST_Quantile</function></" 10895"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 10896"paramdef> <paramdef choice=\"opt\"><type>integer </type> <parameter>nband=1</" 10897"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 10898"<parameter>exclude_nodata_value=true</parameter></paramdef> <paramdef choice=" 10899"\"opt\"><type>double precision[] </type> <parameter>quantiles=NULL</" 10900"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>SETOF record " 10901"<function>ST_Quantile</function></funcdef> <paramdef><type>raster </type> " 10902"<parameter>rast</parameter></paramdef> <paramdef><type>double precision[] </" 10903"type> <parameter>quantiles</parameter></paramdef> </funcprototype> " 10904"<funcprototype> <funcdef>SETOF record <function>ST_Quantile</function></" 10905"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 10906"paramdef> <paramdef><type>integer </type> <parameter>nband</parameter></" 10907"paramdef> <paramdef><type>double precision[] </type> <parameter>quantiles</" 10908"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>double " 10909"precision <function>ST_Quantile</function></funcdef> <paramdef><type>raster " 10910"</type> <parameter>rast</parameter></paramdef> <paramdef><type>double " 10911"precision </type> <parameter>quantile</parameter></paramdef> </" 10912"funcprototype> <funcprototype> <funcdef>double precision " 10913"<function>ST_Quantile</function></funcdef> <paramdef><type>raster </type> " 10914"<parameter>rast</parameter></paramdef> <paramdef><type>boolean </type> " 10915"<parameter>exclude_nodata_value</parameter></paramdef> <paramdef choice=\"opt" 10916"\"><type>double precision </type> <parameter>quantile=NULL</parameter></" 10917"paramdef> </funcprototype> <funcprototype> <funcdef>double precision " 10918"<function>ST_Quantile</function></funcdef> <paramdef><type>raster </type> " 10919"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 10920"<parameter>nband</parameter></paramdef> <paramdef><type>double precision </" 10921"type> <parameter>quantile</parameter></paramdef> </funcprototype> " 10922"<funcprototype> <funcdef>double precision <function>ST_Quantile</function></" 10923"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 10924"paramdef> <paramdef><type>integer </type> <parameter>nband</parameter></" 10925"paramdef> <paramdef><type>boolean </type> <parameter>exclude_nodata_value</" 10926"parameter></paramdef> <paramdef><type>double precision </type> " 10927"<parameter>quantile</parameter></paramdef> </funcprototype> <funcprototype> " 10928"<funcdef>double precision <function>ST_Quantile</function></funcdef> " 10929"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 10930"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 10931"<paramdef><type>double precision </type> <parameter>quantile</parameter></" 10932"paramdef> </funcprototype> <funcprototype> <funcdef>SETOF record " 10933"<function>ST_Quantile</function></funcdef> <paramdef><type>text </type> " 10934"<parameter>rastertable</parameter></paramdef> <paramdef><type>text </type> " 10935"<parameter>rastercolumn</parameter></paramdef> <paramdef choice=\"opt" 10936"\"><type>integer </type> <parameter>nband=1</parameter></paramdef> <paramdef " 10937"choice=\"opt\"><type>boolean </type> <parameter>exclude_nodata_value=true</" 10938"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision[] </" 10939"type> <parameter>quantiles=NULL</parameter></paramdef> </funcprototype> " 10940"<funcprototype> <funcdef>SETOF record <function>ST_Quantile</function></" 10941"funcdef> <paramdef><type>text </type> <parameter>rastertable</parameter></" 10942"paramdef> <paramdef><type>text </type> <parameter>rastercolumn</parameter></" 10943"paramdef> <paramdef><type>integer </type> <parameter>nband</parameter></" 10944"paramdef> <paramdef><type>double precision[] </type> <parameter>quantiles</" 10945"parameter></paramdef> </funcprototype>" 10946msgstr "" 10947 10948#. Tag: para 10949#: reference_raster.xml:5507 10950#, no-c-format 10951msgid "" 10952"<para>Compute quantiles for a raster or raster table coverage in the context " 10953"of the sample or population. Thus, a value could be examined to be at the " 10954"raster's 25%, 50%, 75% percentile.</para>" 10955msgstr "" 10956 10957#. Tag: para 10958#: reference_raster.xml:5508 reference_raster.xml:5800 10959#, no-c-format 10960msgid "" 10961"If <varname>exclude_nodata_value</varname> is set to false, will also count " 10962"pixels with no data." 10963msgstr "" 10964 10965#. Tag: programlisting 10966#: reference_raster.xml:5515 10967#, no-c-format 10968msgid "" 10969"UPDATE dummy_rast SET rast = ST_SetBandNoDataValue(rast,249) WHERE rid=2;\n" 10970"--Example will consider only pixels of band 1 that are not 249 and in named " 10971"quantiles --\n" 10972"\n" 10973"SELECT (pvq).*\n" 10974"FROM (SELECT ST_Quantile(rast, ARRAY[0.25,0.75]) As pvq\n" 10975" FROM dummy_rast WHERE rid=2) As foo\n" 10976" ORDER BY (pvq).quantile;\n" 10977"\n" 10978" quantile | value\n" 10979"----------+-------\n" 10980" 0.25 | 253\n" 10981" 0.75 | 254\n" 10982"\n" 10983"SELECT ST_Quantile(rast, 0.75) As value\n" 10984" FROM dummy_rast WHERE rid=2;\n" 10985"\n" 10986"value\n" 10987"------\n" 10988" 254" 10989msgstr "" 10990 10991#. Tag: programlisting 10992#: reference_raster.xml:5516 10993#, no-c-format 10994msgid "" 10995"--real live example. Quantile of all pixels in band 2 intersecting a " 10996"geometry\n" 10997"SELECT rid, (ST_Quantile(rast,2)).* As pvc\n" 10998" FROM o_4_boston\n" 10999" WHERE ST_Intersects(rast,\n" 11000" ST_GeomFromText('POLYGON((224486 892151,224486 892200,224706 " 11001"892200,224706 892151,224486 892151))',26986)\n" 11002" )\n" 11003"ORDER BY value, quantile,rid\n" 11004";\n" 11005"\n" 11006"\n" 11007" rid | quantile | value\n" 11008"-----+----------+-------\n" 11009" 1 | 0 | 0\n" 11010" 2 | 0 | 0\n" 11011" 14 | 0 | 1\n" 11012" 15 | 0 | 2\n" 11013" 14 | 0.25 | 37\n" 11014" 1 | 0.25 | 42\n" 11015" 15 | 0.25 | 47\n" 11016" 2 | 0.25 | 50\n" 11017" 14 | 0.5 | 56\n" 11018" 1 | 0.5 | 64\n" 11019" 15 | 0.5 | 66\n" 11020" 2 | 0.5 | 77\n" 11021" 14 | 0.75 | 81\n" 11022" 15 | 0.75 | 87\n" 11023" 1 | 0.75 | 94\n" 11024" 2 | 0.75 | 106\n" 11025" 14 | 1 | 199\n" 11026" 1 | 1 | 244\n" 11027" 2 | 1 | 255\n" 11028" 15 | 1 | 255" 11029msgstr "" 11030 11031#. Tag: para 11032#: reference_raster.xml:5521 11033#, no-c-format 11034msgid "" 11035", <xref linkend=\"RT_ST_SummaryStats\"/>, <xref linkend=" 11036"\"RT_ST_SummaryStatsAgg\"/>, <xref linkend=\"RT_ST_SetBandNoDataValue\"/>" 11037msgstr "" 11038 11039#. Tag: refname 11040#: reference_raster.xml:5532 11041#, no-c-format 11042msgid "ST_SummaryStats" 11043msgstr "ST_SummaryStats" 11044 11045#. Tag: refpurpose 11046#: reference_raster.xml:5533 11047#, no-c-format 11048msgid "" 11049"Returns summarystats consisting of count, sum, mean, stddev, min, max for a " 11050"given raster band of a raster or raster coverage. Band 1 is assumed is no " 11051"band is specified." 11052msgstr "" 11053 11054#. Tag: funcsynopsis 11055#: reference_raster.xml:5537 11056#, no-c-format 11057msgid "" 11058"<funcprototype> <funcdef>summarystats <function>ST_SummaryStats</function></" 11059"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 11060"paramdef> <paramdef><type>boolean </type> <parameter>exclude_nodata_value</" 11061"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>summarystats " 11062"<function>ST_SummaryStats</function></funcdef> <paramdef><type>raster </" 11063"type> <parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 11064"<parameter>nband</parameter></paramdef> <paramdef><type>boolean </type> " 11065"<parameter>exclude_nodata_value</parameter></paramdef> </funcprototype> " 11066"<funcprototype> <funcdef>summarystats <function>ST_SummaryStats</function></" 11067"funcdef> <paramdef><type>text </type> <parameter>rastertable</parameter></" 11068"paramdef> <paramdef><type>text </type> <parameter>rastercolumn</parameter></" 11069"paramdef> <paramdef><type>boolean </type> <parameter>exclude_nodata_value</" 11070"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>summarystats " 11071"<function>ST_SummaryStats</function></funcdef> <paramdef><type>text </type> " 11072"<parameter>rastertable</parameter></paramdef> <paramdef><type>text </type> " 11073"<parameter>rastercolumn</parameter></paramdef> <paramdef choice=\"opt" 11074"\"><type>integer </type> <parameter>nband=1</parameter></paramdef> <paramdef " 11075"choice=\"opt\"><type>boolean </type> <parameter>exclude_nodata_value=true</" 11076"parameter></paramdef> </funcprototype>" 11077msgstr "" 11078 11079#. Tag: para 11080#: reference_raster.xml:5573 reference_raster.xml:5652 11081#, no-c-format 11082msgid "" 11083"Returns <xref linkend=\"summarystats\"/> consisting of count, sum, mean, " 11084"stddev, min, max for a given raster band of a raster or raster coverage. If " 11085"no band is specified <varname>nband</varname> defaults to 1." 11086msgstr "" 11087 11088#. Tag: para 11089#: reference_raster.xml:5575 11090#, no-c-format 11091msgid "" 11092"By default only considers pixel values not equal to the <varname>nodata</" 11093"varname> value. Set <varname>exclude_nodata_value</varname> to false to get " 11094"count of all pixels." 11095msgstr "" 11096 11097#. Tag: para 11098#: reference_raster.xml:5577 11099#, no-c-format 11100msgid "" 11101"By default will sample all pixels. To get faster response, set " 11102"<varname>sample_percent</varname> to lower than 1" 11103msgstr "" 11104 11105#. Tag: para 11106#: reference_raster.xml:5582 11107#, no-c-format 11108msgid "" 11109"The ST_SummaryStats(rastertable, rastercolumn, ...) variants are deprecated " 11110"as of 2.2.0. Use <xref linkend=\"RT_ST_SummaryStatsAgg\"/> instead." 11111msgstr "" 11112 11113#. Tag: title 11114#: reference_raster.xml:5590 11115#, no-c-format 11116msgid "Example: Single raster tile" 11117msgstr "" 11118 11119#. Tag: programlisting 11120#: reference_raster.xml:5591 11121#, fuzzy, no-c-format 11122msgid "" 11123"SELECT rid, band, (stats).*\n" 11124"FROM (SELECT rid, band, ST_SummaryStats(rast, band) As stats\n" 11125" FROM dummy_rast CROSS JOIN generate_series(1,3) As band\n" 11126" WHERE rid=2) As foo;\n" 11127"\n" 11128" rid | band | count | sum | mean | stddev | min | max\n" 11129"-----+------+-------+------+------------+-----------+-----+-----\n" 11130" 2 | 1 | 23 | 5821 | 253.086957 | 1.248061 | 250 | 254\n" 11131" 2 | 2 | 25 | 3682 | 147.28 | 59.862188 | 78 | 254\n" 11132" 2 | 3 | 25 | 3290 | 131.6 | 61.647384 | 62 | 254" 11133msgstr "" 11134"SELECT rid, band, (stats).*\n" 11135"FROM (SELECT rid, band, ST_SummaryStats(rast, band) As stats\n" 11136" FROM dummy_rast CROSS JOIN generate_series(1,3) As band\n" 11137" WHERE rid=2) As foo;\n" 11138" \n" 11139" rid | band | count | sum | mean | stddev | min | max\n" 11140"-----+------+-------+------+------------+-----------+-----+-----\n" 11141" 2 | 1 | 23 | 5821 | 253.086957 | 1.248061 | 250 | 254\n" 11142" 2 | 2 | 25 | 3682 | 147.28 | 59.862188 | 78 | 254\n" 11143" 2 | 3 | 25 | 3290 | 131.6 | 61.647384 | 62 | 254" 11144 11145#. Tag: title 11146#: reference_raster.xml:5595 11147#, no-c-format 11148msgid "Example: Summarize pixels that intersect buildings of interest" 11149msgstr "" 11150 11151#. Tag: para 11152#: reference_raster.xml:5596 11153#, no-c-format 11154msgid "" 11155"This example took 574ms on PostGIS windows 64-bit with all of Boston " 11156"Buildings and aerial Tiles (tiles each 150x150 pixels ~ 134,000 tiles), " 11157"~102,000 building records" 11158msgstr "" 11159 11160#. Tag: programlisting 11161#: reference_raster.xml:5598 11162#, no-c-format 11163msgid "" 11164"WITH\n" 11165"-- our features of interest\n" 11166" feat AS (SELECT gid As building_id, geom_26986 As geom FROM buildings AS " 11167"b\n" 11168" WHERE gid IN(100, 103,150)\n" 11169" ),\n" 11170"-- clip band 2 of raster tiles to boundaries of builds\n" 11171"-- then get stats for these clipped regions\n" 11172" b_stats AS\n" 11173" (SELECT building_id, (stats).*\n" 11174"FROM (SELECT building_id, ST_SummaryStats(ST_Clip(rast,2,geom)) As stats\n" 11175" FROM aerials.boston\n" 11176" INNER JOIN feat\n" 11177" ON ST_Intersects(feat.geom,rast)\n" 11178" ) As foo\n" 11179" )\n" 11180"-- finally summarize stats\n" 11181"SELECT building_id, SUM(count) As num_pixels\n" 11182" , MIN(min) As min_pval\n" 11183" , MAX(max) As max_pval\n" 11184" , SUM(mean*count)/SUM(count) As avg_pval\n" 11185" FROM b_stats\n" 11186" WHERE count > 0\n" 11187" GROUP BY building_id\n" 11188" ORDER BY building_id;\n" 11189" building_id | num_pixels | min_pval | max_pval | avg_pval\n" 11190"-------------+------------+----------+----------+------------------\n" 11191" 100 | 1090 | 1 | 255 | 61.0697247706422\n" 11192" 103 | 655 | 7 | 182 | 70.5038167938931\n" 11193" 150 | 895 | 2 | 252 | 185.642458100559" 11194msgstr "" 11195 11196#. Tag: title 11197#: reference_raster.xml:5602 11198#, no-c-format 11199msgid "Example: Raster coverage" 11200msgstr "" 11201 11202#. Tag: programlisting 11203#: reference_raster.xml:5603 11204#, no-c-format 11205msgid "" 11206"-- stats for each band --\n" 11207"SELECT band, (stats).*\n" 11208"FROM (SELECT band, ST_SummaryStats('o_4_boston','rast', band) As stats\n" 11209" FROM generate_series(1,3) As band) As foo;\n" 11210"\n" 11211" band | count | sum | mean | stddev | min | max\n" 11212"------+---------+--------+------------------+------------------+-----+-----\n" 11213" 1 | 8450000 | 725799 | 82.7064349112426 | 45.6800222638537 | 0 | 255\n" 11214" 2 | 8450000 | 700487 | 81.4197705325444 | 44.2161184161765 | 0 | 255\n" 11215" 3 | 8450000 | 575943 | 74.682739408284 | 44.2143885481407 | 0 | 255\n" 11216"\n" 11217"-- For a table -- will get better speed if set sampling to less than 100%\n" 11218"-- Here we set to 25% and get a much faster answer\n" 11219"SELECT band, (stats).*\n" 11220"FROM (SELECT band, ST_SummaryStats('o_4_boston','rast', band,true,0.25) As " 11221"stats\n" 11222" FROM generate_series(1,3) As band) As foo;\n" 11223"\n" 11224" band | count | sum | mean | stddev | min | max\n" 11225"------+---------+--------+------------------+------------------+-----+-----\n" 11226" 1 | 2112500 | 180686 | 82.6890480473373 | 45.6961043857248 | 0 | 255\n" 11227" 2 | 2112500 | 174571 | 81.448503668639 | 44.2252623171821 | 0 | 255\n" 11228" 3 | 2112500 | 144364 | 74.6765884023669 | 44.2014869384578 | 0 | 255" 11229msgstr "" 11230 11231#. Tag: para 11232#: reference_raster.xml:5608 11233#, no-c-format 11234msgid "" 11235", <xref linkend=\"RT_ST_SummaryStatsAgg\"/>, <xref linkend=\"RT_ST_Count\"/" 11236">, <xref linkend=\"RT_ST_Clip\"/>" 11237msgstr "" 11238 11239#. Tag: refname 11240#: reference_raster.xml:5619 11241#, no-c-format 11242msgid "ST_SummaryStatsAgg" 11243msgstr "" 11244 11245#. Tag: refpurpose 11246#: reference_raster.xml:5620 11247#, no-c-format 11248msgid "" 11249"Aggregate. Returns summarystats consisting of count, sum, mean, stddev, min, " 11250"max for a given raster band of a set of raster. Band 1 is assumed is no band " 11251"is specified." 11252msgstr "" 11253 11254#. Tag: funcsynopsis 11255#: reference_raster.xml:5624 11256#, no-c-format 11257msgid "" 11258"<funcprototype> <funcdef>summarystats <function>ST_SummaryStatsAgg</" 11259"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 11260"parameter></paramdef> <paramdef><type>integer </type> <parameter>nband</" 11261"parameter></paramdef> <paramdef><type>boolean </type> " 11262"<parameter>exclude_nodata_value</parameter></paramdef> " 11263"<paramdef><type>double precision </type> <parameter>sample_percent</" 11264"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>summarystats " 11265"<function>ST_SummaryStatsAgg</function></funcdef> <paramdef><type>raster </" 11266"type> <parameter>rast</parameter></paramdef> <paramdef><type>boolean </type> " 11267"<parameter>exclude_nodata_value</parameter></paramdef> " 11268"<paramdef><type>double precision </type> <parameter>sample_percent</" 11269"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>summarystats " 11270"<function>ST_SummaryStatsAgg</function></funcdef> <paramdef><type>raster </" 11271"type> <parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 11272"<parameter>nband</parameter></paramdef> <paramdef><type>boolean </type> " 11273"<parameter>exclude_nodata_value</parameter></paramdef> </funcprototype>" 11274msgstr "" 11275 11276#. Tag: para 11277#: reference_raster.xml:5654 11278#, no-c-format 11279msgid "" 11280"By default only considers pixel values not equal to the <varname>NODATA</" 11281"varname> value. Set <varname>exclude_nodata_value</varname> to False to get " 11282"count of all pixels." 11283msgstr "" 11284 11285#. Tag: para 11286#: reference_raster.xml:5656 11287#, no-c-format 11288msgid "" 11289"By default will sample all pixels. To get faster response, set " 11290"<varname>sample_percent</varname> to value between 0 and 1" 11291msgstr "" 11292 11293#. Tag: programlisting 11294#: reference_raster.xml:5663 11295#, no-c-format 11296msgid "" 11297"WITH foo AS (\n" 11298" SELECT\n" 11299" rast.rast\n" 11300" FROM (\n" 11301" SELECT ST_SetValue(\n" 11302" ST_SetValue(\n" 11303" ST_SetValue(\n" 11304" ST_AddBand(\n" 11305" ST_MakeEmptyRaster(10, 10, " 11306"10, 10, 2, 2, 0, 0,0)\n" 11307" , 1, '64BF', 0, 0\n" 11308" )\n" 11309" , 1, 1, 1, -10\n" 11310" )\n" 11311" , 1, 5, 4, 0\n" 11312" )\n" 11313" , 1, 5, 5, 3.14159\n" 11314" ) AS rast\n" 11315" ) AS rast\n" 11316" FULL JOIN (\n" 11317" SELECT generate_series(1, 10) AS id\n" 11318" ) AS id\n" 11319" ON 1 = 1\n" 11320")\n" 11321"SELECT\n" 11322" (stats).count,\n" 11323" round((stats).sum::numeric, 3),\n" 11324" round((stats).mean::numeric, 3),\n" 11325" round((stats).stddev::numeric, 3),\n" 11326" round((stats).min::numeric, 3),\n" 11327" round((stats).max::numeric, 3)\n" 11328"FROM (\n" 11329" SELECT\n" 11330" ST_SummaryStatsAgg(rast, 1, TRUE, 1) AS stats\n" 11331" FROM foo\n" 11332") bar;\n" 11333"\n" 11334" count | round | round | round | round | round\n" 11335"-------+---------+--------+-------+---------+-------\n" 11336" 20 | -68.584 | -3.429 | 6.571 | -10.000 | 3.142\n" 11337"(1 row)" 11338msgstr "" 11339 11340#. Tag: para 11341#: reference_raster.xml:5668 11342#, no-c-format 11343msgid "" 11344", <xref linkend=\"RT_ST_SummaryStats\"/>, <xref linkend=\"RT_ST_Count\"/>, " 11345"<xref linkend=\"RT_ST_Clip\"/>" 11346msgstr "" 11347 11348#. Tag: refname 11349#: reference_raster.xml:5679 11350#, no-c-format 11351msgid "ST_ValueCount" 11352msgstr "ST_ValueCount" 11353 11354#. Tag: refpurpose 11355#: reference_raster.xml:5680 11356#, no-c-format 11357msgid "" 11358"Returns a set of records containing a pixel band value and count of the " 11359"number of pixels in a given band of a raster (or a raster coverage) that " 11360"have a given set of values. If no band is specified defaults to band 1. By " 11361"default nodata value pixels are not counted. and all other values in the " 11362"pixel are output and pixel band values are rounded to the nearest integer." 11363msgstr "" 11364 11365#. Tag: funcsynopsis 11366#: reference_raster.xml:5685 11367#, no-c-format 11368msgid "" 11369"<funcprototype> <funcdef>SETOF record <function>ST_ValueCount</function></" 11370"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 11371"paramdef> <paramdef choice=\"opt\"><type>integer </type> <parameter>nband=1</" 11372"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 11373"<parameter>exclude_nodata_value=true</parameter></paramdef> <paramdef choice=" 11374"\"opt\"><type>double precision[] </type> <parameter>searchvalues=NULL</" 11375"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 11376"type> <parameter>roundto=0</parameter></paramdef> <paramdef><type>double " 11377"precision </type> <parameter>OUT value</parameter></paramdef> " 11378"<paramdef><type>integer </type> <parameter>OUT count</parameter></paramdef> " 11379"</funcprototype> <funcprototype> <funcdef>SETOF record " 11380"<function>ST_ValueCount</function></funcdef> <paramdef><type>raster </type> " 11381"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 11382"<parameter>nband</parameter></paramdef> <paramdef><type>double precision[] </" 11383"type> <parameter>searchvalues</parameter></paramdef> <paramdef choice=\"opt" 11384"\"><type>double precision </type> <parameter>roundto=0</parameter></" 11385"paramdef> <paramdef><type>double precision </type> <parameter>OUT value</" 11386"parameter></paramdef> <paramdef><type>integer </type> <parameter>OUT count</" 11387"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>SETOF record " 11388"<function>ST_ValueCount</function></funcdef> <paramdef><type>raster </type> " 11389"<parameter>rast</parameter></paramdef> <paramdef><type>double precision[] </" 11390"type> <parameter>searchvalues</parameter></paramdef> <paramdef choice=\"opt" 11391"\"><type>double precision </type> <parameter>roundto=0</parameter></" 11392"paramdef> <paramdef><type>double precision </type> <parameter>OUT value</" 11393"parameter></paramdef> <paramdef><type>integer </type> <parameter>OUT count</" 11394"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>bigint " 11395"<function>ST_ValueCount</function></funcdef> <paramdef><type>raster </type> " 11396"<parameter>rast</parameter></paramdef> <paramdef><type>double precision </" 11397"type> <parameter>searchvalue</parameter></paramdef> <paramdef choice=\"opt" 11398"\"><type>double precision </type> <parameter>roundto=0</parameter></" 11399"paramdef> </funcprototype> <funcprototype> <funcdef>bigint " 11400"<function>ST_ValueCount</function></funcdef> <paramdef><type>raster </type> " 11401"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 11402"<parameter>nband</parameter></paramdef> <paramdef><type>boolean </type> " 11403"<parameter>exclude_nodata_value</parameter></paramdef> " 11404"<paramdef><type>double precision </type> <parameter>searchvalue</parameter></" 11405"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 11406"<parameter>roundto=0</parameter></paramdef> </funcprototype> <funcprototype> " 11407"<funcdef>bigint <function>ST_ValueCount</function></funcdef> " 11408"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 11409"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 11410"<paramdef><type>double precision </type> <parameter>searchvalue</parameter></" 11411"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 11412"<parameter>roundto=0</parameter></paramdef> </funcprototype> <funcprototype> " 11413"<funcdef>SETOF record <function>ST_ValueCount</function></funcdef> " 11414"<paramdef><type>text </type> <parameter>rastertable</parameter></paramdef> " 11415"<paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef> " 11416"<paramdef choice=\"opt\"><type>integer </type> <parameter>nband=1</" 11417"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 11418"<parameter>exclude_nodata_value=true</parameter></paramdef> <paramdef choice=" 11419"\"opt\"><type>double precision[] </type> <parameter>searchvalues=NULL</" 11420"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 11421"type> <parameter>roundto=0</parameter></paramdef> <paramdef><type>double " 11422"precision </type> <parameter>OUT value</parameter></paramdef> " 11423"<paramdef><type>integer </type> <parameter>OUT count</parameter></paramdef> " 11424"</funcprototype> <funcprototype> <funcdef>SETOF record " 11425"<function>ST_ValueCount</function></funcdef> <paramdef><type>text </type> " 11426"<parameter>rastertable</parameter></paramdef> <paramdef><type>text </type> " 11427"<parameter>rastercolumn</parameter></paramdef> <paramdef><type>double " 11428"precision[] </type> <parameter>searchvalues</parameter></paramdef> <paramdef " 11429"choice=\"opt\"><type>double precision </type> <parameter>roundto=0</" 11430"parameter></paramdef> <paramdef><type>double precision </type> " 11431"<parameter>OUT value</parameter></paramdef> <paramdef><type>integer </type> " 11432"<parameter>OUT count</parameter></paramdef> </funcprototype> <funcprototype> " 11433"<funcdef>SETOF record <function>ST_ValueCount</function></funcdef> " 11434"<paramdef><type>text </type> <parameter>rastertable</parameter></paramdef> " 11435"<paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef> " 11436"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 11437"<paramdef><type>double precision[] </type> <parameter>searchvalues</" 11438"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 11439"type> <parameter>roundto=0</parameter></paramdef> <paramdef><type>double " 11440"precision </type> <parameter>OUT value</parameter></paramdef> " 11441"<paramdef><type>integer </type> <parameter>OUT count</parameter></paramdef> " 11442"</funcprototype> <funcprototype> <funcdef>bigint<function>ST_ValueCount</" 11443"function></funcdef> <paramdef><type>text </type> <parameter>rastertable</" 11444"parameter></paramdef> <paramdef><type>text </type> <parameter>rastercolumn</" 11445"parameter></paramdef> <paramdef><type>integer </type> <parameter>nband</" 11446"parameter></paramdef> <paramdef><type>boolean </type> " 11447"<parameter>exclude_nodata_value</parameter></paramdef> " 11448"<paramdef><type>double precision </type> <parameter>searchvalue</parameter></" 11449"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 11450"<parameter>roundto=0</parameter></paramdef> </funcprototype> <funcprototype> " 11451"<funcdef>bigint <function>ST_ValueCount</function></funcdef> " 11452"<paramdef><type>text </type> <parameter>rastertable</parameter></paramdef> " 11453"<paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef> " 11454"<paramdef><type>double precision </type> <parameter>searchvalue</parameter></" 11455"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 11456"<parameter>roundto=0</parameter></paramdef> </funcprototype> <funcprototype> " 11457"<funcdef>bigint <function>ST_ValueCount</function></funcdef> " 11458"<paramdef><type>text </type> <parameter>rastertable</parameter></paramdef> " 11459"<paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef> " 11460"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 11461"<paramdef><type>double precision </type> <parameter>searchvalue</parameter></" 11462"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 11463"<parameter>roundto=0</parameter></paramdef> </funcprototype>" 11464msgstr "" 11465"<funcprototype> <funcdef>SETOF record <function>ST_ValueCount</function></" 11466"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 11467"paramdef> <paramdef choice=\"opt\"><type>integer </type> <parameter>nband=1</" 11468"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 11469"<parameter>exclude_nodata_value=true</parameter></paramdef> <paramdef choice=" 11470"\"opt\"><type>double precision[] </type> <parameter>searchvalues=NULL</" 11471"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 11472"type> <parameter>roundto=0</parameter></paramdef> <paramdef><type>double " 11473"precision </type> <parameter>OUT value</parameter></paramdef> " 11474"<paramdef><type>integer </type> <parameter>OUT count</parameter></paramdef> " 11475"</funcprototype> <funcprototype> <funcdef>SETOF record " 11476"<function>ST_ValueCount</function></funcdef> <paramdef><type>raster </type> " 11477"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 11478"<parameter>nband</parameter></paramdef> <paramdef><type>double precision[] </" 11479"type> <parameter>searchvalues</parameter></paramdef> <paramdef choice=\"opt" 11480"\"><type>double precision </type> <parameter>roundto=0</parameter></" 11481"paramdef> <paramdef><type>double precision </type> <parameter>OUT value</" 11482"parameter></paramdef> <paramdef><type>integer </type> <parameter>OUT count</" 11483"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>SETOF record " 11484"<function>ST_ValueCount</function></funcdef> <paramdef><type>raster </type> " 11485"<parameter>rast</parameter></paramdef> <paramdef><type>double precision[] </" 11486"type> <parameter>searchvalues</parameter></paramdef> <paramdef choice=\"opt" 11487"\"><type>double precision </type> <parameter>roundto=0</parameter></" 11488"paramdef> <paramdef><type>double precision </type> <parameter>OUT value</" 11489"parameter></paramdef> <paramdef><type>integer </type> <parameter>OUT count</" 11490"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>bigint " 11491"<function>ST_ValueCount</function></funcdef> <paramdef><type>raster </type> " 11492"<parameter>rast</parameter></paramdef> <paramdef><type>double precision </" 11493"type> <parameter>searchvalue</parameter></paramdef> <paramdef choice=\"opt" 11494"\"><type>double precision </type> <parameter>roundto=0</parameter></" 11495"paramdef> </funcprototype> <funcprototype> <funcdef>bigint " 11496"<function>ST_ValueCount</function></funcdef> <paramdef><type>raster </type> " 11497"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 11498"<parameter>nband</parameter></paramdef> <paramdef><type>boolean </type> " 11499"<parameter>exclude_nodata_value</parameter></paramdef> " 11500"<paramdef><type>double precision </type> <parameter>searchvalue</parameter></" 11501"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 11502"<parameter>roundto=0</parameter></paramdef> </funcprototype> <funcprototype> " 11503"<funcdef>bigint <function>ST_ValueCount</function></funcdef> " 11504"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 11505"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 11506"<paramdef><type>double precision </type> <parameter>searchvalue</parameter></" 11507"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 11508"<parameter>roundto=0</parameter></paramdef> </funcprototype> <funcprototype> " 11509"<funcdef>SETOF record <function>ST_ValueCount</function></funcdef> " 11510"<paramdef><type>text </type> <parameter>rastertable</parameter></paramdef> " 11511"<paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef> " 11512"<paramdef choice=\"opt\"><type>integer </type> <parameter>nband=1</" 11513"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 11514"<parameter>exclude_nodata_value=true</parameter></paramdef> <paramdef choice=" 11515"\"opt\"><type>double precision[] </type> <parameter>searchvalues=NULL</" 11516"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 11517"type> <parameter>roundto=0</parameter></paramdef> <paramdef><type>double " 11518"precision </type> <parameter>OUT value</parameter></paramdef> " 11519"<paramdef><type>integer </type> <parameter>OUT count</parameter></paramdef> " 11520"</funcprototype> <funcprototype> <funcdef>SETOF record " 11521"<function>ST_ValueCount</function></funcdef> <paramdef><type>text </type> " 11522"<parameter>rastertable</parameter></paramdef> <paramdef><type>text </type> " 11523"<parameter>rastercolumn</parameter></paramdef> <paramdef><type>double " 11524"precision[] </type> <parameter>searchvalues</parameter></paramdef> <paramdef " 11525"choice=\"opt\"><type>double precision </type> <parameter>roundto=0</" 11526"parameter></paramdef> <paramdef><type>double precision </type> " 11527"<parameter>OUT value</parameter></paramdef> <paramdef><type>integer </type> " 11528"<parameter>OUT count</parameter></paramdef> </funcprototype> <funcprototype> " 11529"<funcdef>SETOF record <function>ST_ValueCount</function></funcdef> " 11530"<paramdef><type>text </type> <parameter>rastertable</parameter></paramdef> " 11531"<paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef> " 11532"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 11533"<paramdef><type>double precision[] </type> <parameter>searchvalues</" 11534"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 11535"type> <parameter>roundto=0</parameter></paramdef> <paramdef><type>double " 11536"precision </type> <parameter>OUT value</parameter></paramdef> " 11537"<paramdef><type>integer </type> <parameter>OUT count</parameter></paramdef> " 11538"</funcprototype> <funcprototype> <funcdef>bigint<function>ST_ValueCount</" 11539"function></funcdef> <paramdef><type>text </type> <parameter>rastertable</" 11540"parameter></paramdef> <paramdef><type>text </type> <parameter>rastercolumn</" 11541"parameter></paramdef> <paramdef><type>integer </type> <parameter>nband</" 11542"parameter></paramdef> <paramdef><type>boolean </type> " 11543"<parameter>exclude_nodata_value</parameter></paramdef> " 11544"<paramdef><type>double precision </type> <parameter>searchvalue</parameter></" 11545"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 11546"<parameter>roundto=0</parameter></paramdef> </funcprototype> <funcprototype> " 11547"<funcdef>bigint <function>ST_ValueCount</function></funcdef> " 11548"<paramdef><type>text </type> <parameter>rastertable</parameter></paramdef> " 11549"<paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef> " 11550"<paramdef><type>double precision </type> <parameter>searchvalue</parameter></" 11551"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 11552"<parameter>roundto=0</parameter></paramdef> </funcprototype> <funcprototype> " 11553"<funcdef>bigint <function>ST_ValueCount</function></funcdef> " 11554"<paramdef><type>text </type> <parameter>rastertable</parameter></paramdef> " 11555"<paramdef><type>text </type> <parameter>rastercolumn</parameter></paramdef> " 11556"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 11557"<paramdef><type>double precision </type> <parameter>searchvalue</parameter></" 11558"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 11559"<parameter>roundto=0</parameter></paramdef> </funcprototype>" 11560 11561#. Tag: para 11562#: reference_raster.xml:5798 11563#, no-c-format 11564msgid "" 11565"Returns a set of records with columns <varname>value</varname> " 11566"<varname>count</varname> which contain the pixel band value and count of " 11567"pixels in the raster tile or raster coverage of selected band." 11568msgstr "" 11569 11570#. Tag: para 11571#: reference_raster.xml:5799 11572#, no-c-format 11573msgid "" 11574"If no band is specified <varname>nband</varname> defaults to 1. If no " 11575"<varname>searchvalues</varname> are specified, will return all pixel values " 11576"found in the raster or raster coverage. If one searchvalue is given, will " 11577"return an integer instead of records denoting the count of pixels having " 11578"that pixel band value" 11579msgstr "" 11580 11581#. Tag: programlisting 11582#: reference_raster.xml:5807 11583#, no-c-format 11584msgid "" 11585"UPDATE dummy_rast SET rast = ST_SetBandNoDataValue(rast,249) WHERE rid=2;\n" 11586"--Example will count only pixels of band 1 that are not 249. --\n" 11587"\n" 11588"SELECT (pvc).*\n" 11589"FROM (SELECT ST_ValueCount(rast) As pvc\n" 11590" FROM dummy_rast WHERE rid=2) As foo\n" 11591" ORDER BY (pvc).value;\n" 11592"\n" 11593" value | count\n" 11594"-------+-------\n" 11595" 250 | 2\n" 11596" 251 | 1\n" 11597" 252 | 2\n" 11598" 253 | 6\n" 11599" 254 | 12\n" 11600"\n" 11601"-- Example will coount all pixels of band 1 including 249 --\n" 11602"SELECT (pvc).*\n" 11603"FROM (SELECT ST_ValueCount(rast,1,false) As pvc\n" 11604" FROM dummy_rast WHERE rid=2) As foo\n" 11605" ORDER BY (pvc).value;\n" 11606"\n" 11607" value | count\n" 11608"-------+-------\n" 11609" 249 | 2\n" 11610" 250 | 2\n" 11611" 251 | 1\n" 11612" 252 | 2\n" 11613" 253 | 6\n" 11614" 254 | 12\n" 11615"\n" 11616"-- Example will count only non-nodata value pixels of band 2\n" 11617"SELECT (pvc).*\n" 11618"FROM (SELECT ST_ValueCount(rast,2) As pvc\n" 11619" FROM dummy_rast WHERE rid=2) As foo\n" 11620" ORDER BY (pvc).value;\n" 11621" value | count\n" 11622"-------+-------\n" 11623" 78 | 1\n" 11624" 79 | 1\n" 11625" 88 | 1\n" 11626" 89 | 1\n" 11627" 96 | 1\n" 11628" 97 | 1\n" 11629" 98 | 1\n" 11630" 99 | 2\n" 11631" 112 | 2\n" 11632":" 11633msgstr "" 11634 11635#. Tag: programlisting 11636#: reference_raster.xml:5808 11637#, no-c-format 11638msgid "" 11639"--real live example. Count all the pixels in an aerial raster tile band 2 " 11640"intersecting a geometry\n" 11641"-- and return only the pixel band values that have a count > 500\n" 11642"SELECT (pvc).value, SUM((pvc).count) As total\n" 11643"FROM (SELECT ST_ValueCount(rast,2) As pvc\n" 11644" FROM o_4_boston\n" 11645" WHERE ST_Intersects(rast,\n" 11646" ST_GeomFromText('POLYGON((224486 892151,224486 892200,224706 " 11647"892200,224706 892151,224486 892151))',26986)\n" 11648" )\n" 11649" ) As foo\n" 11650" GROUP BY (pvc).value\n" 11651" HAVING SUM((pvc).count) > 500\n" 11652" ORDER BY (pvc).value;\n" 11653"\n" 11654" value | total\n" 11655"-------+-----\n" 11656" 51 | 502\n" 11657" 54 | 521" 11658msgstr "" 11659 11660#. Tag: programlisting 11661#: reference_raster.xml:5810 11662#, no-c-format 11663msgid "" 11664"-- Just return count of pixels in each raster tile that have value of 100 of " 11665"tiles that intersect a specific geometry --\n" 11666"SELECT rid, ST_ValueCount(rast,2,100) As count\n" 11667" FROM o_4_boston\n" 11668" WHERE ST_Intersects(rast,\n" 11669" ST_GeomFromText('POLYGON((224486 892151,224486 892200,224706 " 11670"892200,224706 892151,224486 892151))',26986)\n" 11671" ) ;\n" 11672"\n" 11673" rid | count\n" 11674"-----+-------\n" 11675" 1 | 56\n" 11676" 2 | 95\n" 11677" 14 | 37\n" 11678" 15 | 64" 11679msgstr "" 11680 11681#. Tag: para 11682#: reference_raster.xml:5815 11683#, no-c-format 11684msgid ", <xref linkend=\"RT_ST_SetBandNoDataValue\"/>" 11685msgstr ", <xref linkend=\"RT_ST_SetBandNoDataValue\"/>" 11686 11687#. Tag: title 11688#: reference_raster.xml:5821 11689#, no-c-format 11690msgid "Raster Inputs" 11691msgstr "" 11692 11693#. Tag: refname 11694#: reference_raster.xml:5824 11695#, fuzzy, no-c-format 11696msgid "ST_RastFromWKB" 11697msgstr "ST_AsRaster" 11698 11699#. Tag: refpurpose 11700#: reference_raster.xml:5825 11701#, no-c-format 11702msgid "Return a raster value from a Well-Known Binary (WKB) raster." 11703msgstr "" 11704 11705#. Tag: funcprototype 11706#: reference_raster.xml:5830 11707#, fuzzy, no-c-format 11708msgid "" 11709"<funcdef>raster <function>ST_RastFromWKB</function></funcdef> " 11710"<paramdef><type>bytea </type> <parameter>wkb</parameter></paramdef>" 11711msgstr "" 11712"<funcdef>raster <function>ST_Union</function></funcdef> " 11713"<paramdef><type>setof raster </type> <parameter>rast</parameter></paramdef>" 11714 11715#. Tag: para 11716#: reference_raster.xml:5840 11717#, no-c-format 11718msgid "Given a Well-Known Binary (WKB) raster, return a raster." 11719msgstr "" 11720 11721#. Tag: programlisting 11722#: reference_raster.xml:5850 11723#, no-c-format 11724msgid "" 11725"SELECT (ST_Metadata(\n" 11726" ST_RastFromWKB(\n" 11727" '\\001\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000@" 11728"\\000\\000\\000\\000\\000\\000\\010@\\000\\000\\000\\000\\000\\000\\340?" 11729"\\000\\000\\000\\000\\000\\000\\340?" 11730"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\012\\000\\000\\000\\012\\000\\024\\000'::" 11731"bytea\n" 11732" )\n" 11733")).* AS metadata;\n" 11734"\n" 11735" upperleftx | upperlefty | width | height | scalex | scaley | skewx | skewy " 11736"| srid | numbands\n" 11737"------------+------------+-------+--------+--------+--------+-------+-------" 11738"+------+----------\n" 11739" 0.5 | 0.5 | 10 | 20 | 2 | 3 | 0 | 0 " 11740"| 10 | 0" 11741msgstr "" 11742 11743#. Tag: para 11744#: reference_raster.xml:5856 11745#, fuzzy, no-c-format 11746msgid "" 11747", <xref linkend=\"RT_ST_RastFromHexWKB\"/>, <xref linkend=\"RT_ST_AsBinary\"/" 11748">, <xref linkend=\"RT_ST_AsHexWKB\"/>" 11749msgstr "" 11750", <xref linkend=\"RT_ST_Value\"/>, <xref linkend=\"RT_ST_Polygon\"/>, <xref " 11751"linkend=\"RT_ST_ValueCount\"/>" 11752 11753#. Tag: refname 11754#: reference_raster.xml:5867 11755#, no-c-format 11756msgid "ST_RastFromHexWKB" 11757msgstr "" 11758 11759#. Tag: refpurpose 11760#: reference_raster.xml:5868 11761#, no-c-format 11762msgid "" 11763"Return a raster value from a Hex representation of Well-Known Binary (WKB) " 11764"raster." 11765msgstr "" 11766 11767#. Tag: funcprototype 11768#: reference_raster.xml:5873 11769#, fuzzy, no-c-format 11770msgid "" 11771"<funcdef>raster <function>ST_RastFromHexWKB</function></funcdef> " 11772"<paramdef><type>text </type> <parameter>wkb</parameter></paramdef>" 11773msgstr "" 11774"<funcdef>raster <function>ST_Union</function></funcdef> " 11775"<paramdef><type>setof raster </type> <parameter>rast</parameter></paramdef>" 11776 11777#. Tag: para 11778#: reference_raster.xml:5883 11779#, no-c-format 11780msgid "" 11781"Given a Well-Known Binary (WKB) raster in Hex representation, return a " 11782"raster." 11783msgstr "" 11784 11785#. Tag: programlisting 11786#: reference_raster.xml:5893 11787#, fuzzy, no-c-format 11788msgid "" 11789"SELECT (ST_Metadata(\n" 11790" ST_RastFromHexWKB(\n" 11791" '010000000000000000000000400000000000000840000000000000E03F000000000000E03F000000000000000000000000000000000A0000000A001400'\n" 11792" )\n" 11793")).* AS metadata;\n" 11794"\n" 11795" upperleftx | upperlefty | width | height | scalex | scaley | skewx | skewy " 11796"| srid | numbands\n" 11797"------------+------------+-------+--------+--------+--------+-------+-------" 11798"+------+----------\n" 11799" 0.5 | 0.5 | 10 | 20 | 2 | 3 | 0 | 0 " 11800"| 10 | 0" 11801msgstr "" 11802"SELECT rid, (foo.md).* \n" 11803" FROM (SELECT rid, ST_MetaData(rast) As md\n" 11804"FROM dummy_rast) As foo;\n" 11805"\n" 11806" rid | upperleftx | upperlefty | width | height | scalex | scaley | skewx | " 11807"skewy | srid | numbands\n" 11808" ----+------------+------------+-------+--------+--------+-----------+-------" 11809"+-------+------+-------\n" 11810" 1 | 0.5 | 0.5 | 10 | 20 | 2 | 3 " 11811"| 0 | 0 | 0 | 0\n" 11812" 2 | 3427927.75 | 5793244 | 5 | 5 | 0.05 | -0.05 " 11813"| 0 | 0 | 0 | 3" 11814 11815#. Tag: para 11816#: reference_raster.xml:5899 11817#, fuzzy, no-c-format 11818msgid "" 11819", <xref linkend=\"RT_ST_RastFromWKB\"/>, <xref linkend=\"RT_ST_AsBinary\"/>, " 11820"<xref linkend=\"RT_ST_AsHexWKB\"/>" 11821msgstr "" 11822", <xref linkend=\"RT_ST_Contains\"/>, <xref linkend=\"RT_ST_DWithin\"/>, " 11823"<xref linkend=\"RT_ST_DFullyWithin\"/>" 11824 11825#. Tag: title 11826#: reference_raster.xml:5911 11827#, no-c-format 11828msgid "Raster Outputs" 11829msgstr "" 11830 11831#. Tag: refname 11832#: reference_raster.xml:5915 11833#, fuzzy, no-c-format 11834msgid "ST_AsBinary/ST_AsWKB" 11835msgstr "ST_AsBinary" 11836 11837#. Tag: refpurpose 11838#: reference_raster.xml:5916 11839#, no-c-format 11840msgid "Return the Well-Known Binary (WKB) representation of the raster." 11841msgstr "" 11842 11843#. Tag: funcsynopsis 11844#: reference_raster.xml:5920 11845#, fuzzy, no-c-format 11846msgid "" 11847"<funcprototype> <funcdef>bytea <function>ST_AsBinary</function></funcdef> " 11848"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 11849"<paramdef choice=\"opt\"><type>boolean </type> <parameter>outasin=FALSE</" 11850"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>bytea " 11851"<function>ST_AsWKB</function></funcdef> <paramdef><type>raster </type> " 11852"<parameter>rast</parameter></paramdef> <paramdef choice=\"opt" 11853"\"><type>boolean </type> <parameter>outasin=FALSE</parameter></paramdef> </" 11854"funcprototype>" 11855msgstr "" 11856"<funcprototype> <funcdef>boolean <function>ST_BandIsNoData</function></" 11857"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 11858"paramdef> <paramdef><type>integer </type> <parameter>band</parameter></" 11859"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 11860"<parameter>forceChecking=true</parameter></paramdef> </funcprototype> " 11861"<funcprototype> <funcdef>boolean <function>ST_BandIsNoData</function></" 11862"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 11863"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 11864"<parameter>forceChecking=true</parameter></paramdef> </funcprototype>" 11865 11866#. Tag: para 11867#: reference_raster.xml:5937 11868#, no-c-format 11869msgid "" 11870"Returns the Binary representation of the raster. If <varname>outasin</" 11871"varname> is TRUE, out-db bands are treated as in-db. Refer to raster/doc/" 11872"RFC2-WellKnownBinaryFormat located in the PostGIS source folder for details " 11873"of the representation." 11874msgstr "" 11875 11876#. Tag: para 11877#: reference_raster.xml:5942 11878#, no-c-format 11879msgid "" 11880"This is useful in binary cursors to pull data out of the database without " 11881"converting it to a string representation." 11882msgstr "" 11883 11884#. Tag: para 11885#: reference_raster.xml:5947 11886#, no-c-format 11887msgid "" 11888"By default, WKB output contains the external file path for out-db bands. If " 11889"the client does not have access to the raster file underlying an out-db " 11890"band, set <varname>outasin</varname> to TRUE." 11891msgstr "" 11892 11893#. Tag: para 11894#: reference_raster.xml:5951 11895#, no-c-format 11896msgid "Enhanced: 2.1.0 Addition of <varname>outasin</varname>" 11897msgstr "" 11898 11899#. Tag: para 11900#: reference_raster.xml:5952 11901#, no-c-format 11902msgid "Enhanced: 2.5.0 Addition of <varname>ST_AsWKB</varname>" 11903msgstr "" 11904 11905#. Tag: programlisting 11906#: reference_raster.xml:5958 11907#, no-c-format 11908msgid "" 11909"SELECT ST_AsBinary(rast) As rastbin FROM dummy_rast WHERE rid=1;\n" 11910"\n" 11911" rastbin\n" 11912"---------------------------------------------------------------------------------\n" 11913"\\001\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000@" 11914"\\000\\000\\000\\000\\000\\000\\010@\\000\\000\\000\\000\\000\\000\\340?" 11915"\\000\\000\\000\\000\\000\\000\\340?" 11916"\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\000\\012\\000\\000\\000\\012\\000\\024\\000" 11917msgstr "" 11918 11919#. Tag: para 11920#: reference_raster.xml:5964 11921#, fuzzy, no-c-format 11922msgid ", <xref linkend=\"RT_ST_AsHexWKB\"/>" 11923msgstr ", <xref linkend=\"RT_ST_Value\"/>" 11924 11925#. Tag: refname 11926#: reference_raster.xml:5973 11927#, fuzzy, no-c-format 11928msgid "ST_AsHexWKB" 11929msgstr "ST_Aspect" 11930 11931#. Tag: refpurpose 11932#: reference_raster.xml:5974 11933#, no-c-format 11934msgid "Return the Well-Known Binary (WKB) in Hex representation of the raster." 11935msgstr "" 11936 11937#. Tag: funcprototype 11938#: reference_raster.xml:5979 11939#, fuzzy, no-c-format 11940msgid "" 11941"<funcdef>bytea <function>ST_AsHexWKB</function></funcdef> " 11942"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 11943"<paramdef choice=\"opt\"><type>boolean </type> <parameter>outasin=FALSE</" 11944"parameter></paramdef>" 11945msgstr "" 11946"<funcdef>text <function>ST_GeoReference</function></funcdef> " 11947"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 11948"<paramdef choice=\"opt\"><type>text </type> <parameter>format=GDAL</" 11949"parameter></paramdef>" 11950 11951#. Tag: para 11952#: reference_raster.xml:5990 11953#, no-c-format 11954msgid "" 11955"Returns the Binary representation in Hex representation of the raster. If " 11956"<varname>outasin</varname> is TRUE, out-db bands are treated as in-db. Refer " 11957"to raster/doc/RFC2-WellKnownBinaryFormat located in the PostGIS source " 11958"folder for details of the representation." 11959msgstr "" 11960 11961#. Tag: para 11962#: reference_raster.xml:5996 11963#, no-c-format 11964msgid "" 11965"By default, Hex WKB output contains the external file path for out-db bands. " 11966"If the client does not have access to the raster file underlying an out-db " 11967"band, set <varname>outasin</varname> to TRUE." 11968msgstr "" 11969 11970#. Tag: programlisting 11971#: reference_raster.xml:6006 11972#, no-c-format 11973msgid "" 11974"SELECT ST_AsHexWKB(rast) As rastbin FROM dummy_rast WHERE rid=1;\n" 11975"\n" 11976" st_ashexwkb\n" 11977"----------------------------------------------------------------------------------------------------------------------------\n" 11978" 010000000000000000000000400000000000000840000000000000E03F000000000000E03F000000000000000000000000000000000A0000000A001400" 11979msgstr "" 11980 11981#. Tag: para 11982#: reference_raster.xml:6012 11983#, fuzzy, no-c-format 11984msgid ", <xref linkend=\"RT_ST_AsBinary\"/>" 11985msgstr ", <xref linkend=\"RT_ST_Disjoint\"/>" 11986 11987#. Tag: refname 11988#: reference_raster.xml:6022 11989#, no-c-format 11990msgid "ST_AsGDALRaster" 11991msgstr "ST_AsGDALRaster" 11992 11993#. Tag: refpurpose 11994#: reference_raster.xml:6023 11995#, no-c-format 11996msgid "" 11997"Return the raster tile in the designated GDAL Raster format. Raster formats " 11998"are one of those supported by your compiled library. Use ST_GDALDrivers() to " 11999"get a list of formats supported by your library." 12000msgstr "" 12001 12002#. Tag: funcprototype 12003#: reference_raster.xml:6028 12004#, no-c-format 12005msgid "" 12006"<funcdef>bytea <function>ST_AsGDALRaster</function></funcdef> " 12007"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12008"<paramdef><type>text </type> <parameter>format</parameter></paramdef> " 12009"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=NULL</" 12010"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 12011"<parameter>srid=sameassource</parameter></paramdef>" 12012msgstr "" 12013"<funcdef>bytea <function>ST_AsGDALRaster</function></funcdef> " 12014"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12015"<paramdef><type>text </type> <parameter>format</parameter></paramdef> " 12016"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=NULL</" 12017"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 12018"<parameter>srid=sameassource</parameter></paramdef>" 12019 12020#. Tag: para 12021#: reference_raster.xml:6042 12022#, no-c-format 12023msgid "" 12024"Returns the raster tile in the designated format. Arguments are itemized " 12025"below:" 12026msgstr "" 12027 12028#. Tag: para 12029#: reference_raster.xml:6045 12030#, no-c-format 12031msgid "" 12032"<varname>format</varname> format to output. This is dependent on the drivers " 12033"compiled in your libgdal library. Generally available are 'JPEG', 'GTIff', " 12034"'PNG'. Use <xref linkend=\"RT_ST_GDALDrivers\"/> to get a list of formats " 12035"supported by your library." 12036msgstr "" 12037 12038#. Tag: para 12039#: reference_raster.xml:6050 12040#, no-c-format 12041msgid "" 12042"<varname>options</varname> text array of GDAL options. Valid options are " 12043"dependent on the format. Refer to <ulink url=\"http://www.gdal.org/" 12044"frmt_various.html\">GDAL Raster format options</ulink> for more details." 12045msgstr "" 12046 12047#. Tag: para 12048#: reference_raster.xml:6055 12049#, no-c-format 12050msgid "" 12051"<varname>srs</varname> The proj4text or srtext (from spatial_ref_sys) to " 12052"embed in the image" 12053msgstr "" 12054 12055#. Tag: title 12056#: reference_raster.xml:6065 12057#, no-c-format 12058msgid "JPEG Output Example, multiple tiles as single raster" 12059msgstr "" 12060 12061#. Tag: programlisting 12062#: reference_raster.xml:6067 12063#, no-c-format 12064msgid "" 12065"<![CDATA[SELECT ST_AsGDALRaster(ST_Union(rast), 'JPEG', ARRAY['QUALITY=50']) " 12066"As rastjpg\n" 12067"FROM dummy_rast\n" 12068"WHERE rast && ST_MakeEnvelope(10, 10, 11, 11);]]>" 12069msgstr "" 12070 12071#. Tag: title 12072#: reference_raster.xml:6072 12073#, no-c-format 12074msgid "Using PostgreSQL Large Object Support to export raster" 12075msgstr "" 12076 12077#. Tag: para 12078#: reference_raster.xml:6073 12079#, no-c-format 12080msgid "" 12081"One way to export raster into another format is using <ulink url=\"https://" 12082"www.postgresql.org/docs/current/static/lo-funcs.html\">PostgreSQL large " 12083"object export functions</ulink>. We'lll repeat the prior example but also " 12084"exporting. Note for this you'll need to have super user access to db since " 12085"it uses server side lo functions. It will also export to path on server " 12086"network. If you need export locally, use the psql equivalent lo_ functions " 12087"which export to the local file system instead of the server file system." 12088msgstr "" 12089 12090#. Tag: programlisting 12091#: reference_raster.xml:6077 12092#, no-c-format 12093msgid "" 12094"<![CDATA[DROP TABLE IF EXISTS tmp_out ;\n" 12095"\n" 12096"CREATE TABLE tmp_out AS\n" 12097"SELECT lo_from_bytea(0,\n" 12098" ST_AsGDALRaster(ST_Union(rast), 'JPEG', ARRAY['QUALITY=50'])\n" 12099" ) AS loid\n" 12100" FROM dummy_rast\n" 12101"WHERE rast && ST_MakeEnvelope(10, 10, 11, 11);\n" 12102"\n" 12103"SELECT lo_export(loid, '/tmp/dummy.jpg')\n" 12104" FROM tmp_out;\n" 12105"\n" 12106"SELECT lo_unlink(loid)\n" 12107" FROM tmp_out;]]>" 12108msgstr "" 12109 12110#. Tag: title 12111#: reference_raster.xml:6081 12112#, no-c-format 12113msgid "GTIFF Output Examples" 12114msgstr "Esempio di uscita GTIFF" 12115 12116#. Tag: programlisting 12117#: reference_raster.xml:6083 12118#, fuzzy, no-c-format 12119msgid "" 12120"SELECT ST_AsGDALRaster(rast, 'GTiff') As rastjpg\n" 12121"FROM dummy_rast WHERE rid=2;\n" 12122"\n" 12123"-- Out GeoTiff with jpeg compression, 90% quality\n" 12124"SELECT ST_AsGDALRaster(rast, 'GTiff',\n" 12125" ARRAY['COMPRESS=JPEG', 'JPEG_QUALITY=90'],\n" 12126" 4269) As rasttiff\n" 12127"FROM dummy_rast WHERE rid=2;" 12128msgstr "" 12129"SELECT ST_AsGDALRaster(rast, 'GTiff') As rastjpg\n" 12130"FROM dummy_rast WHERE rid=2;\n" 12131"\n" 12132"-- Producit GeoTiff con compressione JPEG e qualità 90%\n" 12133"SELECT ST_AsGDALRaster(rast, 'GTiff', \n" 12134" ARRAY['COMPRESS=JPEG', 'JPEG_QUALITY=90'], \n" 12135" 4269) As rasttiff\n" 12136"FROM dummy_rast WHERE rid=2;" 12137 12138#. Tag: para 12139#: reference_raster.xml:6090 12140#, no-c-format 12141msgid ", <xref linkend=\"RT_ST_GDALDrivers\"/>, <xref linkend=\"RT_ST_SRID\"/>" 12142msgstr "" 12143", <xref linkend=\"RT_ST_GDALDrivers\"/>, <xref linkend=\"RT_ST_SRID\"/>" 12144 12145#. Tag: refname 12146#: reference_raster.xml:6096 12147#, no-c-format 12148msgid "ST_AsJPEG" 12149msgstr "ST_AsJPEG" 12150 12151#. Tag: refpurpose 12152#: reference_raster.xml:6097 12153#, no-c-format 12154msgid "" 12155"Return the raster tile selected bands as a single Joint Photographic Exports " 12156"Group (JPEG) image (byte array). If no band is specified and 1 or more than " 12157"3 bands, then only the first band is used. If only 3 bands then all 3 bands " 12158"are used and mapped to RGB." 12159msgstr "" 12160 12161#. Tag: funcsynopsis 12162#: reference_raster.xml:6101 12163#, no-c-format 12164msgid "" 12165"<funcprototype> <funcdef>bytea <function>ST_AsJPEG</function></funcdef> " 12166"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12167"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=NULL</" 12168"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>bytea " 12169"<function>ST_AsJPEG</function></funcdef> <paramdef><type>raster </type> " 12170"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 12171"<parameter>nband</parameter></paramdef> <paramdef><type>integer </type> " 12172"<parameter>quality</parameter></paramdef> </funcprototype> <funcprototype> " 12173"<funcdef>bytea <function>ST_AsJPEG</function></funcdef> " 12174"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12175"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 12176"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=NULL</" 12177"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>bytea " 12178"<function>ST_AsJPEG</function></funcdef> <paramdef><type>raster </type> " 12179"<parameter>rast</parameter></paramdef> <paramdef><type>integer[] </type> " 12180"<parameter>nbands</parameter></paramdef> <paramdef choice=\"opt" 12181"\"><type>text[] </type> <parameter>options=NULL</parameter></paramdef> </" 12182"funcprototype> <funcprototype> <funcdef>bytea <function>ST_AsJPEG</" 12183"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 12184"parameter></paramdef> <paramdef><type>integer[] </type> <parameter>nbands</" 12185"parameter></paramdef> <paramdef><type>integer </type> <parameter>quality</" 12186"parameter></paramdef> </funcprototype>" 12187msgstr "" 12188"<funcprototype> <funcdef>bytea <function>ST_AsJPEG</function></funcdef> " 12189"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12190"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=NULL</" 12191"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>bytea " 12192"<function>ST_AsJPEG</function></funcdef> <paramdef><type>raster </type> " 12193"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 12194"<parameter>nband</parameter></paramdef> <paramdef><type>integer </type> " 12195"<parameter>quality</parameter></paramdef> </funcprototype> <funcprototype> " 12196"<funcdef>bytea <function>ST_AsJPEG</function></funcdef> " 12197"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12198"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 12199"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=NULL</" 12200"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>bytea " 12201"<function>ST_AsJPEG</function></funcdef> <paramdef><type>raster </type> " 12202"<parameter>rast</parameter></paramdef> <paramdef><type>integer[] </type> " 12203"<parameter>nbands</parameter></paramdef> <paramdef choice=\"opt" 12204"\"><type>text[] </type> <parameter>options=NULL</parameter></paramdef> </" 12205"funcprototype> <funcprototype> <funcdef>bytea <function>ST_AsJPEG</" 12206"function></funcdef> <paramdef><type>raster </type> <parameter>rast</" 12207"parameter></paramdef> <paramdef><type>integer[] </type> <parameter>nbands</" 12208"parameter></paramdef> <paramdef><type>integer </type> <parameter>quality</" 12209"parameter></paramdef> </funcprototype>" 12210 12211#. Tag: para 12212#: reference_raster.xml:6137 12213#, no-c-format 12214msgid "" 12215"Returns the selected bands of the raster as a single Joint Photographic " 12216"Exports Group Image (JPEG). Use <xref linkend=\"RT_ST_AsGDALRaster\"/> if " 12217"you need to export as less common raster types. If no band is specified and " 12218"1 or more than 3 bands, then only the first band is used. If 3 bands then " 12219"all 3 bands are used. There are many variants of the function with many " 12220"options. These are itemized below:" 12221msgstr "" 12222 12223#. Tag: para 12224#: reference_raster.xml:6140 reference_raster.xml:6231 12225#, no-c-format 12226msgid "<varname>nband</varname> is for single band exports." 12227msgstr "" 12228 12229#. Tag: para 12230#: reference_raster.xml:6145 12231#, no-c-format 12232msgid "" 12233"<varname>nbands</varname> is an array of bands to export (note that max is 3 " 12234"for JPEG) and the order of the bands is RGB. e.g ARRAY[3,2,1] means map band " 12235"3 to Red, band 2 to green and band 1 to blue" 12236msgstr "" 12237 12238#. Tag: para 12239#: reference_raster.xml:6150 12240#, no-c-format 12241msgid "" 12242"<varname>quality</varname> number from 0 to 100. The higher the number the " 12243"crisper the image." 12244msgstr "" 12245 12246#. Tag: para 12247#: reference_raster.xml:6155 12248#, no-c-format 12249msgid "" 12250"<varname>options</varname> text Array of GDAL options as defined for JPEG " 12251"(look at create_options for JPEG <xref linkend=\"RT_ST_GDALDrivers\"/>). For " 12252"JPEG valid ones are <varname>PROGRESSIVE</varname> ON or OFF and " 12253"<varname>QUALITY</varname> a range from 0 to 100 and default to 75. Refer to " 12254"<ulink url=\"http://www.gdal.org/frmt_various.html\">GDAL Raster format " 12255"options</ulink> for more details." 12256msgstr "" 12257 12258#. Tag: title 12259#: reference_raster.xml:6172 12260#, no-c-format 12261msgid "Examples: Output" 12262msgstr "" 12263 12264#. Tag: programlisting 12265#: reference_raster.xml:6174 12266#, no-c-format 12267msgid "" 12268"-- output first 3 bands 75% quality\n" 12269"SELECT ST_AsJPEG(rast) As rastjpg\n" 12270" FROM dummy_rast WHERE rid=2;\n" 12271"\n" 12272"-- output only first band as 90% quality\n" 12273"SELECT ST_AsJPEG(rast,1,90) As rastjpg\n" 12274" FROM dummy_rast WHERE rid=2;\n" 12275"\n" 12276"-- output first 3 bands (but make band 2 Red, band 1 green, and band 3 blue, " 12277"progressive and 90% quality\n" 12278"SELECT ST_AsJPEG(rast,ARRAY[2,1,3],ARRAY['QUALITY=90','PROGRESSIVE=ON']) As " 12279"rastjpg\n" 12280" FROM dummy_rast WHERE rid=2;" 12281msgstr "" 12282 12283#. Tag: para 12284#: reference_raster.xml:6181 12285#, no-c-format 12286msgid "" 12287", <xref linkend=\"RT_ST_GDALDrivers\"/>, <xref linkend=\"RT_ST_AsGDALRaster" 12288"\"/>, <xref linkend=\"RT_ST_AsPNG\"/>, <xref linkend=\"RT_ST_AsTIFF\"/>" 12289msgstr "" 12290", <xref linkend=\"RT_ST_GDALDrivers\"/>, <xref linkend=\"RT_ST_AsGDALRaster" 12291"\"/>, <xref linkend=\"RT_ST_AsPNG\"/>, <xref linkend=\"RT_ST_AsTIFF\"/>" 12292 12293#. Tag: refname 12294#: reference_raster.xml:6187 12295#, no-c-format 12296msgid "ST_AsPNG" 12297msgstr "ST_AsPNG" 12298 12299#. Tag: refpurpose 12300#: reference_raster.xml:6188 12301#, no-c-format 12302msgid "" 12303"Return the raster tile selected bands as a single portable network graphics " 12304"(PNG) image (byte array). If 1, 3, or 4 bands in raster and no bands are " 12305"specified, then all bands are used. If more 2 or more than 4 bands and no " 12306"bands specified, then only band 1 is used. Bands are mapped to RGB or RGBA " 12307"space." 12308msgstr "" 12309 12310#. Tag: funcsynopsis 12311#: reference_raster.xml:6192 12312#, no-c-format 12313msgid "" 12314"<funcprototype> <funcdef>bytea <function>ST_AsPNG</function></funcdef> " 12315"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12316"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=NULL</" 12317"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>bytea " 12318"<function>ST_AsPNG</function></funcdef> <paramdef><type>raster </type> " 12319"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 12320"<parameter>nband</parameter></paramdef> <paramdef><type>integer </type> " 12321"<parameter>compression</parameter></paramdef> </funcprototype> " 12322"<funcprototype> <funcdef>bytea <function>ST_AsPNG</function></funcdef> " 12323"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12324"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 12325"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=NULL</" 12326"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>bytea " 12327"<function>ST_AsPNG</function></funcdef> <paramdef><type>raster </type> " 12328"<parameter>rast</parameter></paramdef> <paramdef><type>integer[] </type> " 12329"<parameter>nbands</parameter></paramdef> <paramdef><type>integer </type> " 12330"<parameter>compression</parameter></paramdef> </funcprototype> " 12331"<funcprototype> <funcdef>bytea <function>ST_AsPNG</function></funcdef> " 12332"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12333"<paramdef><type>integer[] </type> <parameter>nbands</parameter></paramdef> " 12334"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=NULL</" 12335"parameter></paramdef> </funcprototype>" 12336msgstr "" 12337"<funcprototype> <funcdef>bytea <function>ST_AsPNG</function></funcdef> " 12338"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12339"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=NULL</" 12340"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>bytea " 12341"<function>ST_AsPNG</function></funcdef> <paramdef><type>raster </type> " 12342"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 12343"<parameter>nband</parameter></paramdef> <paramdef><type>integer </type> " 12344"<parameter>compression</parameter></paramdef> </funcprototype> " 12345"<funcprototype> <funcdef>bytea <function>ST_AsPNG</function></funcdef> " 12346"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12347"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 12348"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=NULL</" 12349"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>bytea " 12350"<function>ST_AsPNG</function></funcdef> <paramdef><type>raster </type> " 12351"<parameter>rast</parameter></paramdef> <paramdef><type>integer[] </type> " 12352"<parameter>nbands</parameter></paramdef> <paramdef><type>integer </type> " 12353"<parameter>compression</parameter></paramdef> </funcprototype> " 12354"<funcprototype> <funcdef>bytea <function>ST_AsPNG</function></funcdef> " 12355"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12356"<paramdef><type>integer[] </type> <parameter>nbands</parameter></paramdef> " 12357"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=NULL</" 12358"parameter></paramdef> </funcprototype>" 12359 12360#. Tag: para 12361#: reference_raster.xml:6228 12362#, no-c-format 12363msgid "" 12364"Returns the selected bands of the raster as a single Portable Network " 12365"Graphics Image (PNG). Use <xref linkend=\"RT_ST_AsGDALRaster\"/> if you need " 12366"to export as less common raster types. If no band is specified, then the " 12367"first 3 bands are exported. There are many variants of the function with " 12368"many options. If no <varname>srid</varname> is specified then then srid of " 12369"the raster is used. These are itemized below:" 12370msgstr "" 12371 12372#. Tag: para 12373#: reference_raster.xml:6236 12374#, no-c-format 12375msgid "" 12376"<varname>nbands</varname> is an array of bands to export (note that max is 4 " 12377"for PNG) and the order of the bands is RGBA. e.g ARRAY[3,2,1] means map band " 12378"3 to Red, band 2 to green and band 1 to blue" 12379msgstr "" 12380 12381#. Tag: para 12382#: reference_raster.xml:6241 12383#, no-c-format 12384msgid "" 12385"<varname>compression</varname> number from 1 to 9. The higher the number the " 12386"greater the compression." 12387msgstr "" 12388 12389#. Tag: para 12390#: reference_raster.xml:6246 12391#, no-c-format 12392msgid "" 12393"<varname>options</varname> text Array of GDAL options as defined for PNG " 12394"(look at create_options for PNG of <xref linkend=\"RT_ST_GDALDrivers\"/>). " 12395"For PNG valid one is only ZLEVEL (amount of time to spend on compression -- " 12396"default 6) e.g. ARRAY['ZLEVEL=9']. WORLDFILE is not allowed since the " 12397"function would have to output two outputs. Refer to <ulink url=\"http://www." 12398"gdal.org/frmt_various.html\">GDAL Raster format options</ulink> for more " 12399"details." 12400msgstr "" 12401 12402#. Tag: programlisting 12403#: reference_raster.xml:6265 12404#, no-c-format 12405msgid "" 12406"SELECT ST_AsPNG(rast) As rastpng\n" 12407"FROM dummy_rast WHERE rid=2;\n" 12408"\n" 12409"-- export the first 3 bands and map band 3 to Red, band 1 to Green, band 2 " 12410"to blue\n" 12411"SELECT ST_AsPNG(rast, ARRAY[3,1,2]) As rastpng\n" 12412"FROM dummy_rast WHERE rid=2;" 12413msgstr "" 12414"SELECT ST_AsPNG(rast) As rastpng\n" 12415"FROM dummy_rast WHERE rid=2;\n" 12416"\n" 12417"-- esporta le prime tre bande e assegna la banda 3 al rosso, la banda 1 al " 12418"verde e la banda 2 al blu\n" 12419"SELECT ST_AsPNG(rast, ARRAY[3,1,2]) As rastpng\n" 12420"FROM dummy_rast WHERE rid=2;" 12421 12422#. Tag: para 12423#: reference_raster.xml:6272 12424#, no-c-format 12425msgid "" 12426", <xref linkend=\"RT_ST_ColorMap\"/>, <xref linkend=\"RT_ST_GDALDrivers\"/>, " 12427"<xref linkend=\"RT_Raster_Applications\"/>" 12428msgstr "" 12429 12430#. Tag: refname 12431#: reference_raster.xml:6278 12432#, no-c-format 12433msgid "ST_AsTIFF" 12434msgstr "ST_AsTIFF" 12435 12436#. Tag: refpurpose 12437#: reference_raster.xml:6279 12438#, no-c-format 12439msgid "" 12440"Return the raster selected bands as a single TIFF image (byte array). If no " 12441"band is specified or any of specified bands does not exist in the raster, " 12442"then will try to use all bands." 12443msgstr "" 12444 12445#. Tag: funcsynopsis 12446#: reference_raster.xml:6283 12447#, no-c-format 12448msgid "" 12449"<funcprototype> <funcdef>bytea <function>ST_AsTIFF</function></funcdef> " 12450"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12451"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=''</" 12452"parameter></paramdef> <paramdef><type>integer </type> " 12453"<parameter>srid=sameassource</parameter></paramdef> </funcprototype> " 12454"<funcprototype> <funcdef>bytea <function>ST_AsTIFF</function></funcdef> " 12455"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12456"<paramdef choice=\"opt\"><type>text </type> <parameter>compression=''</" 12457"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 12458"<parameter>srid=sameassource</parameter></paramdef> </funcprototype> " 12459"<funcprototype> <funcdef>bytea <function>ST_AsTIFF</function></funcdef> " 12460"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12461"<paramdef><type>integer[] </type> <parameter>nbands</parameter></paramdef> " 12462"<paramdef choice=\"opt\"><type>text </type> <parameter>compression=''</" 12463"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 12464"<parameter>srid=sameassource</parameter></paramdef> </funcprototype> " 12465"<funcprototype> <funcdef>bytea <function>ST_AsTIFF</function></funcdef> " 12466"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12467"<paramdef><type>integer[] </type> <parameter>nbands</parameter></paramdef> " 12468"<paramdef><type>text[] </type> <parameter>options</parameter></paramdef> " 12469"<paramdef><type>integer </type> <parameter>srid=sameassource</parameter></" 12470"paramdef> </funcprototype>" 12471msgstr "" 12472"<funcprototype> <funcdef>bytea <function>ST_AsTIFF</function></funcdef> " 12473"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12474"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=''</" 12475"parameter></paramdef> <paramdef><type>integer </type> " 12476"<parameter>srid=sameassource</parameter></paramdef> </funcprototype> " 12477"<funcprototype> <funcdef>bytea <function>ST_AsTIFF</function></funcdef> " 12478"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12479"<paramdef choice=\"opt\"><type>text </type> <parameter>compression=''</" 12480"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 12481"<parameter>srid=sameassource</parameter></paramdef> </funcprototype> " 12482"<funcprototype> <funcdef>bytea <function>ST_AsTIFF</function></funcdef> " 12483"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12484"<paramdef><type>integer[] </type> <parameter>nbands</parameter></paramdef> " 12485"<paramdef choice=\"opt\"><type>text </type> <parameter>compression=''</" 12486"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 12487"<parameter>srid=sameassource</parameter></paramdef> </funcprototype> " 12488"<funcprototype> <funcdef>bytea <function>ST_AsTIFF</function></funcdef> " 12489"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12490"<paramdef><type>integer[] </type> <parameter>nbands</parameter></paramdef> " 12491"<paramdef><type>text[] </type> <parameter>options</parameter></paramdef> " 12492"<paramdef><type>integer </type> <parameter>srid=sameassource</parameter></" 12493"paramdef> </funcprototype>" 12494 12495#. Tag: para 12496#: reference_raster.xml:6316 12497#, no-c-format 12498msgid "" 12499"Returns the selected bands of the raster as a single Tagged Image File " 12500"Format (TIFF). If no band is specified, will try to use all bands. This is a " 12501"wrapper around <xref linkend=\"RT_ST_AsGDALRaster\"/>. Use <xref linkend=" 12502"\"RT_ST_AsGDALRaster\"/> if you need to export as less common raster types. " 12503"There are many variants of the function with many options. If no spatial " 12504"reference SRS text is present, the spatial reference of the raster is used. " 12505"These are itemized below:" 12506msgstr "" 12507 12508#. Tag: para 12509#: reference_raster.xml:6319 12510#, no-c-format 12511msgid "" 12512"<varname>nbands</varname> is an array of bands to export (note that max is 3 " 12513"for PNG) and the order of the bands is RGB. e.g ARRAY[3,2,1] means map band " 12514"3 to Red, band 2 to green and band 1 to blue" 12515msgstr "" 12516 12517#. Tag: para 12518#: reference_raster.xml:6324 12519#, no-c-format 12520msgid "" 12521"<varname>compression</varname> Compression expression -- JPEG90 (or some " 12522"other percent), LZW, JPEG, DEFLATE9." 12523msgstr "" 12524 12525#. Tag: para 12526#: reference_raster.xml:6329 12527#, no-c-format 12528msgid "" 12529"<varname>options</varname> text Array of GDAL create options as defined for " 12530"GTiff (look at create_options for GTiff of <xref linkend=\"RT_ST_GDALDrivers" 12531"\"/>). or refer to <ulink url=\"http://www.gdal.org/frmt_various.html\">GDAL " 12532"Raster format options</ulink> for more details." 12533msgstr "" 12534 12535#. Tag: para 12536#: reference_raster.xml:6334 12537#, no-c-format 12538msgid "" 12539"<varname>srid</varname> srid of spatial_ref_sys of the raster. This is used " 12540"to populate the georeference information" 12541msgstr "" 12542 12543#. Tag: title 12544#: reference_raster.xml:6343 12545#, no-c-format 12546msgid "Examples: Use jpeg compression 90%" 12547msgstr "" 12548 12549#. Tag: programlisting 12550#: reference_raster.xml:6345 12551#, no-c-format 12552msgid "" 12553"SELECT ST_AsTIFF(rast, 'JPEG90') As rasttiff\n" 12554"FROM dummy_rast WHERE rid=2;" 12555msgstr "" 12556 12557#. Tag: para 12558#: reference_raster.xml:6352 12559#, no-c-format 12560msgid "" 12561", <xref linkend=\"RT_ST_AsGDALRaster\"/>, <xref linkend=\"RT_ST_SRID\"/>" 12562msgstr "" 12563", <xref linkend=\"RT_ST_AsGDALRaster\"/>, <xref linkend=\"RT_ST_SRID\"/>" 12564 12565#. Tag: title 12566#: reference_raster.xml:6358 12567#, no-c-format 12568msgid "Raster Processing" 12569msgstr "" 12570 12571#. Tag: title 12572#: reference_raster.xml:6361 12573#, no-c-format 12574msgid "Map Algebra" 12575msgstr "" 12576 12577#. Tag: refname 12578#: reference_raster.xml:6365 12579#, no-c-format 12580msgid "ST_Clip" 12581msgstr "ST_Clip" 12582 12583#. Tag: refpurpose 12584#: reference_raster.xml:6366 12585#, no-c-format 12586msgid "" 12587"Returns the raster clipped by the input geometry. If band number not is " 12588"specified, all bands are processed. If <varname>crop</varname> is not " 12589"specified or TRUE, the output raster is cropped." 12590msgstr "" 12591 12592#. Tag: funcsynopsis 12593#: reference_raster.xml:6370 12594#, no-c-format 12595msgid "" 12596"<funcprototype> <funcdef>raster <function>ST_Clip</function></funcdef> " 12597"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12598"<paramdef><type>integer[] </type> <parameter>nband</parameter></paramdef> " 12599"<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef> " 12600"<paramdef choice=\"opt\"><type>double precision[] </type> " 12601"<parameter>nodataval=NULL</parameter></paramdef> <paramdef choice=\"opt" 12602"\"><type>boolean </type> <parameter>crop=TRUE</parameter></paramdef> </" 12603"funcprototype> <funcprototype> <funcdef>raster <function>ST_Clip</function></" 12604"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 12605"paramdef> <paramdef><type>integer </type> <parameter>nband</parameter></" 12606"paramdef> <paramdef><type>geometry </type> <parameter>geom</parameter></" 12607"paramdef> <paramdef><type>double precision </type> <parameter>nodataval</" 12608"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 12609"<parameter>crop=TRUE</parameter></paramdef> </funcprototype> <funcprototype> " 12610"<funcdef>raster <function>ST_Clip</function></funcdef> " 12611"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12612"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 12613"<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef> " 12614"<paramdef><type>boolean </type> <parameter>crop</parameter></paramdef> </" 12615"funcprototype> <funcprototype> <funcdef>raster <function>ST_Clip</function></" 12616"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 12617"paramdef> <paramdef><type>geometry </type> <parameter>geom</parameter></" 12618"paramdef> <paramdef choice=\"opt\"><type>double precision[] </type> " 12619"<parameter>nodataval=NULL</parameter></paramdef> <paramdef choice=\"opt" 12620"\"><type>boolean </type> <parameter>crop=TRUE</parameter></paramdef> </" 12621"funcprototype> <funcprototype> <funcdef>raster <function>ST_Clip</function></" 12622"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 12623"paramdef> <paramdef><type>geometry </type> <parameter>geom</parameter></" 12624"paramdef> <paramdef><type>double precision </type> <parameter>nodataval</" 12625"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 12626"<parameter>crop=TRUE</parameter></paramdef> </funcprototype> <funcprototype> " 12627"<funcdef>raster <function>ST_Clip</function></funcdef> " 12628"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12629"<paramdef><type>geometry </type> <parameter>geom</parameter></paramdef> " 12630"<paramdef><type>boolean </type> <parameter>crop</parameter></paramdef> </" 12631"funcprototype>" 12632msgstr "" 12633 12634#. Tag: para 12635#: reference_raster.xml:6427 12636#, no-c-format 12637msgid "" 12638"Returns a raster that is clipped by the input geometry <varname>geom</" 12639"varname>. If band index is not specified, all bands are processed." 12640msgstr "" 12641 12642#. Tag: para 12643#: reference_raster.xml:6431 12644#, no-c-format 12645msgid "" 12646"Rasters resulting from ST_Clip must have a nodata value assigned for areas " 12647"clipped, one for each band. If none are provided and the input raster do not " 12648"have a nodata value defined, nodata values of the resulting raster are set " 12649"to ST_MinPossibleValue(ST_BandPixelType(rast, band)). When the number of " 12650"nodata value in the array is smaller than the number of band, the last one " 12651"in the array is used for the remaining bands. If the number of nodata value " 12652"is greater than the number of band, the extra nodata values are ignored. All " 12653"variants accepting an array of nodata values also accept a single value " 12654"which will be assigned to each band." 12655msgstr "" 12656 12657#. Tag: para 12658#: reference_raster.xml:6435 12659#, no-c-format 12660msgid "" 12661"If <varname>crop</varname> is not specified, true is assumed meaning the " 12662"output raster is cropped to the intersection of the <varname>geom</" 12663"varname>and <varname>rast</varname> extents. If <varname>crop</varname> is " 12664"set to false, the new raster gets the same extent as <varname>rast</varname>." 12665msgstr "" 12666 12667#. Tag: para 12668#: reference_raster.xml:6441 12669#, no-c-format 12670msgid "Enhanced: 2.1.0 Rewritten in C" 12671msgstr "" 12672 12673#. Tag: para 12674#: reference_raster.xml:6443 12675#, no-c-format 12676msgid "" 12677"Examples here use Massachusetts aerial data available on MassGIS site <ulink " 12678"url=\"http://www.mass.gov/mgis/colororthos2008.htm\">MassGIS Aerial Orthos</" 12679"ulink>. Coordinates are in Massachusetts State Plane Meters." 12680msgstr "" 12681 12682#. Tag: title 12683#: reference_raster.xml:6449 12684#, no-c-format 12685msgid "Examples: 1 band clipping" 12686msgstr "" 12687 12688#. Tag: programlisting 12689#: reference_raster.xml:6451 12690#, no-c-format 12691msgid "" 12692"-- Clip the first band of an aerial tile by a 20 meter buffer.\n" 12693"SELECT ST_Clip(rast, 1,\n" 12694" ST_Buffer(ST_Centroid(ST_Envelope(rast)),20)\n" 12695" ) from aerials.boston\n" 12696"WHERE rid = 4;" 12697msgstr "" 12698 12699#. Tag: programlisting 12700#: reference_raster.xml:6453 12701#, no-c-format 12702msgid "" 12703"-- Demonstrate effect of crop on final dimensions of raster\n" 12704"-- Note how final extent is clipped to that of the geometry\n" 12705"-- if crop = true\n" 12706"SELECT ST_XMax(ST_Envelope(ST_Clip(rast, 1, clipper, true))) As " 12707"xmax_w_trim,\n" 12708" ST_XMax(clipper) As xmax_clipper,\n" 12709" ST_XMax(ST_Envelope(ST_Clip(rast, 1, clipper, false))) As " 12710"xmax_wo_trim,\n" 12711" ST_XMax(ST_Envelope(rast)) As xmax_rast_orig\n" 12712"FROM (SELECT rast, ST_Buffer(ST_Centroid(ST_Envelope(rast)),6) As clipper\n" 12713" FROM aerials.boston\n" 12714"WHERE rid = 6) As foo;\n" 12715"\n" 12716" xmax_w_trim | xmax_clipper | xmax_wo_trim | xmax_rast_orig\n" 12717"------------------+------------------+------------------+------------------\n" 12718" 230657.436173996 | 230657.436173996 | 230666.436173996 | 230666.436173996" 12719msgstr "" 12720 12721#. Tag: para 12722#: reference_raster.xml:6467 reference_raster.xml:6510 12723#: reference_raster.xml:6553 12724#, no-c-format 12725msgid "Full raster tile before clipping" 12726msgstr "" 12727 12728#. Tag: para 12729#: reference_raster.xml:6481 reference_raster.xml:6567 12730#, no-c-format 12731msgid "After Clipping" 12732msgstr "" 12733 12734#. Tag: title 12735#: reference_raster.xml:6494 12736#, no-c-format 12737msgid "" 12738"Examples: 1 band clipping with no crop and add back other bands unchanged" 12739msgstr "" 12740 12741#. Tag: programlisting 12742#: reference_raster.xml:6496 12743#, no-c-format 12744msgid "" 12745"-- Same example as before, but we need to set crop to false to be able to " 12746"use ST_AddBand\n" 12747"-- because ST_AddBand requires all bands be the same Width and height\n" 12748"SELECT ST_AddBand(ST_Clip(rast, 1,\n" 12749" ST_Buffer(ST_Centroid(ST_Envelope(rast)),20),false\n" 12750" ), ARRAY[ST_Band(rast,2),ST_Band(rast,3)] ) from aerials.boston\n" 12751"WHERE rid = 6;" 12752msgstr "" 12753 12754#. Tag: para 12755#: reference_raster.xml:6524 12756#, no-c-format 12757msgid "After Clipping - surreal" 12758msgstr "" 12759 12760#. Tag: title 12761#: reference_raster.xml:6537 12762#, no-c-format 12763msgid "Examples: Clip all bands" 12764msgstr "" 12765 12766#. Tag: programlisting 12767#: reference_raster.xml:6539 12768#, no-c-format 12769msgid "" 12770"-- Clip all bands of an aerial tile by a 20 meter buffer.\n" 12771"-- Only difference is we don't specify a specific band to clip\n" 12772"-- so all bands are clipped\n" 12773"SELECT ST_Clip(rast,\n" 12774" ST_Buffer(ST_Centroid(ST_Envelope(rast)), 20),\n" 12775" false\n" 12776" ) from aerials.boston\n" 12777"WHERE rid = 4;" 12778msgstr "" 12779 12780#. Tag: para 12781#: reference_raster.xml:6582 12782#, no-c-format 12783msgid "" 12784", <xref linkend=\"RT_ST_MapAlgebra\"/>, <xref linkend=\"RT_ST_Intersection\"/" 12785">" 12786msgstr "" 12787 12788#. Tag: refname 12789#: reference_raster.xml:6592 12790#, no-c-format 12791msgid "ST_ColorMap" 12792msgstr "" 12793 12794#. Tag: refpurpose 12795#: reference_raster.xml:6593 12796#, no-c-format 12797msgid "" 12798"Creates a new raster of up to four 8BUI bands (grayscale, RGB, RGBA) from " 12799"the source raster and a specified band. Band 1 is assumed if not specified." 12800msgstr "" 12801 12802#. Tag: funcprototype 12803#: reference_raster.xml:6598 12804#, no-c-format 12805msgid "" 12806"<funcdef>raster <function>ST_ColorMap</function></funcdef> " 12807"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12808"<paramdef choice=\"opt\"><type>integer </type> <parameter>nband=1</" 12809"parameter></paramdef> <paramdef choice=\"opt\"><type>text </type> " 12810"<parameter>colormap=grayscale</parameter></paramdef> <paramdef choice=\"opt" 12811"\"><type>text </type> <parameter>method=INTERPOLATE</parameter></paramdef>" 12812msgstr "" 12813 12814#. Tag: funcprototype 12815#: reference_raster.xml:6608 12816#, no-c-format 12817msgid "" 12818"<funcdef>raster <function>ST_ColorMap</function></funcdef> " 12819"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 12820"<paramdef><type>text </type> <parameter>colormap</parameter></paramdef> " 12821"<paramdef choice=\"opt\"><type>text </type> <parameter>method=INTERPOLATE</" 12822"parameter></paramdef>" 12823msgstr "" 12824 12825#. Tag: para 12826#: reference_raster.xml:6620 12827#, no-c-format 12828msgid "" 12829"Apply a <varname>colormap</varname> to the band at <varname>nband</varname> " 12830"of <varname>rast</varname> resulting a new raster comprised of up to four " 12831"8BUI bands. The number of 8BUI bands in the new raster is determined by the " 12832"number of color components defined in <varname>colormap</varname>." 12833msgstr "" 12834 12835#. Tag: para 12836#: reference_raster.xml:6624 12837#, no-c-format 12838msgid "If <varname>nband</varname> is not specified, then band 1 is assumed." 12839msgstr "" 12840 12841#. Tag: para 12842#: reference_raster.xml:6626 12843#, no-c-format 12844msgid "" 12845"<varname>colormap</varname> can be a keyword of a pre-defined colormap or a " 12846"set of lines defining the value and the color components." 12847msgstr "" 12848 12849#. Tag: para 12850#: reference_raster.xml:6630 12851#, no-c-format 12852msgid "Valid pre-defined <varname>colormap</varname> keyword:" 12853msgstr "" 12854 12855#. Tag: para 12856#: reference_raster.xml:6636 12857#, no-c-format 12858msgid "" 12859"<varname>grayscale</varname> or <varname>greyscale</varname> for a one 8BUI " 12860"band raster of shades of gray." 12861msgstr "" 12862 12863#. Tag: para 12864#: reference_raster.xml:6641 12865#, no-c-format 12866msgid "" 12867"<varname>pseudocolor</varname> for a four 8BUI (RGBA) band raster with " 12868"colors going from blue to green to red." 12869msgstr "" 12870 12871#. Tag: para 12872#: reference_raster.xml:6646 12873#, no-c-format 12874msgid "" 12875"<varname>fire</varname> for a four 8BUI (RGBA) band raster with colors going " 12876"from black to red to pale yellow." 12877msgstr "" 12878 12879#. Tag: para 12880#: reference_raster.xml:6651 12881#, no-c-format 12882msgid "" 12883"<varname>bluered</varname> for a four 8BUI (RGBA) band raster with colors " 12884"going from blue to pale white to red." 12885msgstr "" 12886 12887#. Tag: para 12888#: reference_raster.xml:6657 12889#, no-c-format 12890msgid "" 12891"Users can pass a set of entries (one per line) to <varname>colormap</" 12892"varname> to specify custom colormaps. Each entry generally consists of five " 12893"values: the pixel value and corresponding Red, Green, Blue, Alpha components " 12894"(color components between 0 and 255). Percent values can be used instead of " 12895"pixel values where 0% and 100% are the minimum and maximum values found in " 12896"the raster band. Values can be separated with commas (','), tabs, colons " 12897"(':') and/or spaces. The pixel value can be set to <emphasis>nv</emphasis>, " 12898"<emphasis>null</emphasis> or <emphasis>nodata</emphasis> for the NODATA " 12899"value. An example is provided below." 12900msgstr "" 12901 12902#. Tag: programlisting 12903#: reference_raster.xml:6661 12904#, no-c-format 12905msgid "" 12906"5 0 0 0 255\n" 12907"4 100:50 55 255\n" 12908"1 150,100 150 255\n" 12909"0% 255 255 255 255\n" 12910"nv 0 0 0 0" 12911msgstr "" 12912 12913#. Tag: para 12914#: reference_raster.xml:6663 12915#, no-c-format 12916msgid "" 12917"The syntax of <varname>colormap</varname> is similar to that of the color-" 12918"relief mode of GDAL <ulink url=\"http://www.gdal.org/gdaldem." 12919"html#gdaldem_color_relief\">gdaldem</ulink>." 12920msgstr "" 12921 12922#. Tag: para 12923#: reference_raster.xml:6667 12924#, no-c-format 12925msgid "Valid keywords for <varname>method</varname>:" 12926msgstr "" 12927 12928#. Tag: para 12929#: reference_raster.xml:6673 12930#, no-c-format 12931msgid "" 12932"<varname>INTERPOLATE</varname> to use linear interpolation to smoothly blend " 12933"the colors between the given pixel values" 12934msgstr "" 12935 12936#. Tag: para 12937#: reference_raster.xml:6678 12938#, no-c-format 12939msgid "" 12940"<varname>EXACT</varname> to strictly match only those pixels values found in " 12941"the colormap. Pixels whose value does not match a colormap entry will be set " 12942"to 0 0 0 0 (RGBA)" 12943msgstr "" 12944 12945#. Tag: para 12946#: reference_raster.xml:6683 12947#, no-c-format 12948msgid "" 12949"<varname>NEAREST</varname> to use the colormap entry whose value is closest " 12950"to the pixel value" 12951msgstr "" 12952 12953#. Tag: para 12954#: reference_raster.xml:6690 12955#, no-c-format 12956msgid "" 12957"A great reference for colormaps is <ulink url=\"http://www.colorbrewer2.org" 12958"\">ColorBrewer</ulink>." 12959msgstr "" 12960 12961#. Tag: para 12962#: reference_raster.xml:6695 12963#, no-c-format 12964msgid "" 12965"The resulting bands of new raster will have no NODATA value set. Use <xref " 12966"linkend=\"RT_ST_SetBandNoDataValue\"/> to set a NODATA value if one is " 12967"needed." 12968msgstr "" 12969 12970#. Tag: para 12971#: reference_raster.xml:6705 12972#, no-c-format 12973msgid "This is a junk table to play with" 12974msgstr "" 12975 12976#. Tag: programlisting 12977#: reference_raster.xml:6707 12978#, no-c-format 12979msgid "" 12980"-- setup test raster table --\n" 12981"DROP TABLE IF EXISTS funky_shapes;\n" 12982"CREATE TABLE funky_shapes(rast raster);\n" 12983"\n" 12984"INSERT INTO funky_shapes(rast)\n" 12985"WITH ref AS (\n" 12986" SELECT ST_MakeEmptyRaster( 200, 200, 0, 200, 1, -1, 0, 0) AS rast\n" 12987")\n" 12988"SELECT\n" 12989" ST_Union(rast)\n" 12990"FROM (\n" 12991" SELECT\n" 12992" ST_AsRaster(\n" 12993" ST_Rotate(\n" 12994" ST_Buffer(\n" 12995" ST_GeomFromText('LINESTRING(0 2,50 " 12996"50,150 150,125 50)'),\n" 12997" i*2\n" 12998" ),\n" 12999" pi() * i * 0.125, ST_Point(50,50)\n" 13000" ),\n" 13001" ref.rast, '8BUI'::text, i * 5\n" 13002" ) AS rast\n" 13003" FROM ref\n" 13004" CROSS JOIN generate_series(1, 10, 3) AS i\n" 13005") AS shapes;" 13006msgstr "" 13007 13008#. Tag: programlisting 13009#: reference_raster.xml:6709 13010#, no-c-format 13011msgid "" 13012"SELECT\n" 13013" ST_NumBands(rast) As n_orig,\n" 13014" ST_NumBands(ST_ColorMap(rast,1, 'greyscale')) As ngrey,\n" 13015" ST_NumBands(ST_ColorMap(rast,1, 'pseudocolor')) As npseudo,\n" 13016" ST_NumBands(ST_ColorMap(rast,1, 'fire')) As nfire,\n" 13017" ST_NumBands(ST_ColorMap(rast,1, 'bluered')) As nbluered,\n" 13018" ST_NumBands(ST_ColorMap(rast,1, '\n" 13019"100% 255 0 0\n" 13020" 80% 160 0 0\n" 13021" 50% 130 0 0\n" 13022" 30% 30 0 0\n" 13023" 20% 60 0 0\n" 13024" 0% 0 0 0\n" 13025" nv 255 255 255\n" 13026" ')) As nred\n" 13027"FROM funky_shapes;" 13028msgstr "" 13029 13030#. Tag: screen 13031#: reference_raster.xml:6711 13032#, no-c-format 13033msgid "" 13034"n_orig | ngrey | npseudo | nfire | nbluered | nred\n" 13035"--------+-------+---------+-------+----------+------\n" 13036" 1 | 1 | 4 | 4 | 4 | 3" 13037msgstr "" 13038 13039#. Tag: title 13040#: reference_raster.xml:6715 13041#, no-c-format 13042msgid "Examples: Compare different color map looks using ST_AsPNG" 13043msgstr "" 13044 13045#. Tag: programlisting 13046#: reference_raster.xml:6716 13047#, no-c-format 13048msgid "" 13049"SELECT\n" 13050" ST_AsPNG(rast) As orig_png,\n" 13051" ST_AsPNG(ST_ColorMap(rast,1,'greyscale')) As grey_png,\n" 13052" ST_AsPNG(ST_ColorMap(rast,1, 'pseudocolor')) As pseudo_png,\n" 13053" ST_AsPNG(ST_ColorMap(rast,1, 'nfire')) As fire_png,\n" 13054" ST_AsPNG(ST_ColorMap(rast,1, 'bluered')) As bluered_png,\n" 13055" ST_AsPNG(ST_ColorMap(rast,1, '\n" 13056"100% 255 0 0\n" 13057" 80% 160 0 0\n" 13058" 50% 130 0 0\n" 13059" 30% 30 0 0\n" 13060" 20% 60 0 0\n" 13061" 0% 0 0 0\n" 13062" nv 255 255 255\n" 13063" ')) As red_png\n" 13064"FROM funky_shapes;" 13065msgstr "" 13066 13067#. Tag: para 13068#: reference_raster.xml:6730 13069#, no-c-format 13070msgid "orig_png" 13071msgstr "" 13072 13073#. Tag: para 13074#: reference_raster.xml:6744 13075#, no-c-format 13076msgid "grey_png" 13077msgstr "" 13078 13079#. Tag: para 13080#: reference_raster.xml:6758 13081#, no-c-format 13082msgid "pseudo_png" 13083msgstr "" 13084 13085#. Tag: para 13086#: reference_raster.xml:6774 13087#, no-c-format 13088msgid "fire_png" 13089msgstr "" 13090 13091#. Tag: para 13092#: reference_raster.xml:6788 13093#, no-c-format 13094msgid "bluered_png" 13095msgstr "" 13096 13097#. Tag: para 13098#: reference_raster.xml:6802 13099#, no-c-format 13100msgid "red_png" 13101msgstr "" 13102 13103#. Tag: para 13104#: reference_raster.xml:6816 13105#, fuzzy, no-c-format 13106msgid "" 13107", <xref linkend=\"RT_ST_AsRaster\"/> <xref linkend=\"RT_ST_MapAlgebra\"/>, " 13108"<xref linkend=\"RT_ST_Grayscale\"/> <xref linkend=\"RT_ST_NumBands\"/>, " 13109"<xref linkend=\"RT_ST_Reclass\"/>, <xref linkend=\"RT_ST_SetBandNoDataValue" 13110"\"/>, <xref linkend=\"RT_ST_Union\"/>" 13111msgstr "" 13112", <xref linkend=\"RT_ST_Min4ma\"/>, <xref linkend=\"RT_ST_Max4ma\"/>, <xref " 13113"linkend=\"RT_ST_Sum4ma\"/>, <xref linkend=\"RT_ST_Mean4ma\"/>, <xref linkend=" 13114"\"RT_ST_Range4ma\"/>, <xref linkend=\"RT_ST_Distinct4ma\"/>, <xref linkend=" 13115"\"RT_ST_StdDev4ma\"/>" 13116 13117#. Tag: refname 13118#: reference_raster.xml:6831 13119#, fuzzy, no-c-format 13120msgid "ST_Grayscale" 13121msgstr "ST_Rescale" 13122 13123#. Tag: refpurpose 13124#: reference_raster.xml:6832 13125#, no-c-format 13126msgid "" 13127"Creates a new one-8BUI band raster from the source raster and specified " 13128"bands representing Red, Green and Blue" 13129msgstr "" 13130 13131#. Tag: funcprototype 13132#: reference_raster.xml:6837 13133#, fuzzy, no-c-format 13134msgid "" 13135"<funcdef>(1) raster <function>ST_Grayscale</function></funcdef> " 13136"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 13137"<paramdef choice=\"opt\"><type>integer </type> <parameter>redband=1</" 13138"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 13139"<parameter>greenband=2</parameter></paramdef> <paramdef choice=\"opt" 13140"\"><type>integer </type> <parameter>blueband=3</parameter></paramdef> " 13141"<paramdef choice=\"opt\"><type>text </type> " 13142"<parameter>extenttype=INTERSECTION</parameter></paramdef>" 13143msgstr "" 13144"<funcdef>bytea <function>ST_AsGDALRaster</function></funcdef> " 13145"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 13146"<paramdef><type>text </type> <parameter>format</parameter></paramdef> " 13147"<paramdef choice=\"opt\"><type>text[] </type> <parameter>options=NULL</" 13148"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 13149"<parameter>srid=sameassource</parameter></paramdef>" 13150 13151#. Tag: funcprototype 13152#: reference_raster.xml:6848 13153#, fuzzy, no-c-format 13154msgid "" 13155"<funcdef>(2) raster <function>ST_Grayscale</function></funcdef> " 13156"<paramdef><type>rastbandarg[] </type> <parameter>rastbandargset</parameter></" 13157"paramdef> <paramdef choice=\"opt\"><type>text </type> " 13158"<parameter>extenttype=INTERSECTION</parameter></paramdef>" 13159msgstr "" 13160"<funcdef>text <function>ST_GeoReference</function></funcdef> " 13161"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 13162"<paramdef choice=\"opt\"><type>text </type> <parameter>format=GDAL</" 13163"parameter></paramdef>" 13164 13165#. Tag: para 13166#: reference_raster.xml:6859 13167#, no-c-format 13168msgid "" 13169"Create a raster with one 8BUI band given three input bands (from one or more " 13170"rasters). Any input band whose pixel type is not 8BUI will be reclassified " 13171"using <xref linkend=\"RT_ST_Reclass\"/>." 13172msgstr "" 13173 13174#. Tag: para 13175#: reference_raster.xml:6864 13176#, no-c-format 13177msgid "" 13178"This function is not like <xref linkend=\"RT_ST_ColorMap\"/> with the " 13179"<varname>grayscale</varname> keyword as ST_ColorMap operates on only one " 13180"band while this function expects three bands for RGB. This function applies " 13181"the following equation for converting RGB to Grayscale: 0.2989 * RED + " 13182"0.5870 * GREEN + 0.1140 * BLUE" 13183msgstr "" 13184 13185#. Tag: programlisting 13186#: reference_raster.xml:6876 13187#, no-c-format 13188msgid "" 13189"SET postgis.gdal_enabled_drivers = 'ENABLE_ALL';\n" 13190"SET postgis.enable_outdb_rasters = True;\n" 13191"\n" 13192"WITH apple AS (\n" 13193" SELECT ST_AddBand(\n" 13194" ST_MakeEmptyRaster(350, 246, 0, 0, 1, -1, 0, 0, 0),\n" 13195" '/tmp/apple.png'::text,\n" 13196" NULL::int[]\n" 13197" ) AS rast\n" 13198")\n" 13199"SELECT\n" 13200" ST_AsPNG(rast) AS original_png,\n" 13201" ST_AsPNG(ST_Grayscale(rast)) AS grayscale_png\n" 13202"FROM apple;" 13203msgstr "" 13204 13205#. Tag: para 13206#: reference_raster.xml:6890 13207#, no-c-format 13208msgid "original_png" 13209msgstr "" 13210 13211#. Tag: para 13212#: reference_raster.xml:6904 13213#, no-c-format 13214msgid "grayscale_png" 13215msgstr "" 13216 13217#. Tag: programlisting 13218#: reference_raster.xml:6920 13219#, no-c-format 13220msgid "" 13221"SET postgis.gdal_enabled_drivers = 'ENABLE_ALL';\n" 13222"SET postgis.enable_outdb_rasters = True;\n" 13223"\n" 13224"WITH apple AS (\n" 13225" SELECT ST_AddBand(\n" 13226" ST_MakeEmptyRaster(350, 246, 0, 0, 1, -1, 0, 0, 0),\n" 13227" '/tmp/apple.png'::text,\n" 13228" NULL::int[]\n" 13229" ) AS rast\n" 13230")\n" 13231"SELECT\n" 13232" ST_AsPNG(rast) AS original_png,\n" 13233" ST_AsPNG(ST_Grayscale(\n" 13234" ARRAY[\n" 13235" ROW(rast, 1)::rastbandarg, -- red\n" 13236" ROW(rast, 2)::rastbandarg, -- green\n" 13237" ROW(rast, 3)::rastbandarg, -- blue\n" 13238" ]::rastbandarg[]\n" 13239" )) AS grayscale_png\n" 13240"FROM apple;" 13241msgstr "" 13242 13243#. Tag: para 13244#: reference_raster.xml:6925 13245#, fuzzy, no-c-format 13246msgid ", <xref linkend=\"RT_ST_Reclass\"/>, <xref linkend=\"RT_ST_ColorMap\"/>" 13247msgstr ", <xref linkend=\"RT_ST_ScaleX\"/>, <xref linkend=\"RT_ST_ScaleY\"/>" 13248 13249#. Tag: refname 13250#: reference_raster.xml:6936 13251#, no-c-format 13252msgid "ST_Intersection" 13253msgstr "ST_Intersection" 13254 13255#. Tag: refpurpose 13256#: reference_raster.xml:6937 13257#, no-c-format 13258msgid "" 13259"<refpurpose>Returns a raster or a set of geometry-pixelvalue pairs " 13260"representing the shared portion of two rasters or the geometrical " 13261"intersection of a vectorization of the raster and a geometry.</refpurpose>" 13262msgstr "" 13263 13264#. Tag: funcsynopsis 13265#: reference_raster.xml:6941 13266#, fuzzy, no-c-format 13267msgid "" 13268"<funcprototype> <funcdef>setof geomval <function>ST_Intersection</function></" 13269"funcdef> <paramdef><type>geometry </type> <parameter>geom</parameter></" 13270"paramdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 13271"paramdef> <paramdef choice=\"opt\"><type>integer </type> " 13272"<parameter>band_num=1</parameter></paramdef> </funcprototype> " 13273"<funcprototype> <funcdef>setof geomval <function>ST_Intersection</function></" 13274"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 13275"paramdef> <paramdef><type>geometry </type> <parameter>geom</parameter></" 13276"paramdef> </funcprototype> <funcprototype> <funcdef>setof geomval " 13277"<function>ST_Intersection</function></funcdef> <paramdef><type>raster </" 13278"type> <parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 13279"<parameter>band</parameter></paramdef> <paramdef><type>geometry </type> " 13280"<parameter>geomin</parameter></paramdef> </funcprototype> <funcprototype> " 13281"<funcdef>raster <function>ST_Intersection</function></funcdef> " 13282"<paramdef><type>raster </type> <parameter>rast1</parameter></paramdef> " 13283"<paramdef><type>raster </type> <parameter>rast2</parameter></paramdef> " 13284"<paramdef><type>double precision[] </type> <parameter>nodataval</parameter></" 13285"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 13286"<function>ST_Intersection</function></funcdef> <paramdef><type>raster </" 13287"type> <parameter>rast1</parameter></paramdef> <paramdef><type>raster </type> " 13288"<parameter>rast2</parameter></paramdef> <paramdef choice=\"opt\"><type>text " 13289"</type> <parameter>returnband</parameter></paramdef> <paramdef choice=\"opt" 13290"\"><type>double precision[] </type> <parameter>nodataval</parameter></" 13291"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 13292"<function>ST_Intersection</function></funcdef> <paramdef><type>raster </" 13293"type> <parameter>rast1</parameter></paramdef> <paramdef><type>integer </" 13294"type> <parameter>band1</parameter></paramdef> <paramdef><type>raster </type> " 13295"<parameter>rast2</parameter></paramdef> <paramdef><type>integer </type> " 13296"<parameter>band2</parameter></paramdef> <paramdef><type>double precision[] </" 13297"type> <parameter>nodataval</parameter></paramdef> </funcprototype> " 13298"<funcprototype> <funcdef>raster <function>ST_Intersection</function></" 13299"funcdef> <paramdef><type>raster </type> <parameter>rast1</parameter></" 13300"paramdef> <paramdef><type>integer </type> <parameter>band1</parameter></" 13301"paramdef> <paramdef><type>raster </type> <parameter>rast2</parameter></" 13302"paramdef> <paramdef><type>integer </type> <parameter>band2</parameter></" 13303"paramdef> <paramdef choice=\"opt\"><type>text </type> <parameter>returnband</" 13304"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision[] </" 13305"type> <parameter>nodataval</parameter></paramdef> </funcprototype>" 13306msgstr "" 13307"<funcprototype> <funcdef>setof geomval <function>ST_Intersection</function></" 13308"funcdef> <paramdef><type>geometry </type> <parameter>geom</parameter></" 13309"paramdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 13310"paramdef> <paramdef choice=\"opt\"><type>integer </type> " 13311"<parameter>band_num=1</parameter></paramdef> </funcprototype> " 13312"<funcprototype> <funcdef>setof geomval <function>ST_Intersection</function></" 13313"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 13314"paramdef> <paramdef><type>geometry </type> <parameter>geom</parameter></" 13315"paramdef> </funcprototype> <funcprototype> <funcdef>setof geomval " 13316"<function>ST_Intersection</function></funcdef> <paramdef><type>raster </" 13317"type> <parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 13318"<parameter>band_num</parameter></paramdef> <paramdef><type>geometry </type> " 13319"<parameter>geom</parameter></paramdef> </funcprototype> <funcprototype> " 13320"<funcdef>raster <function>ST_Intersection</function></funcdef> " 13321"<paramdef><type>raster </type> <parameter>rast1</parameter></paramdef> " 13322"<paramdef><type>raster </type> <parameter>rast2</parameter></paramdef> " 13323"<paramdef><type>double precision[] </type> <parameter>nodataval</parameter></" 13324"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 13325"<function>ST_Intersection</function></funcdef> <paramdef><type>raster </" 13326"type> <parameter>rast1</parameter></paramdef> <paramdef><type>raster </type> " 13327"<parameter>rast2</parameter></paramdef> <paramdef choice=\"opt\"><type>text " 13328"</type> <parameter>returnband='BOTH'</parameter></paramdef> <paramdef choice=" 13329"\"opt\"><type>double precision[] </type> <parameter>nodataval=NULL</" 13330"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 13331"<function>ST_Intersection</function></funcdef> <paramdef><type>raster </" 13332"type> <parameter>rast1</parameter></paramdef> <paramdef><type>integer </" 13333"type> <parameter>band_num1</parameter></paramdef> <paramdef><type>raster </" 13334"type> <parameter>rast2</parameter></paramdef> <paramdef><type>integer </" 13335"type> <parameter>band_num2</parameter></paramdef> <paramdef><type>double " 13336"precision[] </type> <parameter>nodataval</parameter></paramdef> </" 13337"funcprototype> <funcprototype> <funcdef>raster <function>ST_Intersection</" 13338"function></funcdef> <paramdef><type>raster </type> <parameter>rast1</" 13339"parameter></paramdef> <paramdef><type>integer </type> <parameter>band_num1</" 13340"parameter></paramdef> <paramdef><type>raster </type> <parameter>rast2</" 13341"parameter></paramdef> <paramdef><type>integer </type> <parameter>band_num2</" 13342"parameter></paramdef> <paramdef choice=\"opt\"><type>text </type> " 13343"<parameter>returnband='BOTH'</parameter></paramdef> <paramdef choice=\"opt" 13344"\"><type>double precision[] </type> <parameter>nodataval=NULL</parameter></" 13345"paramdef> </funcprototype>" 13346 13347#. Tag: para 13348#: reference_raster.xml:7001 13349#, no-c-format 13350msgid "" 13351"<para>Returns a raster or a set of geometry-pixelvalue pairs representing " 13352"the shared portion of two rasters or the geometrical intersection of a " 13353"vectorization of the raster and a geometry.</para>" 13354msgstr "" 13355 13356#. Tag: para 13357#: reference_raster.xml:7005 13358#, no-c-format 13359msgid "" 13360"The first three variants, returning a setof geomval, works in vector space. " 13361"The raster is first vectorized (using ST_DumpAsPolygon) into a set of " 13362"geomval rows and those rows are then intersected with the geometry using the " 13363"ST_Intersection(geometry, geometry) PostGIS function. Geometries " 13364"intersecting only with a nodata value area of a raster returns an empty " 13365"geometry. They are normally excluded from the results by the proper usage of " 13366"ST_Intersect in the WHERE clause." 13367msgstr "" 13368 13369#. Tag: para 13370#: reference_raster.xml:7009 13371#, no-c-format 13372msgid "" 13373"You can access the geometry and the value parts of the resulting set of " 13374"geomval by surrounding them with parenthesis and adding '.geom' or '.val' at " 13375"the end of the expression. e.g. (ST_Intersection(rast, geom)).geom" 13376msgstr "" 13377 13378#. Tag: para 13379#: reference_raster.xml:7013 13380#, no-c-format 13381msgid "" 13382"The other variants, returning a raster, works in raster space. They are " 13383"using the two rasters version of ST_MapAlgebraExpr to perform the " 13384"intersection." 13385msgstr "" 13386 13387#. Tag: para 13388#: reference_raster.xml:7017 13389#, no-c-format 13390msgid "" 13391"The extent of the resulting raster corresponds to the geometrical " 13392"intersection of the two raster extents. The resulting raster includes " 13393"'BAND1', 'BAND2' or 'BOTH' bands, following what is passed as the " 13394"<varname>returnband</varname> parameter. Nodata value areas present in any " 13395"band results in nodata value areas in every bands of the result. In other " 13396"words, any pixel intersecting with a nodata value pixel becomes a nodata " 13397"value pixel in the result." 13398msgstr "" 13399 13400#. Tag: para 13401#: reference_raster.xml:7021 13402#, no-c-format 13403msgid "" 13404"Rasters resulting from ST_Intersection must have a nodata value assigned for " 13405"areas not intersecting. You can define or replace the nodata value for any " 13406"resulting band by providing a <varname>nodataval[]</varname> array of one or " 13407"two nodata values depending if you request 'BAND1', 'BAND2' or 'BOTH' bands. " 13408"The first value in the array replace the nodata value in the first band and " 13409"the second value replace the nodata value in the second band. If one input " 13410"band do not have a nodata value defined and none are provided as an array, " 13411"one is chosen using the ST_MinPossibleValue function. All variant accepting " 13412"an array of nodata value can also accept a single value which will be " 13413"assigned to each requested band." 13414msgstr "" 13415 13416#. Tag: para 13417#: reference_raster.xml:7025 13418#, no-c-format 13419msgid "" 13420"In all variants, if no band number is specified band 1 is assumed. If you " 13421"need an intersection between a raster and geometry that returns a raster, " 13422"refer to <xref linkend=\"RT_ST_Clip\"/>." 13423msgstr "" 13424 13425#. Tag: para 13426#: reference_raster.xml:7030 13427#, no-c-format 13428msgid "" 13429"To get more control on the resulting extent or on what to return when " 13430"encountering a nodata value, use the two rasters version of <xref linkend=" 13431"\"RT_ST_MapAlgebraExpr2\"/>." 13432msgstr "" 13433 13434#. Tag: para 13435#: reference_raster.xml:7036 13436#, no-c-format 13437msgid "" 13438"To compute the intersection of a raster band with a geometry in raster " 13439"space, use <xref linkend=\"RT_ST_Clip\"/>. ST_Clip works on multiple bands " 13440"rasters and does not return a band corresponding to the rasterized geometry." 13441msgstr "" 13442 13443#. Tag: para 13444#: reference_raster.xml:7042 13445#, no-c-format 13446msgid "" 13447"ST_Intersection should be used in conjunction with ST_Intersects and an " 13448"index on the raster column and/or the geometry column." 13449msgstr "" 13450 13451#. Tag: para 13452#: reference_raster.xml:7047 13453#, no-c-format 13454msgid "" 13455"Enhanced: 2.0.0 - Intersection in the raster space was introduced. In " 13456"earlier pre-2.0.0 versions, only intersection performed in vector space were " 13457"supported." 13458msgstr "" 13459 13460#. Tag: title 13461#: reference_raster.xml:7053 13462#, no-c-format 13463msgid "Examples: Geometry, Raster -- resulting in geometry vals" 13464msgstr "" 13465 13466#. Tag: programlisting 13467#: reference_raster.xml:7055 13468#, no-c-format 13469msgid "" 13470"SELECT\n" 13471" foo.rid,\n" 13472" foo.gid,\n" 13473" ST_AsText((foo.geomval).geom) As geomwkt,\n" 13474" (foo.geomval).val\n" 13475"FROM (\n" 13476" SELECT\n" 13477" A.rid,\n" 13478" g.gid,\n" 13479" ST_Intersection(A.rast, g.geom) As geomval\n" 13480" FROM dummy_rast AS A\n" 13481" CROSS JOIN (\n" 13482" VALUES\n" 13483" (1, ST_Point(3427928, 5793243.85) ),\n" 13484" (2, ST_GeomFromText('LINESTRING(3427927.85 " 13485"5793243.75,3427927.8 5793243.75,3427927.8 5793243.8)')),\n" 13486" (3, ST_GeomFromText('LINESTRING(1 2, 3 4)'))\n" 13487" ) As g(gid,geom)\n" 13488" WHERE A.rid = 2\n" 13489") As foo;\n" 13490"\n" 13491" rid | gid | " 13492"geomwkt " 13493"| val\n" 13494"-----+-----" 13495"+---------------------------------------------------------------------------------------------\n" 13496" 2 | 1 | POINT(3427928 " 13497"5793243.85) " 13498"| 249\n" 13499" 2 | 1 | POINT(3427928 " 13500"5793243.85) " 13501"| 253\n" 13502" 2 | 2 | POINT(3427927.85 " 13503"5793243.75) | " 13504"254\n" 13505" 2 | 2 | POINT(3427927.8 " 13506"5793243.8) " 13507"| 251\n" 13508" 2 | 2 | POINT(3427927.8 " 13509"5793243.8) " 13510"| 253\n" 13511" 2 | 2 | LINESTRING(3427927.8 5793243.75,3427927.8 5793243.8) | " 13512"252\n" 13513" 2 | 2 | MULTILINESTRING((3427927.8 5793243.8,3427927.8 5793243.75),...) " 13514"| 250\n" 13515" 2 | 3 | GEOMETRYCOLLECTION EMPTY" 13516msgstr "" 13517 13518#. Tag: para 13519#: reference_raster.xml:7060 13520#, no-c-format 13521msgid "" 13522", <xref linkend=\"RT_ST_Intersects\"/>, <xref linkend=" 13523"\"RT_ST_MapAlgebraExpr2\"/>, <xref linkend=\"RT_ST_Clip\"/>, <xref linkend=" 13524"\"ST_AsText\"/>" 13525msgstr "" 13526", <xref linkend=\"RT_ST_Intersects\"/>, <xref linkend=" 13527"\"RT_ST_MapAlgebraExpr2\"/>, <xref linkend=\"RT_ST_Clip\"/>, <xref linkend=" 13528"\"ST_AsText\"/>" 13529 13530#. Tag: refname 13531#: reference_raster.xml:7072 13532#, no-c-format 13533msgid "ST_MapAlgebra (callback function version)" 13534msgstr "" 13535 13536#. Tag: refpurpose 13537#: reference_raster.xml:7073 13538#, no-c-format 13539msgid "" 13540"Callback function version - Returns a one-band raster given one or more " 13541"input rasters, band indexes and one user-specified callback function." 13542msgstr "" 13543 13544#. Tag: funcsynopsis 13545#: reference_raster.xml:7079 13546#, fuzzy, no-c-format 13547msgid "" 13548"<funcprototype> <funcdef>raster <function>ST_MapAlgebra</function></funcdef> " 13549"<paramdef><type>rastbandarg[] </type> <parameter>rastbandargset</parameter></" 13550"paramdef> <paramdef><type>regprocedure </type> <parameter>callbackfunc</" 13551"parameter></paramdef> <paramdef choice=\"opt\"><type>text </type> " 13552"<parameter>pixeltype=NULL</parameter></paramdef> <paramdef choice=\"opt" 13553"\"><type>text </type> <parameter>extenttype=INTERSECTION</parameter></" 13554"paramdef> <paramdef choice=\"opt\"><type>raster </type> " 13555"<parameter>customextent=NULL</parameter></paramdef> <paramdef choice=\"opt" 13556"\"><type>integer </type> <parameter>distancex=0</parameter></paramdef> " 13557"<paramdef choice=\"opt\"><type>integer </type> <parameter>distancey=0</" 13558"parameter></paramdef> <paramdef choice=\"opt\"><type>text[] </type> " 13559"<parameter>VARIADIC userargs=NULL</parameter></paramdef> </funcprototype> " 13560"<funcprototype> <funcdef>raster <function>ST_MapAlgebra</function></funcdef> " 13561"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 13562"<paramdef><type>integer[] </type> <parameter>nband</parameter></paramdef> " 13563"<paramdef><type>regprocedure </type> <parameter>callbackfunc</parameter></" 13564"paramdef> <paramdef choice=\"opt\"><type>text </type> " 13565"<parameter>pixeltype=NULL</parameter></paramdef> <paramdef choice=\"opt" 13566"\"><type>text </type> <parameter>extenttype=FIRST</parameter></paramdef> " 13567"<paramdef choice=\"opt\"><type>raster </type> <parameter>customextent=NULL</" 13568"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 13569"<parameter>distancex=0</parameter></paramdef> <paramdef choice=\"opt" 13570"\"><type>integer </type> <parameter>distancey=0</parameter></paramdef> " 13571"<paramdef choice=\"opt\"><type>text[] </type> <parameter>VARIADIC " 13572"userargs=NULL</parameter></paramdef> </funcprototype> <funcprototype> " 13573"<funcdef>raster <function>ST_MapAlgebra</function></funcdef> " 13574"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 13575"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 13576"<paramdef><type>regprocedure </type> <parameter>callbackfunc</parameter></" 13577"paramdef> <paramdef choice=\"opt\"><type>text </type> " 13578"<parameter>pixeltype=NULL</parameter></paramdef> <paramdef choice=\"opt" 13579"\"><type>text </type> <parameter>extenttype=FIRST</parameter></paramdef> " 13580"<paramdef choice=\"opt\"><type>raster </type> <parameter>customextent=NULL</" 13581"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 13582"<parameter>distancex=0</parameter></paramdef> <paramdef choice=\"opt" 13583"\"><type>integer </type> <parameter>distancey=0</parameter></paramdef> " 13584"<paramdef choice=\"opt\"><type>text[] </type> <parameter>VARIADIC " 13585"userargs=NULL</parameter></paramdef> </funcprototype> <funcprototype> " 13586"<funcdef>raster <function>ST_MapAlgebra</function></funcdef> " 13587"<paramdef><type>raster </type> <parameter>rast1</parameter></paramdef> " 13588"<paramdef><type>integer </type> <parameter>nband1</parameter></paramdef> " 13589"<paramdef><type>raster </type> <parameter>rast2</parameter></paramdef> " 13590"<paramdef><type>integer </type> <parameter>nband2</parameter></paramdef> " 13591"<paramdef><type>regprocedure </type> <parameter>callbackfunc</parameter></" 13592"paramdef> <paramdef choice=\"opt\"><type>text </type> " 13593"<parameter>pixeltype=NULL</parameter></paramdef> <paramdef choice=\"opt" 13594"\"><type>text </type> <parameter>extenttype=INTERSECTION</parameter></" 13595"paramdef> <paramdef choice=\"opt\"><type>raster </type> " 13596"<parameter>customextent=NULL</parameter></paramdef> <paramdef choice=\"opt" 13597"\"><type>integer </type> <parameter>distancex=0</parameter></paramdef> " 13598"<paramdef choice=\"opt\"><type>integer </type> <parameter>distancey=0</" 13599"parameter></paramdef> <paramdef choice=\"opt\"><type>text[] </type> " 13600"<parameter>VARIADIC userargs=NULL</parameter></paramdef> </funcprototype> " 13601"<funcprototype> <funcdef>raster <function>ST_MapAlgebra</function></funcdef> " 13602"<paramdef><type>nband</type> <parameter>integer</parameter></paramdef> " 13603"<paramdef><type>regprocedure </type> <parameter>callbackfunc</parameter></" 13604"paramdef> <paramdef><type>float8[] </type> <parameter>mask</parameter></" 13605"paramdef> <paramdef><type>boolean </type> <parameter>weighted</parameter></" 13606"paramdef> <paramdef choice=\"opt\"><type>text </type> " 13607"<parameter>pixeltype=NULL</parameter></paramdef> <paramdef choice=\"opt" 13608"\"><type>text </type> <parameter>extenttype=INTERSECTION</parameter></" 13609"paramdef> <paramdef choice=\"opt\"><type>raster </type> " 13610"<parameter>customextent=NULL</parameter></paramdef> <paramdef choice=\"opt" 13611"\"><type>text[] </type> <parameter>VARIADIC userargs=NULL</parameter></" 13612"paramdef> </funcprototype>" 13613msgstr "" 13614"<funcprototype> <funcdef>raster <function>ST_MapAlgebra</function></funcdef> " 13615"<paramdef><type>rastbandarg[] </type> <parameter>rastbandargset</parameter></" 13616"paramdef> <paramdef><type>regprocedure </type> <parameter>callbackfunc</" 13617"parameter></paramdef> <paramdef choice=\"opt\"><type>text </type> " 13618"<parameter>pixeltype=NULL</parameter></paramdef> <paramdef choice=\"opt" 13619"\"><type>text </type> <parameter>extenttype=INTERSECTION</parameter></" 13620"paramdef> <paramdef choice=\"opt\"><type>raster </type> " 13621"<parameter>customextent=NULL</parameter></paramdef> <paramdef choice=\"opt" 13622"\"><type>integer </type> <parameter>distancex=0</parameter></paramdef> " 13623"<paramdef choice=\"opt\"><type>integer </type> <parameter>distancey=0</" 13624"parameter></paramdef> <paramdef choice=\"opt\"><type>text[] </type> " 13625"<parameter>VARIADIC userargs=NULL</parameter></paramdef> </funcprototype> " 13626"<funcprototype> <funcdef>raster <function>ST_MapAlgebra</function></funcdef> " 13627"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 13628"<paramdef><type>integer[] </type> <parameter>nband</parameter></paramdef> " 13629"<paramdef><type>regprocedure </type> <parameter>callbackfunc</parameter></" 13630"paramdef> <paramdef choice=\"opt\"><type>text </type> " 13631"<parameter>pixeltype=NULL</parameter></paramdef> <paramdef choice=\"opt" 13632"\"><type>text </type> <parameter>extenttype=FIRST</parameter></paramdef> " 13633"<paramdef choice=\"opt\"><type>raster </type> <parameter>customextent=NULL</" 13634"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 13635"<parameter>distancex=0</parameter></paramdef> <paramdef choice=\"opt" 13636"\"><type>integer </type> <parameter>distancey=0</parameter></paramdef> " 13637"<paramdef choice=\"opt\"><type>text[] </type> <parameter>VARIADIC " 13638"userargs=NULL</parameter></paramdef> </funcprototype> <funcprototype> " 13639"<funcdef>raster <function>ST_MapAlgebra</function></funcdef> " 13640"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 13641"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 13642"<paramdef><type>regprocedure </type> <parameter>callbackfunc</parameter></" 13643"paramdef> <paramdef choice=\"opt\"><type>text </type> " 13644"<parameter>pixeltype=NULL</parameter></paramdef> <paramdef choice=\"opt" 13645"\"><type>text </type> <parameter>extenttype=FIRST</parameter></paramdef> " 13646"<paramdef choice=\"opt\"><type>raster </type> <parameter>customextent=NULL</" 13647"parameter></paramdef> <paramdef choice=\"opt\"><type>integer </type> " 13648"<parameter>distancex=0</parameter></paramdef> <paramdef choice=\"opt" 13649"\"><type>integer </type> <parameter>distancey=0</parameter></paramdef> " 13650"<paramdef choice=\"opt\"><type>text[] </type> <parameter>VARIADIC " 13651"userargs=NULL</parameter></paramdef> </funcprototype> <funcprototype> " 13652"<funcdef>raster <function>ST_MapAlgebra</function></funcdef> " 13653"<paramdef><type>raster </type> <parameter>rast1</parameter></paramdef> " 13654"<paramdef><type>integer </type> <parameter>nband1</parameter></paramdef> " 13655"<paramdef><type>raster </type> <parameter>rast2</parameter></paramdef> " 13656"<paramdef><type>integer </type> <parameter>nband2</parameter></paramdef> " 13657"<paramdef><type>regprocedure </type> <parameter>callbackfunc</parameter></" 13658"paramdef> <paramdef choice=\"opt\"><type>text </type> " 13659"<parameter>pixeltype=NULL</parameter></paramdef> <paramdef choice=\"opt" 13660"\"><type>text </type> <parameter>extenttype=INTERSECTION</parameter></" 13661"paramdef> <paramdef choice=\"opt\"><type>raster </type> " 13662"<parameter>customextent=NULL</parameter></paramdef> <paramdef choice=\"opt" 13663"\"><type>integer </type> <parameter>distancex=0</parameter></paramdef> " 13664"<paramdef choice=\"opt\"><type>integer </type> <parameter>distancey=0</" 13665"parameter></paramdef> <paramdef choice=\"opt\"><type>text[] </type> " 13666"<parameter>VARIADIC userargs=NULL</parameter></paramdef> </funcprototype>" 13667 13668#. Tag: para 13669#: reference_raster.xml:7151 13670#, no-c-format 13671msgid "" 13672"Returns a one-band raster given one or more input rasters, band indexes and " 13673"one user-specified callback function." 13674msgstr "" 13675 13676#. Tag: term 13677#: reference_raster.xml:7157 13678#, no-c-format 13679msgid "rast,rast1,rast2, rastbandargset" 13680msgstr "" 13681 13682#. Tag: para 13683#: reference_raster.xml:7159 13684#, no-c-format 13685msgid "Rasters on which the map algebra process is evaluated." 13686msgstr "" 13687 13688#. Tag: para 13689#: reference_raster.xml:7160 13690#, no-c-format 13691msgid "" 13692"<varname>rastbandargset</varname> allows the use of a map algebra operation " 13693"on many rasters and/or many bands. See example Variant 1." 13694msgstr "" 13695 13696#. Tag: term 13697#: reference_raster.xml:7165 13698#, no-c-format 13699msgid "nband, nband1, nband2" 13700msgstr "" 13701 13702#. Tag: para 13703#: reference_raster.xml:7167 13704#, no-c-format 13705msgid "" 13706"Band numbers of the raster to be evaluated. nband can be an integer or " 13707"integer[] denoting the bands. nband1 is band on rast1 and nband2 is band on " 13708"rast2 for hte 2 raster/2band case." 13709msgstr "" 13710 13711#. Tag: term 13712#: reference_raster.xml:7173 13713#, no-c-format 13714msgid "callbackfunc" 13715msgstr "" 13716 13717#. Tag: para 13718#: reference_raster.xml:7175 13719#, no-c-format 13720msgid "" 13721"The <varname>callbackfunc</varname> parameter must be the name and signature " 13722"of an SQL or PL/pgSQL function, cast to a regprocedure. An example PL/pgSQL " 13723"function example is: <programlisting>\n" 13724"CREATE OR REPLACE FUNCTION sample_callbackfunc(value double precision[][][], " 13725"position integer[][], VARIADIC userargs text[])\n" 13726" RETURNS double precision\n" 13727" AS $$\n" 13728" BEGIN\n" 13729" RETURN 0;\n" 13730" END;\n" 13731" $$ LANGUAGE 'plpgsql' IMMUTABLE;\n" 13732" </" 13733"programlisting> The <varname>callbackfunc</varname> must have three " 13734"arguments: a 3-dimension double precision array, a 2-dimension integer array " 13735"and a variadic 1-dimension text array. The first argument <varname>value</" 13736"varname> is the set of values (as double precision) from all input rasters. " 13737"The three dimensions (where indexes are 1-based) are: raster #, row y, " 13738"column x. The second argument <varname>position</varname> is the set of " 13739"pixel positions from the output raster and input rasters. The outer " 13740"dimension (where indexes are 0-based) is the raster #. The position at outer " 13741"dimension index 0 is the output raster's pixel position. For each outer " 13742"dimension, there are two elements in the inner dimension for X and Y. The " 13743"third argument <varname>userargs</varname> is for passing through any user-" 13744"specified arguments." 13745msgstr "" 13746 13747#. Tag: para 13748#: reference_raster.xml:7182 13749#, no-c-format 13750msgid "" 13751"Passing a <type>regprocedure</type> argument to a SQL function requires the " 13752"full function signature to be passed, then cast to a <type>regprocedure</" 13753"type> type. To pass the above example PL/pgSQL function as an argument, the " 13754"SQL for the argument is: <programlisting>\n" 13755"'sample_callbackfunc(double precision[], integer[], text[])'::regprocedure\n" 13756" </" 13757"programlisting> Note that the argument contains the name of the function, " 13758"the types of the function arguments, quotes around the name and argument " 13759"types, and a cast to a <type>regprocedure</type>." 13760msgstr "" 13761 13762#. Tag: term 13763#: reference_raster.xml:7194 13764#, no-c-format 13765msgid "mask" 13766msgstr "" 13767 13768#. Tag: para 13769#: reference_raster.xml:7196 13770#, no-c-format 13771msgid "" 13772"An n-dimensional array (matrix) of numbers used to filter what cells get " 13773"passed to map algebra call-back function. 0 means a neighbor cell value " 13774"should be treated as no-data and 1 means value should be treated as data. If " 13775"weight is set to true, then the values, are used as multipliers to multiple " 13776"the pixel value of that value in the neighborhood position." 13777msgstr "" 13778 13779#. Tag: term 13780#: reference_raster.xml:7203 13781#, no-c-format 13782msgid "weighted" 13783msgstr "" 13784 13785#. Tag: para 13786#: reference_raster.xml:7205 13787#, no-c-format 13788msgid "" 13789"boolean (true/false) to denote if a mask value should be weighted " 13790"(multiplied by original value) or not (only applies to proto that takes a " 13791"mask)." 13792msgstr "" 13793 13794#. Tag: term 13795#: reference_raster.xml:7212 reference_raster.xml:7537 13796#: reference_raster.xml:7832 reference_raster.xml:8386 13797#, no-c-format 13798msgid "pixeltype" 13799msgstr "pixeltype" 13800 13801#. Tag: para 13802#: reference_raster.xml:7214 13803#, no-c-format 13804msgid "" 13805"If <varname>pixeltype</varname> is passed in, the one band of the new raster " 13806"will be of that pixeltype. If pixeltype is passed NULL or left out, the new " 13807"raster band will have the same pixeltype as the specified band of the first " 13808"raster (for extent types: INTERSECTION, UNION, FIRST, CUSTOM) or the " 13809"specified band of the appropriate raster (for extent types: SECOND, LAST). " 13810"If in doubt, always specify <varname>pixeltype</varname>." 13811msgstr "" 13812 13813#. Tag: para 13814#: reference_raster.xml:7217 13815#, no-c-format 13816msgid "" 13817"The resulting pixel type of the output raster must be one listed in <xref " 13818"linkend=\"RT_ST_BandPixelType\"/> or left out or set to NULL." 13819msgstr "" 13820 13821#. Tag: term 13822#: reference_raster.xml:7224 reference_raster.xml:7545 13823#: reference_raster.xml:7841 13824#, no-c-format 13825msgid "extenttype" 13826msgstr "" 13827 13828#. Tag: para 13829#: reference_raster.xml:7226 13830#, no-c-format 13831msgid "" 13832"Possible values are INTERSECTION (default), UNION, FIRST (default for one " 13833"raster variants), SECOND, LAST, CUSTOM." 13834msgstr "" 13835 13836#. Tag: term 13837#: reference_raster.xml:7233 13838#, no-c-format 13839msgid "customextent" 13840msgstr "" 13841 13842#. Tag: para 13843#: reference_raster.xml:7235 13844#, no-c-format 13845msgid "" 13846"If <varname>extentype</varname> is CUSTOM, a raster must be provided for " 13847"<varname>customextent</varname>. See example 4 of Variant 1." 13848msgstr "" 13849 13850#. Tag: term 13851#: reference_raster.xml:7242 13852#, no-c-format 13853msgid "distancex" 13854msgstr "" 13855 13856#. Tag: para 13857#: reference_raster.xml:7244 13858#, no-c-format 13859msgid "" 13860"The distance in pixels from the reference cell in x direction. So width of " 13861"resulting matrix would be <code>2*distancex + 1</code>.If not specified only " 13862"the reference cell is considered (neighborhood of 0)." 13863msgstr "" 13864 13865#. Tag: term 13866#: reference_raster.xml:7251 13867#, no-c-format 13868msgid "distancey" 13869msgstr "" 13870 13871#. Tag: para 13872#: reference_raster.xml:7253 13873#, no-c-format 13874msgid "" 13875"The distance in pixels from reference cell in y direction. Height of " 13876"resulting matrix would be <code>2*distancey + 1</code> .If not specified " 13877"only the reference cell is considered (neighborhood of 0)." 13878msgstr "" 13879 13880#. Tag: term 13881#: reference_raster.xml:7260 13882#, no-c-format 13883msgid "userargs" 13884msgstr "" 13885 13886#. Tag: para 13887#: reference_raster.xml:7262 13888#, no-c-format 13889msgid "" 13890"The third argument to the <varname>callbackfunc</varname> is a " 13891"<type>variadic text</type> array. All trailing text arguments are passed " 13892"through to the specified <varname>callbackfunc</varname>, and are contained " 13893"in the <varname>userargs</varname> argument." 13894msgstr "" 13895 13896#. Tag: para 13897#: reference_raster.xml:7270 reference_raster.xml:8161 13898#: reference_raster.xml:8280 13899#, no-c-format 13900msgid "" 13901"For more information about the VARIADIC keyword, please refer to the " 13902"PostgreSQL documentation and the \"SQL Functions with Variable Numbers of " 13903"Arguments\" section of <ulink url=\"http://www.postgresql.org/docs/current/" 13904"static/xfunc-sql.html\">Query Language (SQL) Functions</ulink>." 13905msgstr "" 13906 13907#. Tag: para 13908#: reference_raster.xml:7276 13909#, no-c-format 13910msgid "" 13911"The <type>text[]</type> argument to the <varname>callbackfunc</varname> is " 13912"required, regardless of whether you choose to pass any arguments to the " 13913"callback function for processing or not." 13914msgstr "" 13915 13916#. Tag: para 13917#: reference_raster.xml:7281 13918#, no-c-format 13919msgid "" 13920"Variant 1 accepts an array of <varname>rastbandarg</varname> allowing the " 13921"use of a map algebra operation on many rasters and/or many bands. See " 13922"example Variant 1." 13923msgstr "" 13924 13925#. Tag: para 13926#: reference_raster.xml:7285 13927#, no-c-format 13928msgid "" 13929"Variants 2 and 3 operate upon one or more bands of one raster. See example " 13930"Variant 2 and 3." 13931msgstr "" 13932 13933#. Tag: para 13934#: reference_raster.xml:7289 13935#, no-c-format 13936msgid "" 13937"Variant 4 operate upon two rasters with one band per raster. See example " 13938"Variant 4." 13939msgstr "" 13940 13941#. Tag: para 13942#: reference_raster.xml:7293 13943#, no-c-format 13944msgid "Availability: 2.2.0: Ability to add a mask" 13945msgstr "" 13946 13947#. Tag: para 13948#: reference_raster.xml:7301 reference_raster.xml:7323 13949#, no-c-format 13950msgid "One raster, one band" 13951msgstr "" 13952 13953#. Tag: programlisting 13954#: reference_raster.xml:7302 13955#, no-c-format 13956msgid "" 13957"WITH foo AS (\n" 13958" SELECT 1 AS rid, ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, " 13959"0, 0), 1, '16BUI', 1, 0) AS rast\n" 13960")\n" 13961"SELECT\n" 13962" ST_MapAlgebra(\n" 13963" ARRAY[ROW(rast, 1)]::rastbandarg[],\n" 13964" 'sample_callbackfunc(double precision[], int[], text[])'::" 13965"regprocedure\n" 13966" ) AS rast\n" 13967"FROM foo" 13968msgstr "" 13969 13970#. Tag: para 13971#: reference_raster.xml:7304 reference_raster.xml:7320 13972#, no-c-format 13973msgid "One raster, several bands" 13974msgstr "" 13975 13976#. Tag: programlisting 13977#: reference_raster.xml:7305 13978#, no-c-format 13979msgid "" 13980"WITH foo AS (\n" 13981" SELECT 1 AS rid, " 13982"ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, 0, " 13983"0), 1, '16BUI', 1, 0), 2, '8BUI', 10, 0), 3, '32BUI', 100, 0) AS rast\n" 13984")\n" 13985"SELECT\n" 13986" ST_MapAlgebra(\n" 13987" ARRAY[ROW(rast, 3), ROW(rast, 1), ROW(rast, 3), ROW(rast, " 13988"2)]::rastbandarg[],\n" 13989" 'sample_callbackfunc(double precision[], int[], text[])'::" 13990"regprocedure\n" 13991" ) AS rast\n" 13992"FROM foo" 13993msgstr "" 13994 13995#. Tag: para 13996#: reference_raster.xml:7307 13997#, no-c-format 13998msgid "Several rasters, several bands" 13999msgstr "" 14000 14001#. Tag: programlisting 14002#: reference_raster.xml:7308 14003#, no-c-format 14004msgid "" 14005"WITH foo AS (\n" 14006" SELECT 1 AS rid, " 14007"ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, 0, " 14008"0), 1, '16BUI', 1, 0), 2, '8BUI', 10, 0), 3, '32BUI', 100, 0) AS rast UNION " 14009"ALL\n" 14010" SELECT 2 AS rid, " 14011"ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 1, 1, -1, 0, 0, " 14012"0), 1, '16BUI', 2, 0), 2, '8BUI', 20, 0), 3, '32BUI', 300, 0) AS rast\n" 14013")\n" 14014"SELECT\n" 14015" ST_MapAlgebra(\n" 14016" ARRAY[ROW(t1.rast, 3), ROW(t2.rast, 1), ROW(t2.rast, 3), " 14017"ROW(t1.rast, 2)]::rastbandarg[],\n" 14018" 'sample_callbackfunc(double precision[], int[], text[])'::" 14019"regprocedure\n" 14020" ) AS rast\n" 14021"FROM foo t1\n" 14022"CROSS JOIN foo t2\n" 14023"WHERE t1.rid = 1\n" 14024" AND t2.rid = 2" 14025msgstr "" 14026 14027#. Tag: para 14028#: reference_raster.xml:7310 14029#, no-c-format 14030msgid "" 14031"Complete example of tiles of a coverage with neighborhood. This query only " 14032"works with PostgreSQL 9.1 or higher." 14033msgstr "" 14034 14035#. Tag: programlisting 14036#: reference_raster.xml:7311 14037#, no-c-format 14038msgid "" 14039"WITH foo AS (\n" 14040" SELECT 0 AS rid, ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, " 14041"0, 0), 1, '16BUI', 1, 0) AS rast UNION ALL\n" 14042" SELECT 1, ST_AddBand(ST_MakeEmptyRaster(2, 2, 2, 0, 1, -1, 0, 0, 0), " 14043"1, '16BUI', 2, 0) AS rast UNION ALL\n" 14044" SELECT 2, ST_AddBand(ST_MakeEmptyRaster(2, 2, 4, 0, 1, -1, 0, 0, 0), " 14045"1, '16BUI', 3, 0) AS rast UNION ALL\n" 14046"\n" 14047" SELECT 3, ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, -2, 1, -1, 0, 0, " 14048"0), 1, '16BUI', 10, 0) AS rast UNION ALL\n" 14049" SELECT 4, ST_AddBand(ST_MakeEmptyRaster(2, 2, 2, -2, 1, -1, 0, 0, " 14050"0), 1, '16BUI', 20, 0) AS rast UNION ALL\n" 14051" SELECT 5, ST_AddBand(ST_MakeEmptyRaster(2, 2, 4, -2, 1, -1, 0, 0, " 14052"0), 1, '16BUI', 30, 0) AS rast UNION ALL\n" 14053"\n" 14054" SELECT 6, ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, -4, 1, -1, 0, 0, " 14055"0), 1, '16BUI', 100, 0) AS rast UNION ALL\n" 14056" SELECT 7, ST_AddBand(ST_MakeEmptyRaster(2, 2, 2, -4, 1, -1, 0, 0, " 14057"0), 1, '16BUI', 200, 0) AS rast UNION ALL\n" 14058" SELECT 8, ST_AddBand(ST_MakeEmptyRaster(2, 2, 4, -4, 1, -1, 0, 0, " 14059"0), 1, '16BUI', 300, 0) AS rast\n" 14060")\n" 14061"SELECT\n" 14062" t1.rid,\n" 14063" ST_MapAlgebra(\n" 14064" ARRAY[ROW(ST_Union(t2.rast), 1)]::rastbandarg[],\n" 14065" 'sample_callbackfunc(double precision[], int[], text[])'::" 14066"regprocedure,\n" 14067" '32BUI',\n" 14068" 'CUSTOM', t1.rast,\n" 14069" 1, 1\n" 14070" ) AS rast\n" 14071"FROM foo t1\n" 14072"CROSS JOIN foo t2\n" 14073"WHERE t1.rid = 4\n" 14074" AND t2.rid BETWEEN 0 AND 8\n" 14075" AND ST_Intersects(t1.rast, t2.rast)\n" 14076"GROUP BY t1.rid, t1.rast" 14077msgstr "" 14078 14079#. Tag: para 14080#: reference_raster.xml:7313 14081#, no-c-format 14082msgid "" 14083"Example like the prior one for tiles of a coverage with neighborhood but " 14084"works with PostgreSQL 9.0." 14085msgstr "" 14086 14087#. Tag: programlisting 14088#: reference_raster.xml:7314 14089#, no-c-format 14090msgid "" 14091"WITH src AS (\n" 14092" SELECT 0 AS rid, ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, " 14093"0, 0), 1, '16BUI', 1, 0) AS rast UNION ALL\n" 14094" SELECT 1, ST_AddBand(ST_MakeEmptyRaster(2, 2, 2, 0, 1, -1, 0, 0, 0), " 14095"1, '16BUI', 2, 0) AS rast UNION ALL\n" 14096" SELECT 2, ST_AddBand(ST_MakeEmptyRaster(2, 2, 4, 0, 1, -1, 0, 0, 0), " 14097"1, '16BUI', 3, 0) AS rast UNION ALL\n" 14098"\n" 14099" SELECT 3, ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, -2, 1, -1, 0, 0, " 14100"0), 1, '16BUI', 10, 0) AS rast UNION ALL\n" 14101" SELECT 4, ST_AddBand(ST_MakeEmptyRaster(2, 2, 2, -2, 1, -1, 0, 0, " 14102"0), 1, '16BUI', 20, 0) AS rast UNION ALL\n" 14103" SELECT 5, ST_AddBand(ST_MakeEmptyRaster(2, 2, 4, -2, 1, -1, 0, 0, " 14104"0), 1, '16BUI', 30, 0) AS rast UNION ALL\n" 14105"\n" 14106" SELECT 6, ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, -4, 1, -1, 0, 0, " 14107"0), 1, '16BUI', 100, 0) AS rast UNION ALL\n" 14108" SELECT 7, ST_AddBand(ST_MakeEmptyRaster(2, 2, 2, -4, 1, -1, 0, 0, " 14109"0), 1, '16BUI', 200, 0) AS rast UNION ALL\n" 14110" SELECT 8, ST_AddBand(ST_MakeEmptyRaster(2, 2, 4, -4, 1, -1, 0, 0, " 14111"0), 1, '16BUI', 300, 0) AS rast\n" 14112")\n" 14113"WITH foo AS (\n" 14114" SELECT\n" 14115" t1.rid,\n" 14116" ST_Union(t2.rast) AS rast\n" 14117" FROM src t1\n" 14118" JOIN src t2\n" 14119" ON ST_Intersects(t1.rast, t2.rast)\n" 14120" AND t2.rid BETWEEN 0 AND 8\n" 14121" WHERE t1.rid = 4\n" 14122" GROUP BY t1.rid\n" 14123"), bar AS (\n" 14124" SELECT\n" 14125" t1.rid,\n" 14126" ST_MapAlgebra(\n" 14127" ARRAY[ROW(t2.rast, 1)]::rastbandarg[],\n" 14128" 'raster_nmapalgebra_test(double precision[], int[], " 14129"text[])'::regprocedure,\n" 14130" '32BUI',\n" 14131" 'CUSTOM', t1.rast,\n" 14132" 1, 1\n" 14133" ) AS rast\n" 14134" FROM src t1\n" 14135" JOIN foo t2\n" 14136" ON t1.rid = t2.rid\n" 14137")\n" 14138"SELECT\n" 14139" rid,\n" 14140" (ST_Metadata(rast)),\n" 14141" (ST_BandMetadata(rast, 1)),\n" 14142" ST_Value(rast, 1, 1, 1)\n" 14143"FROM bar;" 14144msgstr "" 14145 14146#. Tag: title 14147#: reference_raster.xml:7318 14148#, no-c-format 14149msgid "Examples: Variants 2 and 3" 14150msgstr "" 14151 14152#. Tag: programlisting 14153#: reference_raster.xml:7321 14154#, no-c-format 14155msgid "" 14156"WITH foo AS (\n" 14157" SELECT 1 AS rid, " 14158"ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, 0, " 14159"0), 1, '16BUI', 1, 0), 2, '8BUI', 10, 0), 3, '32BUI', 100, 0) AS rast\n" 14160")\n" 14161"SELECT\n" 14162" ST_MapAlgebra(\n" 14163" rast, ARRAY[3, 1, 3, 2]::integer[],\n" 14164" 'sample_callbackfunc(double precision[], int[], text[])'::" 14165"regprocedure\n" 14166" ) AS rast\n" 14167"FROM foo" 14168msgstr "" 14169 14170#. Tag: programlisting 14171#: reference_raster.xml:7324 14172#, no-c-format 14173msgid "" 14174"WITH foo AS (\n" 14175" SELECT 1 AS rid, " 14176"ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, 0, " 14177"0), 1, '16BUI', 1, 0), 2, '8BUI', 10, 0), 3, '32BUI', 100, 0) AS rast\n" 14178")\n" 14179"SELECT\n" 14180" ST_MapAlgebra(\n" 14181" rast, 2,\n" 14182" 'sample_callbackfunc(double precision[], int[], text[])'::" 14183"regprocedure\n" 14184" ) AS rast\n" 14185"FROM foo" 14186msgstr "" 14187 14188#. Tag: title 14189#: reference_raster.xml:7328 14190#, no-c-format 14191msgid "Examples: Variant 4" 14192msgstr "" 14193 14194#. Tag: para 14195#: reference_raster.xml:7330 14196#, no-c-format 14197msgid "Two rasters, two bands" 14198msgstr "" 14199 14200#. Tag: programlisting 14201#: reference_raster.xml:7331 14202#, no-c-format 14203msgid "" 14204"WITH foo AS (\n" 14205" SELECT 1 AS rid, " 14206"ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, 0, " 14207"0), 1, '16BUI', 1, 0), 2, '8BUI', 10, 0), 3, '32BUI', 100, 0) AS rast UNION " 14208"ALL\n" 14209" SELECT 2 AS rid, " 14210"ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 1, 1, -1, 0, 0, " 14211"0), 1, '16BUI', 2, 0), 2, '8BUI', 20, 0), 3, '32BUI', 300, 0) AS rast\n" 14212")\n" 14213"SELECT\n" 14214" ST_MapAlgebra(\n" 14215" t1.rast, 2,\n" 14216" t2.rast, 1,\n" 14217" 'sample_callbackfunc(double precision[], int[], text[])'::" 14218"regprocedure\n" 14219" ) AS rast\n" 14220"FROM foo t1\n" 14221"CROSS JOIN foo t2\n" 14222"WHERE t1.rid = 1\n" 14223" AND t2.rid = 2" 14224msgstr "" 14225 14226#. Tag: title 14227#: reference_raster.xml:7336 14228#, no-c-format 14229msgid "Examples: Using Masks" 14230msgstr "" 14231 14232#. Tag: programlisting 14233#: reference_raster.xml:7337 14234#, no-c-format 14235msgid "" 14236"WITH foo AS (SELECT\n" 14237" ST_SetBandNoDataValue(\n" 14238"ST_SetValue(ST_SetValue(ST_AsRaster(\n" 14239" ST_Buffer(\n" 14240" ST_GeomFromText('LINESTRING(50 50,100 90,100 50)'), " 14241"5,'join=bevel'),\n" 14242" 200,200,ARRAY['8BUI'], ARRAY[100], ARRAY[0]), " 14243"ST_Buffer('POINT(70 70)'::geometry,10,'quad_segs=1') ,50),\n" 14244" 'LINESTRING(20 20, 100 100, 150 98)'::geometry,1),0) AS rast )\n" 14245"SELECT 'original' AS title, rast\n" 14246"FROM foo\n" 14247"UNION ALL\n" 14248"SELECT 'no mask mean value' AS title, " 14249"ST_MapAlgebra(rast,1,'ST_mean4ma(double precision[], int[], text[])'::" 14250"regprocedure) AS rast\n" 14251"FROM foo\n" 14252"UNION ALL\n" 14253"SELECT 'mask only consider neighbors, exclude center' AS title, " 14254"ST_MapAlgebra(rast,1,'ST_mean4ma(double precision[], int[], text[])'::" 14255"regprocedure,\n" 14256" '{{1,1,1}, {1,0,1}, {1,1,1}}'::double precision[], false) As rast\n" 14257"FROM foo\n" 14258"\n" 14259"UNION ALL\n" 14260"SELECT 'mask weighted only consider neighbors, exclude center multi otehr " 14261"pixel values by 2' AS title, ST_MapAlgebra(rast,1,'ST_mean4ma(double " 14262"precision[], int[], text[])'::regprocedure,\n" 14263" '{{2,2,2}, {2,0,2}, {2,2,2}}'::double precision[], true) As rast\n" 14264"FROM foo;" 14265msgstr "" 14266 14267#. Tag: para 14268#: reference_raster.xml:7351 14269#, no-c-format 14270msgid "original" 14271msgstr "" 14272 14273#. Tag: para 14274#: reference_raster.xml:7365 14275#, no-c-format 14276msgid "no mask mean value (same as having all 1s in mask matrix)" 14277msgstr "" 14278 14279#. Tag: para 14280#: reference_raster.xml:7381 14281#, no-c-format 14282msgid "mask only consider neighbors, exclude center" 14283msgstr "" 14284 14285#. Tag: para 14286#: reference_raster.xml:7395 14287#, no-c-format 14288msgid "" 14289"mask weighted only consider neighbors, exclude center multi other pixel " 14290"values by 2" 14291msgstr "" 14292 14293#. Tag: para 14294#: reference_raster.xml:7412 14295#, no-c-format 14296msgid "" 14297", <xref linkend=\"RT_ST_Union\"/>, <xref linkend=\"RT_ST_MapAlgebra_expr\"/>" 14298msgstr "" 14299 14300#. Tag: refname 14301#: reference_raster.xml:7423 14302#, fuzzy, no-c-format 14303msgid "ST_MapAlgebra (expression version)" 14304msgstr "ST_MapAlgebraExpr" 14305 14306#. Tag: refpurpose 14307#: reference_raster.xml:7424 14308#, no-c-format 14309msgid "" 14310"<refpurpose>Expression version - Returns a one-band raster given one or two " 14311"input rasters, band indexes and one or more user-specified SQL expressions.</" 14312"refpurpose>" 14313msgstr "" 14314 14315#. Tag: funcsynopsis 14316#: reference_raster.xml:7430 14317#, no-c-format 14318msgid "" 14319"<funcprototype> <funcdef>raster <function>ST_MapAlgebra</function></funcdef> " 14320"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 14321"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 14322"<paramdef><type>text </type> <parameter>pixeltype</parameter></paramdef> " 14323"<paramdef><type>text </type> <parameter>expression</parameter></paramdef> " 14324"<paramdef choice=\"opt\"><type>double precision </type> " 14325"<parameter>nodataval=NULL</parameter></paramdef> </funcprototype> " 14326"<funcprototype> <funcdef>raster <function>ST_MapAlgebra</function></funcdef> " 14327"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 14328"<paramdef><type>text </type> <parameter>pixeltype</parameter></paramdef> " 14329"<paramdef><type>text </type> <parameter>expression</parameter></paramdef> " 14330"<paramdef choice=\"opt\"><type>double precision </type> " 14331"<parameter>nodataval=NULL</parameter></paramdef> </funcprototype> " 14332"<funcprototype> <funcdef>raster <function>ST_MapAlgebra</function></funcdef> " 14333"<paramdef><type>raster </type> <parameter>rast1</parameter></paramdef> " 14334"<paramdef><type>integer </type> <parameter>nband1</parameter></paramdef> " 14335"<paramdef><type>raster </type> <parameter>rast2</parameter></paramdef> " 14336"<paramdef><type>integer </type> <parameter>nband2</parameter></paramdef> " 14337"<paramdef><type>text </type> <parameter>expression</parameter></paramdef> " 14338"<paramdef choice=\"opt\"><type>text </type> <parameter>pixeltype=NULL</" 14339"parameter></paramdef> <paramdef choice=\"opt\"><type>text </type> " 14340"<parameter>extenttype=INTERSECTION</parameter></paramdef> <paramdef choice=" 14341"\"opt\"><type>text </type> <parameter>nodata1expr=NULL</parameter></" 14342"paramdef> <paramdef choice=\"opt\"><type>text </type> " 14343"<parameter>nodata2expr=NULL</parameter></paramdef> <paramdef choice=\"opt" 14344"\"><type>double precision </type> <parameter>nodatanodataval=NULL</" 14345"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 14346"<function>ST_MapAlgebra</function></funcdef> <paramdef><type>raster </type> " 14347"<parameter>rast1</parameter></paramdef> <paramdef><type>raster </type> " 14348"<parameter>rast2</parameter></paramdef> <paramdef><type>text </type> " 14349"<parameter>expression</parameter></paramdef> <paramdef choice=\"opt" 14350"\"><type>text </type> <parameter>pixeltype=NULL</parameter></paramdef> " 14351"<paramdef choice=\"opt\"><type>text </type> " 14352"<parameter>extenttype=INTERSECTION</parameter></paramdef> <paramdef choice=" 14353"\"opt\"><type>text </type> <parameter>nodata1expr=NULL</parameter></" 14354"paramdef> <paramdef choice=\"opt\"><type>text </type> " 14355"<parameter>nodata2expr=NULL</parameter></paramdef> <paramdef choice=\"opt" 14356"\"><type>double precision </type> <parameter>nodatanodataval=NULL</" 14357"parameter></paramdef> </funcprototype>" 14358msgstr "" 14359 14360#. Tag: para 14361#: reference_raster.xml:7481 14362#, no-c-format 14363msgid "" 14364"<para>Expression version - Returns a one-band raster given one or two input " 14365"rasters, band indexes and one or more user-specified SQL expressions.</para>" 14366msgstr "" 14367 14368#. Tag: title 14369#: reference_raster.xml:7489 14370#, no-c-format 14371msgid "Description: Variants 1 and 2 (one raster)" 14372msgstr "" 14373 14374#. Tag: para 14375#: reference_raster.xml:7491 14376#, no-c-format 14377msgid "" 14378"Creates a new one band raster formed by applying a valid PostgreSQL " 14379"algebraic operation defined by the <varname>expression</varname> on the " 14380"input raster (<varname>rast</varname>). If <varname>nband</varname> is not " 14381"provided, band 1 is assumed. The new raster will have the same georeference, " 14382"width, and height as the original raster but will only have one band." 14383msgstr "" 14384 14385#. Tag: para 14386#: reference_raster.xml:7495 reference_raster.xml:7697 14387#: reference_raster.xml:8145 14388#, no-c-format 14389msgid "" 14390"If <varname>pixeltype</varname> is passed in, then the new raster will have " 14391"a band of that pixeltype. If pixeltype is passed NULL, then the new raster " 14392"band will have the same pixeltype as the input <varname>rast</varname> band." 14393msgstr "" 14394 14395#. Tag: para 14396#: reference_raster.xml:7500 14397#, no-c-format 14398msgid "Keywords permitted for <varname>expression</varname>" 14399msgstr "" 14400 14401#. Tag: para 14402#: reference_raster.xml:7503 14403#, no-c-format 14404msgid "<varname>[rast]</varname> - Pixel value of the pixel of interest" 14405msgstr "" 14406 14407#. Tag: para 14408#: reference_raster.xml:7506 14409#, no-c-format 14410msgid "<varname>[rast.val]</varname> - Pixel value of the pixel of interest" 14411msgstr "" 14412 14413#. Tag: para 14414#: reference_raster.xml:7509 14415#, no-c-format 14416msgid "" 14417"<varname>[rast.x]</varname> - 1-based pixel column of the pixel of interest" 14418msgstr "" 14419 14420#. Tag: para 14421#: reference_raster.xml:7512 14422#, no-c-format 14423msgid "" 14424"<varname>[rast.y]</varname> - 1-based pixel row of the pixel of interest" 14425msgstr "" 14426 14427#. Tag: title 14428#: reference_raster.xml:7521 14429#, no-c-format 14430msgid "Description: Variants 3 and 4 (two raster)" 14431msgstr "" 14432 14433#. Tag: para 14434#: reference_raster.xml:7523 reference_raster.xml:7817 14435#, no-c-format 14436msgid "" 14437"Creates a new one band raster formed by applying a valid PostgreSQL " 14438"algebraic operation to the two bands defined by the <varname>expression</" 14439"varname> on the two input raster bands <varname>rast1</varname>, " 14440"(<varname>rast2</varname>). If no <varname>band1</varname>, <varname>band2</" 14441"varname> is specified band 1 is assumed. The resulting raster will be " 14442"aligned (scale, skew and pixel corners) on the grid defined by the first " 14443"raster. The resulting raster will have the extent defined by the " 14444"<varname>extenttype</varname> parameter." 14445msgstr "" 14446 14447#. Tag: term 14448#: reference_raster.xml:7529 reference_raster.xml:7823 14449#, no-c-format 14450msgid "expression" 14451msgstr "espressione" 14452 14453#. Tag: para 14454#: reference_raster.xml:7531 reference_raster.xml:7825 14455#, no-c-format 14456msgid "" 14457"A PostgreSQL algebraic expression involving the two rasters and PostgreSQL " 14458"defined functions/operators that will define the pixel value when pixels " 14459"intersect. e.g. (([rast1] + [rast2])/2.0)::integer" 14460msgstr "" 14461 14462#. Tag: para 14463#: reference_raster.xml:7539 reference_raster.xml:7834 14464#, no-c-format 14465msgid "" 14466"The resulting pixel type of the output raster. Must be one listed in <xref " 14467"linkend=\"RT_ST_BandPixelType\"/>, left out or set to NULL. If not passed in " 14468"or set to NULL, will default to the pixeltype of the first raster." 14469msgstr "" 14470 14471#. Tag: para 14472#: reference_raster.xml:7547 reference_raster.xml:7843 14473#, no-c-format 14474msgid "Controls the extent of resulting raster" 14475msgstr "" 14476 14477#. Tag: para 14478#: reference_raster.xml:7553 reference_raster.xml:7846 14479#, no-c-format 14480msgid "" 14481"<varname>INTERSECTION</varname> - The extent of the new raster is the " 14482"intersection of the two rasters. This is the default." 14483msgstr "" 14484 14485#. Tag: para 14486#: reference_raster.xml:7558 reference_raster.xml:7851 14487#, no-c-format 14488msgid "" 14489"<varname>UNION</varname> - The extent of the new raster is the union of the " 14490"two rasters." 14491msgstr "" 14492 14493#. Tag: para 14494#: reference_raster.xml:7563 reference_raster.xml:7856 14495#, no-c-format 14496msgid "" 14497"<varname>FIRST</varname> - The extent of the new raster is the same as the " 14498"one of the first raster." 14499msgstr "" 14500 14501#. Tag: para 14502#: reference_raster.xml:7568 reference_raster.xml:7861 14503#, no-c-format 14504msgid "" 14505"<varname>SECOND</varname> - The extent of the new raster is the same as the " 14506"one of the second raster." 14507msgstr "" 14508 14509#. Tag: term 14510#: reference_raster.xml:7576 reference_raster.xml:7870 14511#, no-c-format 14512msgid "nodata1expr" 14513msgstr "" 14514 14515#. Tag: para 14516#: reference_raster.xml:7578 reference_raster.xml:7872 14517#, no-c-format 14518msgid "" 14519"An algebraic expression involving only <varname>rast2</varname> or a " 14520"constant that defines what to return when pixels of <varname>rast1</varname> " 14521"are nodata values and spatially corresponding rast2 pixels have values." 14522msgstr "" 14523 14524#. Tag: term 14525#: reference_raster.xml:7584 reference_raster.xml:7879 14526#, no-c-format 14527msgid "nodata2expr" 14528msgstr "" 14529 14530#. Tag: para 14531#: reference_raster.xml:7586 reference_raster.xml:7881 14532#, no-c-format 14533msgid "" 14534"An algebraic expression involving only <varname>rast1</varname> or a " 14535"constant that defines what to return when pixels of <varname>rast2</varname> " 14536"are nodata values and spatially corresponding rast1 pixels have values." 14537msgstr "" 14538 14539#. Tag: term 14540#: reference_raster.xml:7592 reference_raster.xml:7888 14541#, no-c-format 14542msgid "nodatanodataval" 14543msgstr "" 14544 14545#. Tag: para 14546#: reference_raster.xml:7594 reference_raster.xml:7890 14547#, no-c-format 14548msgid "" 14549"A numeric constant to return when spatially corresponding rast1 and rast2 " 14550"pixels are both nodata values." 14551msgstr "" 14552 14553#. Tag: para 14554#: reference_raster.xml:7602 14555#, no-c-format 14556msgid "" 14557"Keywords permitted in <varname>expression</varname>, <varname>nodata1expr</" 14558"varname> and <varname>nodata2expr</varname>" 14559msgstr "" 14560 14561#. Tag: para 14562#: reference_raster.xml:7605 14563#, no-c-format 14564msgid "" 14565"<varname>[rast1]</varname> - Pixel value of the pixel of interest from " 14566"<varname>rast1</varname>" 14567msgstr "" 14568 14569#. Tag: para 14570#: reference_raster.xml:7608 14571#, no-c-format 14572msgid "" 14573"<varname>[rast1.val]</varname> - Pixel value of the pixel of interest from " 14574"<varname>rast1</varname>" 14575msgstr "" 14576 14577#. Tag: para 14578#: reference_raster.xml:7611 14579#, no-c-format 14580msgid "" 14581"<varname>[rast1.x]</varname> - 1-based pixel column of the pixel of interest " 14582"from <varname>rast1</varname>" 14583msgstr "" 14584 14585#. Tag: para 14586#: reference_raster.xml:7614 14587#, no-c-format 14588msgid "" 14589"<varname>[rast1.y]</varname> - 1-based pixel row of the pixel of interest " 14590"from <varname>rast1</varname>" 14591msgstr "" 14592 14593#. Tag: para 14594#: reference_raster.xml:7617 14595#, no-c-format 14596msgid "" 14597"<varname>[rast2]</varname> - Pixel value of the pixel of interest from " 14598"<varname>rast2</varname>" 14599msgstr "" 14600 14601#. Tag: para 14602#: reference_raster.xml:7620 14603#, no-c-format 14604msgid "" 14605"<varname>[rast2.val]</varname> - Pixel value of the pixel of interest from " 14606"<varname>rast2</varname>" 14607msgstr "" 14608 14609#. Tag: para 14610#: reference_raster.xml:7623 14611#, no-c-format 14612msgid "" 14613"<varname>[rast2.x]</varname> - 1-based pixel column of the pixel of interest " 14614"from <varname>rast2</varname>" 14615msgstr "" 14616 14617#. Tag: para 14618#: reference_raster.xml:7626 14619#, no-c-format 14620msgid "" 14621"<varname>[rast2.y]</varname> - 1-based pixel row of the pixel of interest " 14622"from <varname>rast2</varname>" 14623msgstr "" 14624 14625#. Tag: title 14626#: reference_raster.xml:7634 14627#, no-c-format 14628msgid "Examples: Variants 1 and 2" 14629msgstr "" 14630 14631#. Tag: programlisting 14632#: reference_raster.xml:7636 14633#, no-c-format 14634msgid "" 14635"WITH foo AS (\n" 14636" SELECT ST_AddBand(ST_MakeEmptyRaster(10, 10, 0, 0, 1, 1, 0, 0, 0), " 14637"'32BF'::text, 1, -1) AS rast\n" 14638")\n" 14639"SELECT\n" 14640" ST_MapAlgebra(rast, 1, NULL, 'ceil([rast]*[rast.x]/[rast.y]+[rast." 14641"val])')\n" 14642"FROM foo;" 14643msgstr "" 14644 14645#. Tag: title 14646#: reference_raster.xml:7640 14647#, no-c-format 14648msgid "Examples: Variant 3 and 4" 14649msgstr "" 14650 14651#. Tag: programlisting 14652#: reference_raster.xml:7642 14653#, no-c-format 14654msgid "" 14655"WITH foo AS (\n" 14656" SELECT 1 AS rid, " 14657"ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, 0, " 14658"0), 1, '16BUI', 1, 0), 2, '8BUI', 10, 0), 3, '32BUI'::text, 100, 0) AS rast " 14659"UNION ALL\n" 14660" SELECT 2 AS rid, " 14661"ST_AddBand(ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 1, 1, -1, 0, 0, " 14662"0), 1, '16BUI', 2, 0), 2, '8BUI', 20, 0), 3, '32BUI'::text, 300, 0) AS rast\n" 14663")\n" 14664"SELECT\n" 14665" ST_MapAlgebra(\n" 14666" t1.rast, 2,\n" 14667" t2.rast, 1,\n" 14668" '([rast2] + [rast1.val]) / 2'\n" 14669" ) AS rast\n" 14670"FROM foo t1\n" 14671"CROSS JOIN foo t2\n" 14672"WHERE t1.rid = 1\n" 14673" AND t2.rid = 2;" 14674msgstr "" 14675 14676#. Tag: para 14677#: reference_raster.xml:7648 14678#, no-c-format 14679msgid ", <xref linkend=\"RT_ST_Union\"/>, <xref linkend=\"RT_ST_MapAlgebra\"/>" 14680msgstr "" 14681 14682#. Tag: refname 14683#: reference_raster.xml:7658 reference_raster.xml:7772 14684#, no-c-format 14685msgid "ST_MapAlgebraExpr" 14686msgstr "ST_MapAlgebraExpr" 14687 14688#. Tag: refpurpose 14689#: reference_raster.xml:7659 14690#, no-c-format 14691msgid "" 14692"1 raster band version: Creates a new one band raster formed by applying a " 14693"valid PostgreSQL algebraic operation on the input raster band and of " 14694"pixeltype provided. Band 1 is assumed if no band is specified." 14695msgstr "" 14696 14697#. Tag: funcsynopsis 14698#: reference_raster.xml:7663 14699#, no-c-format 14700msgid "" 14701"<funcprototype> <funcdef>raster <function>ST_MapAlgebraExpr</function></" 14702"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 14703"paramdef> <paramdef><type>integer </type> <parameter>band</parameter></" 14704"paramdef> <paramdef><type>text </type> <parameter>pixeltype</parameter></" 14705"paramdef> <paramdef><type>text </type> <parameter>expression</parameter></" 14706"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 14707"<parameter>nodataval=NULL</parameter></paramdef> </funcprototype> " 14708"<funcprototype> <funcdef>raster <function>ST_MapAlgebraExpr</function></" 14709"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 14710"paramdef> <paramdef><type>text </type> <parameter>pixeltype</parameter></" 14711"paramdef> <paramdef><type>text </type> <parameter>expression</parameter></" 14712"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 14713"<parameter>nodataval=NULL</parameter></paramdef> </funcprototype>" 14714msgstr "" 14715"<funcprototype> <funcdef>raster <function>ST_MapAlgebraExpr</function></" 14716"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 14717"paramdef> <paramdef><type>integer </type> <parameter>band</parameter></" 14718"paramdef> <paramdef><type>text </type> <parameter>pixeltype</parameter></" 14719"paramdef> <paramdef><type>text </type> <parameter>expression</parameter></" 14720"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 14721"<parameter>nodataval=NULL</parameter></paramdef> </funcprototype> " 14722"<funcprototype> <funcdef>raster <function>ST_MapAlgebraExpr</function></" 14723"funcdef> <paramdef><type>raster </type> <parameter>rast</parameter></" 14724"paramdef> <paramdef><type>text </type> <parameter>pixeltype</parameter></" 14725"paramdef> <paramdef><type>text </type> <parameter>expression</parameter></" 14726"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 14727"<parameter>nodataval=NULL</parameter></paramdef> </funcprototype>" 14728 14729#. Tag: para 14730#: reference_raster.xml:7688 reference_raster.xml:7812 14731#, no-c-format 14732msgid "" 14733"is deprecated as of 2.1.0. Use <xref linkend=\"RT_ST_MapAlgebra_expr\"/> " 14734"instead." 14735msgstr "" 14736 14737#. Tag: para 14738#: reference_raster.xml:7693 14739#, no-c-format 14740msgid "" 14741"Creates a new one band raster formed by applying a valid PostgreSQL " 14742"algebraic operation defined by the <varname>expression</varname> on the " 14743"input raster (<varname>rast</varname>). If no <varname>band</varname> is " 14744"specified band 1 is assumed. The new raster will have the same georeference, " 14745"width, and height as the original raster but will only have one band." 14746msgstr "" 14747 14748#. Tag: para 14749#: reference_raster.xml:7701 14750#, no-c-format 14751msgid "" 14752"In the expression you can use the term <varname>[rast]</varname> to refer to " 14753"the pixel value of the original band, <varname>[rast.x]</varname> to refer " 14754"to the 1-based pixel column index, <varname>[rast.y]</varname> to refer to " 14755"the 1-based pixel row index." 14756msgstr "" 14757 14758#. Tag: para 14759#: reference_raster.xml:7711 reference_raster.xml:7910 14760#: reference_raster.xml:8174 14761#, no-c-format 14762msgid "" 14763"Create a new 1 band raster from our original that is a function of modulo 2 " 14764"of the original raster band." 14765msgstr "" 14766 14767#. Tag: programlisting 14768#: reference_raster.xml:7712 14769#, fuzzy, no-c-format 14770msgid "" 14771"ALTER TABLE dummy_rast ADD COLUMN map_rast raster;\n" 14772"UPDATE dummy_rast SET map_rast = ST_MapAlgebraExpr(rast,NULL,'mod([rast]::" 14773"numeric,2)') WHERE rid = 2;\n" 14774"\n" 14775"SELECT\n" 14776" ST_Value(rast,1,i,j) As origval,\n" 14777" ST_Value(map_rast, 1, i, j) As mapval\n" 14778"FROM dummy_rast\n" 14779"CROSS JOIN generate_series(1, 3) AS i\n" 14780"CROSS JOIN generate_series(1,3) AS j\n" 14781"WHERE rid = 2;\n" 14782"\n" 14783" origval | mapval\n" 14784"---------+--------\n" 14785" 253 | 1\n" 14786" 254 | 0\n" 14787" 253 | 1\n" 14788" 253 | 1\n" 14789" 254 | 0\n" 14790" 254 | 0\n" 14791" 250 | 0\n" 14792" 254 | 0\n" 14793" 254 | 0" 14794msgstr "" 14795"ALTER TABLE dummy_rast ADD COLUMN map_rast raster;\n" 14796"CREATE FUNCTION mod_fct(pixel float, pos integer[], variadic args text[])\n" 14797"RETURNS float\n" 14798"AS $$\n" 14799"BEGIN\n" 14800" RETURN pixel::integer % 2;\n" 14801"END;\n" 14802"$$\n" 14803"LANGUAGE 'plpgsql' IMMUTABLE;\n" 14804"\n" 14805"UPDATE dummy_rast SET map_rast = ST_MapAlgebraFct(rast,NULL,'mod_fct(float," 14806"integer[],text[])'::regprocedure) WHERE rid = 2;\n" 14807"\n" 14808"SELECT ST_Value(rast,1,i,j) As origval, ST_Value(map_rast, 1, i, j) As " 14809"mapval\n" 14810"FROM dummy_rast CROSS JOIN generate_series(1, 3) AS i CROSS JOIN " 14811"generate_series(1,3) AS j\n" 14812"WHERE rid = 2;\n" 14813"\n" 14814" origval | mapval\n" 14815"---------+--------\n" 14816" 253 | 1\n" 14817" 254 | 0\n" 14818" 253 | 1\n" 14819" 253 | 1\n" 14820" 254 | 0\n" 14821" 254 | 0\n" 14822" 250 | 0\n" 14823" 254 | 0\n" 14824" 254 | 0" 14825 14826#. Tag: para 14827#: reference_raster.xml:7714 14828#, no-c-format 14829msgid "" 14830"Create a new 1 band raster of pixel-type 2BUI from our original that is " 14831"reclassified and set the nodata value to be 0." 14832msgstr "" 14833 14834#. Tag: programlisting 14835#: reference_raster.xml:7715 14836#, fuzzy, no-c-format 14837msgid "" 14838"ALTER TABLE dummy_rast ADD COLUMN map_rast2 raster;\n" 14839"UPDATE dummy_rast SET\n" 14840" map_rast2 = ST_MapAlgebraExpr(rast,'2BUI'::text,'CASE WHEN [rast] " 14841"BETWEEN 100 and 250 THEN 1 WHEN [rast] = 252 THEN 2 WHEN [rast] BETWEEN 253 " 14842"and 254 THEN 3 ELSE 0 END'::text, '0')\n" 14843"WHERE rid = 2;\n" 14844"\n" 14845"SELECT DISTINCT\n" 14846" ST_Value(rast,1,i,j) As origval,\n" 14847" ST_Value(map_rast2, 1, i, j) As mapval\n" 14848"FROM dummy_rast\n" 14849"CROSS JOIN generate_series(1, 5) AS i\n" 14850"CROSS JOIN generate_series(1,5) AS j\n" 14851"WHERE rid = 2;\n" 14852"\n" 14853" origval | mapval\n" 14854"---------+--------\n" 14855" 249 | 1\n" 14856" 250 | 1\n" 14857" 251 |\n" 14858" 252 | 2\n" 14859" 253 | 3\n" 14860" 254 | 3\n" 14861"\n" 14862"SELECT\n" 14863" ST_BandPixelType(map_rast2) As b1pixtyp\n" 14864"FROM dummy_rast\n" 14865"WHERE rid = 2;\n" 14866"\n" 14867" b1pixtyp\n" 14868"----------\n" 14869" 2BUI" 14870msgstr "" 14871"ALTER TABLE dummy_rast ADD COLUMN map_rast2 raster;\n" 14872"CREATE FUNCTION classify_fct(pixel float, pos integer[], variadic args " 14873"text[])\n" 14874"RETURNS float\n" 14875"AS\n" 14876"$$\n" 14877"DECLARE\n" 14878" nodata float := 0;\n" 14879"BEGIN\n" 14880" IF NOT args[1] IS NULL THEN\n" 14881" nodata := args[1];\n" 14882" END IF;\n" 14883" IF pixel < 251 THEN\n" 14884" RETURN 1;\n" 14885" ELSIF pixel = 252 THEN\n" 14886" RETURN 2;\n" 14887" ELSIF pixel > 252 THEN\n" 14888" RETURN 3;\n" 14889" ELSE\n" 14890" RETURN nodata;\n" 14891" END IF;\n" 14892"END;\n" 14893"$$\n" 14894"LANGUAGE 'plpgsql';\n" 14895"UPDATE dummy_rast SET map_rast2 = " 14896"ST_MapAlgebraFct(rast,'2BUI','classify_fct(float,integer[],text[])'::" 14897"regprocedure, '0') WHERE rid = 2;\n" 14898"\n" 14899"SELECT DISTINCT ST_Value(rast,1,i,j) As origval, ST_Value(map_rast2, 1, i, " 14900"j) As mapval\n" 14901"FROM dummy_rast CROSS JOIN generate_series(1, 5) AS i CROSS JOIN " 14902"generate_series(1,5) AS j\n" 14903"WHERE rid = 2;\n" 14904"\n" 14905" origval | mapval\n" 14906"---------+--------\n" 14907" 249 | 1\n" 14908" 250 | 1\n" 14909" 251 |\n" 14910" 252 | 2\n" 14911" 253 | 3\n" 14912" 254 | 3\n" 14913" \n" 14914"SELECT ST_BandPixelType(map_rast2) As b1pixtyp\n" 14915"FROM dummy_rast WHERE rid = 2;\n" 14916"\n" 14917" b1pixtyp\n" 14918"----------\n" 14919" 2BUI" 14920 14921#. Tag: para 14922#: reference_raster.xml:7729 14923#, fuzzy, no-c-format 14924msgid "original (column rast_view)" 14925msgstr "original (column rast)" 14926 14927#. Tag: para 14928#: reference_raster.xml:7743 reference_raster.xml:8197 14929#, no-c-format 14930msgid "rast_view_ma" 14931msgstr "rast_view_ma" 14932 14933#. Tag: para 14934#: reference_raster.xml:7754 reference_raster.xml:8205 14935#, no-c-format 14936msgid "" 14937"Create a new 3 band raster same pixel type from our original 3 band raster " 14938"with first band altered by map algebra and remaining 2 bands unaltered." 14939msgstr "" 14940 14941#. Tag: programlisting 14942#: reference_raster.xml:7755 14943#, fuzzy, no-c-format 14944msgid "" 14945"SELECT\n" 14946" ST_AddBand(\n" 14947" ST_AddBand(\n" 14948" ST_AddBand(\n" 14949" ST_MakeEmptyRaster(rast_view),\n" 14950" ST_MapAlgebraExpr(rast_view,1," 14951"NULL,'tan([rast])*[rast]')\n" 14952" ),\n" 14953" ST_Band(rast_view,2)\n" 14954" ),\n" 14955" ST_Band(rast_view, 3)\n" 14956" ) As rast_view_ma\n" 14957"FROM wind\n" 14958"WHERE rid=167;" 14959msgstr "" 14960"CREATE FUNCTION rast_plus_tan(pixel float, pos integer[], variadic args " 14961"text[])\n" 14962"RETURNS float\n" 14963"AS\n" 14964"$$\n" 14965"BEGIN\n" 14966" RETURN tan(pixel) * pixel;\n" 14967"END;\n" 14968"$$\n" 14969"LANGUAGE 'plpgsql';\n" 14970"\n" 14971"SELECT ST_AddBand(\n" 14972" ST_AddBand(\n" 14973" ST_AddBand(\n" 14974" ST_MakeEmptyRaster(rast_view),\n" 14975" ST_MapAlgebraFct(rast_view,1," 14976"NULL,'rast_plus_tan(float,integer[],text[])'::regprocedure)\n" 14977" ), \n" 14978" ST_Band(rast_view,2)\n" 14979" ),\n" 14980" ST_Band(rast_view, 3) As rast_view_ma\n" 14981")\n" 14982"FROM wind\n" 14983"WHERE rid=167;" 14984 14985#. Tag: para 14986#: reference_raster.xml:7760 14987#, no-c-format 14988msgid "" 14989", <xref linkend=\"RT_ST_MapAlgebraFct\"/>, <xref linkend=" 14990"\"RT_ST_BandPixelType\"/>, <xref linkend=\"RT_ST_GeoReference\"/>, <xref " 14991"linkend=\"RT_ST_Value\"/>" 14992msgstr "" 14993", <xref linkend=\"RT_ST_MapAlgebraFct\"/>, <xref linkend=" 14994"\"RT_ST_BandPixelType\"/>, <xref linkend=\"RT_ST_GeoReference\"/>, <xref " 14995"linkend=\"RT_ST_Value\"/>" 14996 14997#. Tag: refpurpose 14998#: reference_raster.xml:7773 14999#, no-c-format 15000msgid "" 15001"2 raster band version: Creates a new one band raster formed by applying a " 15002"valid PostgreSQL algebraic operation on the two input raster bands and of " 15003"pixeltype provided. band 1 of each raster is assumed if no band numbers are " 15004"specified. The resulting raster will be aligned (scale, skew and pixel " 15005"corners) on the grid defined by the first raster and have its extent defined " 15006"by the \"extenttype\" parameter. Values for \"extenttype\" can be: " 15007"INTERSECTION, UNION, FIRST, SECOND." 15008msgstr "" 15009 15010#. Tag: funcsynopsis 15011#: reference_raster.xml:7779 15012#, no-c-format 15013msgid "" 15014"<funcprototype> <funcdef>raster <function>ST_MapAlgebraExpr</function></" 15015"funcdef> <paramdef><type>raster </type> <parameter>rast1</parameter></" 15016"paramdef> <paramdef><type>raster </type> <parameter>rast2</parameter></" 15017"paramdef> <paramdef><type>text </type> <parameter>expression</parameter></" 15018"paramdef> <paramdef choice=\"opt\"><type>text </type> " 15019"<parameter>pixeltype=same_as_rast1_band</parameter></paramdef> <paramdef " 15020"choice=\"opt\"><type>text </type> <parameter>extenttype=INTERSECTION</" 15021"parameter></paramdef> <paramdef choice=\"opt\"><type>text </type> " 15022"<parameter>nodata1expr=NULL</parameter></paramdef> <paramdef choice=\"opt" 15023"\"><type>text </type> <parameter>nodata2expr=NULL</parameter></paramdef> " 15024"<paramdef choice=\"opt\"><type>double precision </type> " 15025"<parameter>nodatanodataval=NULL</parameter></paramdef> </funcprototype> " 15026"<funcprototype> <funcdef>raster <function>ST_MapAlgebraExpr</function></" 15027"funcdef> <paramdef><type>raster </type> <parameter>rast1</parameter></" 15028"paramdef> <paramdef><type>integer </type> <parameter>band1</parameter></" 15029"paramdef> <paramdef><type>raster </type> <parameter>rast2</parameter></" 15030"paramdef> <paramdef><type>integer </type> <parameter>band2</parameter></" 15031"paramdef> <paramdef><type>text </type> <parameter>expression</parameter></" 15032"paramdef> <paramdef choice=\"opt\"><type>text </type> " 15033"<parameter>pixeltype=same_as_rast1_band</parameter></paramdef> <paramdef " 15034"choice=\"opt\"><type>text </type> <parameter>extenttype=INTERSECTION</" 15035"parameter></paramdef> <paramdef choice=\"opt\"><type>text </type> " 15036"<parameter>nodata1expr=NULL</parameter></paramdef> <paramdef choice=\"opt" 15037"\"><type>text </type> <parameter>nodata2expr=NULL</parameter></paramdef> " 15038"<paramdef choice=\"opt\"><type>double precision </type> " 15039"<parameter>nodatanodataval=NULL</parameter></paramdef> </funcprototype>" 15040msgstr "" 15041"<funcprototype> <funcdef>raster <function>ST_MapAlgebraExpr</function></" 15042"funcdef> <paramdef><type>raster </type> <parameter>rast1</parameter></" 15043"paramdef> <paramdef><type>raster </type> <parameter>rast2</parameter></" 15044"paramdef> <paramdef><type>text </type> <parameter>expression</parameter></" 15045"paramdef> <paramdef choice=\"opt\"><type>text </type> " 15046"<parameter>pixeltype=same_as_rast1_band</parameter></paramdef> <paramdef " 15047"choice=\"opt\"><type>text </type> <parameter>extenttype=INTERSECTION</" 15048"parameter></paramdef> <paramdef choice=\"opt\"><type>text </type> " 15049"<parameter>nodata1expr=NULL</parameter></paramdef> <paramdef choice=\"opt" 15050"\"><type>text </type> <parameter>nodata2expr=NULL</parameter></paramdef> " 15051"<paramdef choice=\"opt\"><type>double precision </type> " 15052"<parameter>nodatanodataval=NULL</parameter></paramdef> </funcprototype> " 15053"<funcprototype> <funcdef>raster <function>ST_MapAlgebraExpr</function></" 15054"funcdef> <paramdef><type>raster </type> <parameter>rast1</parameter></" 15055"paramdef> <paramdef><type>integer </type> <parameter>band1</parameter></" 15056"paramdef> <paramdef><type>raster </type> <parameter>rast2</parameter></" 15057"paramdef> <paramdef><type>integer </type> <parameter>band2</parameter></" 15058"paramdef> <paramdef><type>text </type> <parameter>expression</parameter></" 15059"paramdef> <paramdef choice=\"opt\"><type>text </type> " 15060"<parameter>pixeltype=same_as_rast1_band</parameter></paramdef> <paramdef " 15061"choice=\"opt\"><type>text </type> <parameter>extenttype=INTERSECTION</" 15062"parameter></paramdef> <paramdef choice=\"opt\"><type>text </type> " 15063"<parameter>nodata1expr=NULL</parameter></paramdef> <paramdef choice=\"opt" 15064"\"><type>text </type> <parameter>nodata2expr=NULL</parameter></paramdef> " 15065"<paramdef choice=\"opt\"><type>double precision </type> " 15066"<parameter>nodatanodataval=NULL</parameter></paramdef> </funcprototype>" 15067 15068#. Tag: para 15069#: reference_raster.xml:7897 15070#, no-c-format 15071msgid "" 15072"If <varname>pixeltype</varname> is passed in, then the new raster will have " 15073"a band of that pixeltype. If pixeltype is passed NULL or no pixel type " 15074"specified, then the new raster band will have the same pixeltype as the " 15075"input <varname>rast1</varname> band." 15076msgstr "" 15077 15078#. Tag: para 15079#: reference_raster.xml:7900 15080#, no-c-format 15081msgid "" 15082"Use the term <varname>[rast1.val]</varname> <varname>[rast2.val]</varname> " 15083"to refer to the pixel value of the original raster bands and <varname>[rast1." 15084"x]</varname>, <varname>[rast1.y]</varname> etc. to refer to the column / row " 15085"positions of the pixels." 15086msgstr "" 15087 15088#. Tag: title 15089#: reference_raster.xml:7908 15090#, no-c-format 15091msgid "Example: 2 Band Intersection and Union" 15092msgstr "" 15093 15094#. Tag: programlisting 15095#: reference_raster.xml:7911 15096#, no-c-format 15097msgid "" 15098"--Create a cool set of rasters --\n" 15099"DROP TABLE IF EXISTS fun_shapes;\n" 15100"CREATE TABLE fun_shapes(rid serial PRIMARY KEY, fun_name text, rast " 15101"raster);\n" 15102"\n" 15103"-- Insert some cool shapes around Boston in Massachusetts state plane meters " 15104"--\n" 15105"INSERT INTO fun_shapes(fun_name, rast)\n" 15106"VALUES ('ref', ST_AsRaster(ST_MakeEnvelope(235229, 899970, 237229, " 15107"901930,26986),200,200,'8BUI',0,0));\n" 15108"\n" 15109"INSERT INTO fun_shapes(fun_name,rast)\n" 15110"WITH ref(rast) AS (SELECT rast FROM fun_shapes WHERE fun_name = 'ref' )\n" 15111"SELECT 'area' AS fun_name, ST_AsRaster(ST_Buffer(ST_SetSRID(ST_Point(236229, " 15112"900930),26986), 1000),\n" 15113" ref.rast,'8BUI', 10, 0) As rast\n" 15114"FROM ref\n" 15115"UNION ALL\n" 15116"SELECT 'rand bubbles',\n" 15117" ST_AsRaster(\n" 15118" (SELECT ST_Collect(geom)\n" 15119" FROM (SELECT ST_Buffer(ST_SetSRID(ST_Point(236229 + i*random()*100, " 15120"900930 + j*random()*100),26986), random()*20) As geom\n" 15121" FROM generate_series(1,10) As i, " 15122"generate_series(1,10) As j\n" 15123" ) As foo ), ref.rast,'8BUI', 200, 0)\n" 15124"FROM ref;\n" 15125"\n" 15126"--map them -\n" 15127"SELECT ST_MapAlgebraExpr(\n" 15128" area.rast, bub.rast, '[rast2.val]', '8BUI', 'INTERSECTION', " 15129"'[rast2.val]', '[rast1.val]') As interrast,\n" 15130" ST_MapAlgebraExpr(\n" 15131" area.rast, bub.rast, '[rast2.val]', '8BUI', 'UNION', " 15132"'[rast2.val]', '[rast1.val]') As unionrast\n" 15133"FROM\n" 15134" (SELECT rast FROM fun_shapes WHERE\n" 15135" fun_name = 'area') As area\n" 15136"CROSS JOIN (SELECT rast\n" 15137"FROM fun_shapes WHERE\n" 15138" fun_name = 'rand bubbles') As bub" 15139msgstr "" 15140 15141#. Tag: para 15142#: reference_raster.xml:7925 15143#, no-c-format 15144msgid "mapalgebra intersection" 15145msgstr "" 15146 15147#. Tag: para 15148#: reference_raster.xml:7939 15149#, no-c-format 15150msgid "map algebra union" 15151msgstr "" 15152 15153#. Tag: title 15154#: reference_raster.xml:7952 reference_raster.xml:8291 15155#, no-c-format 15156msgid "Example: Overlaying rasters on a canvas as separate bands" 15157msgstr "" 15158 15159#. Tag: programlisting 15160#: reference_raster.xml:7953 15161#, no-c-format 15162msgid "" 15163"-- we use ST_AsPNG to render the image so all single band ones look grey --\n" 15164"WITH mygeoms\n" 15165" AS ( SELECT 2 As bnum, ST_Buffer(ST_Point(1,5),10) As geom\n" 15166" UNION ALL\n" 15167" SELECT 3 AS bnum,\n" 15168" ST_Buffer(ST_GeomFromText('LINESTRING(50 50,150 150,150 " 15169"50)'), 10,'join=bevel') As geom\n" 15170" UNION ALL\n" 15171" SELECT 1 As bnum,\n" 15172" ST_Buffer(ST_GeomFromText('LINESTRING(60 50,150 150,150 " 15173"50)'), 5,'join=bevel') As geom\n" 15174" ),\n" 15175" -- define our canvas to be 1 to 1 pixel to geometry\n" 15176" canvas\n" 15177" AS (SELECT ST_AddBand(ST_MakeEmptyRaster(200,\n" 15178" 200,\n" 15179" ST_XMin(e)::integer, ST_YMax(e)::integer, 1, -1, 0, 0) , '8BUI'::" 15180"text,0) As rast\n" 15181" FROM (SELECT ST_Extent(geom) As e,\n" 15182" Max(ST_SRID(geom)) As srid\n" 15183" from mygeoms\n" 15184" ) As foo\n" 15185" ),\n" 15186" rbands AS (SELECT ARRAY(SELECT ST_MapAlgebraExpr(canvas.rast, " 15187"ST_AsRaster(m.geom, canvas.rast, '8BUI', 100),\n" 15188" '[rast2.val]', '8BUI', 'FIRST', '[rast2.val]', '[rast1." 15189"val]') As rast\n" 15190" FROM mygeoms AS m CROSS JOIN canvas\n" 15191" ORDER BY m.bnum) As rasts\n" 15192" )\n" 15193" SELECT rasts[1] As rast1 , rasts[2] As rast2, rasts[3] As rast3, " 15194"ST_AddBand(\n" 15195" ST_AddBand(rasts[1],rasts[2]), rasts[3]) As final_rast\n" 15196" FROM rbands;" 15197msgstr "" 15198 15199#. Tag: para 15200#: reference_raster.xml:7966 15201#, no-c-format 15202msgid "rast1" 15203msgstr "" 15204 15205#. Tag: para 15206#: reference_raster.xml:7979 15207#, no-c-format 15208msgid "rast2" 15209msgstr "" 15210 15211#. Tag: para 15212#: reference_raster.xml:7995 15213#, no-c-format 15214msgid "rast3" 15215msgstr "" 15216 15217#. Tag: para 15218#: reference_raster.xml:8009 15219#, no-c-format 15220msgid "final_rast" 15221msgstr "" 15222 15223#. Tag: title 15224#: reference_raster.xml:8022 15225#, no-c-format 15226msgid "" 15227"Example: Overlay 2 meter boundary of select parcels over an aerial imagery" 15228msgstr "" 15229 15230#. Tag: programlisting 15231#: reference_raster.xml:8024 15232#, no-c-format 15233msgid "" 15234"-- Create new 3 band raster composed of first 2 clipped bands, and overlay " 15235"of 3rd band with our geometry\n" 15236"-- This query took 3.6 seconds on PostGIS windows 64-bit install\n" 15237"WITH pr AS\n" 15238"-- Note the order of operation: we clip all the rasters to dimensions of our " 15239"region\n" 15240"(SELECT ST_Clip(rast,ST_Expand(geom,50) ) As rast, g.geom\n" 15241" FROM aerials.o_2_boston AS r INNER JOIN\n" 15242"-- union our parcels of interest so they form a single geometry we can later " 15243"intersect with\n" 15244" (SELECT ST_Union(ST_Transform(the_geom,26986)) AS geom\n" 15245" FROM landparcels WHERE pid IN('0303890000', '0303900000')) " 15246"As g\n" 15247" ON ST_Intersects(rast::geometry, ST_Expand(g.geom,50))\n" 15248"),\n" 15249"-- we then union the raster shards together\n" 15250"-- ST_Union on raster is kinda of slow but much faster the smaller you can " 15251"get the rasters\n" 15252"-- therefore we want to clip first and then union\n" 15253"prunion AS\n" 15254"(SELECT ST_AddBand(NULL, ARRAY[ST_Union(rast,1),ST_Union(rast,2)," 15255"ST_Union(rast,3)] ) As clipped,geom\n" 15256"FROM pr\n" 15257"GROUP BY geom)\n" 15258"-- return our final raster which is the unioned shard with\n" 15259"-- with the overlay of our parcel boundaries\n" 15260"-- add first 2 bands, then mapalgebra of 3rd band + geometry\n" 15261"SELECT ST_AddBand(ST_Band(clipped,ARRAY[1,2])\n" 15262" , ST_MapAlgebraExpr(ST_Band(clipped,3), " 15263"ST_AsRaster(ST_Buffer(ST_Boundary(geom),2),clipped, '8BUI',250),\n" 15264" '[rast2.val]', '8BUI', 'FIRST', '[rast2.val]', '[rast1.val]') ) As " 15265"rast\n" 15266"FROM prunion;" 15267msgstr "" 15268 15269#. Tag: para 15270#: reference_raster.xml:8038 15271#, no-c-format 15272msgid "The blue lines are the boundaries of select parcels" 15273msgstr "" 15274 15275#. Tag: para 15276#: reference_raster.xml:8052 15277#, no-c-format 15278msgid "" 15279", <xref linkend=\"RT_ST_AddBand\"/>, <xref linkend=\"RT_ST_AsPNG\"/>, <xref " 15280"linkend=\"RT_ST_AsRaster\"/>, <xref linkend=\"RT_ST_MapAlgebraFct\"/>, <xref " 15281"linkend=\"RT_ST_BandPixelType\"/>, <xref linkend=\"RT_ST_GeoReference\"/>, " 15282"<xref linkend=\"RT_ST_Value\"/>, <xref linkend=\"RT_ST_Union\"/>, <xref " 15283"linkend=\"ST_Union\"/>" 15284msgstr "" 15285 15286#. Tag: refname 15287#: reference_raster.xml:8069 reference_raster.xml:8222 15288#, no-c-format 15289msgid "ST_MapAlgebraFct" 15290msgstr "ST_MapAlgebraFct" 15291 15292#. Tag: refpurpose 15293#: reference_raster.xml:8070 15294#, no-c-format 15295msgid "" 15296"1 band version - Creates a new one band raster formed by applying a valid " 15297"PostgreSQL function on the input raster band and of pixeltype prodived. Band " 15298"1 is assumed if no band is specified." 15299msgstr "" 15300 15301#. Tag: funcsynopsis 15302#: reference_raster.xml:8074 15303#, no-c-format 15304msgid "" 15305"<funcprototype> <funcdef>raster <function>ST_MapAlgebraFct</function></" 15306"funcdef> <paramdef><type>raster</type> <parameter>rast</parameter></" 15307"paramdef> <paramdef><type>regprocedure</type> <parameter>onerasteruserfunc</" 15308"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 15309"<function>ST_MapAlgebraFct</function></funcdef> <paramdef><type>raster</" 15310"type> <parameter>rast</parameter></paramdef> <paramdef><type>regprocedure</" 15311"type> <parameter>onerasteruserfunc</parameter></paramdef> " 15312"<paramdef><type>text[]</type> <parameter>VARIADIC args</parameter></" 15313"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 15314"<function>ST_MapAlgebraFct</function></funcdef> <paramdef><type>raster</" 15315"type> <parameter>rast</parameter></paramdef> <paramdef><type>text</type> " 15316"<parameter>pixeltype</parameter></paramdef> <paramdef><type>regprocedure</" 15317"type> <parameter>onerasteruserfunc</parameter></paramdef> </funcprototype> " 15318"<funcprototype> <funcdef>raster <function>ST_MapAlgebraFct</function></" 15319"funcdef> <paramdef><type>raster</type> <parameter>rast</parameter></" 15320"paramdef> <paramdef><type>text</type> <parameter>pixeltype</parameter></" 15321"paramdef> <paramdef><type>regprocedure</type> <parameter>onerasteruserfunc</" 15322"parameter></paramdef> <paramdef><type>text[]</type> <parameter>VARIADIC " 15323"args</parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 15324"<function>ST_MapAlgebraFct</function></funcdef> <paramdef><type>raster</" 15325"type> <parameter>rast</parameter></paramdef> <paramdef><type>integer</type> " 15326"<parameter>band</parameter></paramdef> <paramdef><type>regprocedure</type> " 15327"<parameter>onerasteruserfunc</parameter></paramdef> </funcprototype> " 15328"<funcprototype> <funcdef>raster <function>ST_MapAlgebraFct</function></" 15329"funcdef> <paramdef><type>raster</type> <parameter>rast</parameter></" 15330"paramdef> <paramdef><type>integer</type> <parameter>band</parameter></" 15331"paramdef> <paramdef><type>regprocedure</type> <parameter>onerasteruserfunc</" 15332"parameter></paramdef> <paramdef><type>text[]</type> <parameter>VARIADIC " 15333"args</parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 15334"<function>ST_MapAlgebraFct</function></funcdef> <paramdef><type>raster</" 15335"type> <parameter>rast</parameter></paramdef> <paramdef><type>integer</type> " 15336"<parameter>band</parameter></paramdef> <paramdef><type>text</type> " 15337"<parameter>pixeltype</parameter></paramdef> <paramdef><type>regprocedure</" 15338"type> <parameter>onerasteruserfunc</parameter></paramdef> </funcprototype> " 15339"<funcprototype> <funcdef>raster <function>ST_MapAlgebraFct</function></" 15340"funcdef> <paramdef><type>raster</type> <parameter>rast</parameter></" 15341"paramdef> <paramdef><type>integer</type> <parameter>band</parameter></" 15342"paramdef> <paramdef><type>text</type> <parameter>pixeltype</parameter></" 15343"paramdef> <paramdef><type>regprocedure</type> <parameter>onerasteruserfunc</" 15344"parameter></paramdef> <paramdef><type>text[]</type> <parameter>VARIADIC " 15345"args</parameter></paramdef> </funcprototype>" 15346msgstr "" 15347"<funcprototype> <funcdef>raster <function>ST_MapAlgebraFct</function></" 15348"funcdef> <paramdef><type>raster</type> <parameter>rast</parameter></" 15349"paramdef> <paramdef><type>regprocedure</type> <parameter>onerasteruserfunc</" 15350"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 15351"<function>ST_MapAlgebraFct</function></funcdef> <paramdef><type>raster</" 15352"type> <parameter>rast</parameter></paramdef> <paramdef><type>regprocedure</" 15353"type> <parameter>onerasteruserfunc</parameter></paramdef> " 15354"<paramdef><type>text[]</type> <parameter>VARIADIC args</parameter></" 15355"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 15356"<function>ST_MapAlgebraFct</function></funcdef> <paramdef><type>raster</" 15357"type> <parameter>rast</parameter></paramdef> <paramdef><type>text</type> " 15358"<parameter>pixeltype</parameter></paramdef> <paramdef><type>regprocedure</" 15359"type> <parameter>onerasteruserfunc</parameter></paramdef> </funcprototype> " 15360"<funcprototype> <funcdef>raster <function>ST_MapAlgebraFct</function></" 15361"funcdef> <paramdef><type>raster</type> <parameter>rast</parameter></" 15362"paramdef> <paramdef><type>text</type> <parameter>pixeltype</parameter></" 15363"paramdef> <paramdef><type>regprocedure</type> <parameter>onerasteruserfunc</" 15364"parameter></paramdef> <paramdef><type>text[]</type> <parameter>VARIADIC " 15365"args</parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 15366"<function>ST_MapAlgebraFct</function></funcdef> <paramdef><type>raster</" 15367"type> <parameter>rast</parameter></paramdef> <paramdef><type>integer</type> " 15368"<parameter>band</parameter></paramdef> <paramdef><type>regprocedure</type> " 15369"<parameter>onerasteruserfunc</parameter></paramdef> </funcprototype> " 15370"<funcprototype> <funcdef>raster <function>ST_MapAlgebraFct</function></" 15371"funcdef> <paramdef><type>raster</type> <parameter>rast</parameter></" 15372"paramdef> <paramdef><type>integer</type> <parameter>band</parameter></" 15373"paramdef> <paramdef><type>regprocedure</type> <parameter>onerasteruserfunc</" 15374"parameter></paramdef> <paramdef><type>text[]</type> <parameter>VARIADIC " 15375"args</parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 15376"<function>ST_MapAlgebraFct</function></funcdef> <paramdef><type>raster</" 15377"type> <parameter>rast</parameter></paramdef> <paramdef><type>integer</type> " 15378"<parameter>band</parameter></paramdef> <paramdef><type>text</type> " 15379"<parameter>pixeltype</parameter></paramdef> <paramdef><type>regprocedure</" 15380"type> <parameter>onerasteruserfunc</parameter></paramdef> </funcprototype> " 15381"<funcprototype> <funcdef>raster <function>ST_MapAlgebraFct</function></" 15382"funcdef> <paramdef><type>raster</type> <parameter>rast</parameter></" 15383"paramdef> <paramdef><type>integer</type> <parameter>band</parameter></" 15384"paramdef> <paramdef><type>text</type> <parameter>pixeltype</parameter></" 15385"paramdef> <paramdef><type>regprocedure</type> <parameter>onerasteruserfunc</" 15386"parameter></paramdef> <paramdef><type>text[]</type> <parameter>VARIADIC " 15387"args</parameter></paramdef> </funcprototype>" 15388 15389#. Tag: para 15390#: reference_raster.xml:8138 reference_raster.xml:8256 15391#: reference_raster.xml:8369 15392#, no-c-format 15393msgid "" 15394"is deprecated as of 2.1.0. Use <xref linkend=\"RT_ST_MapAlgebra\"/> instead." 15395msgstr "" 15396 15397#. Tag: para 15398#: reference_raster.xml:8143 15399#, no-c-format 15400msgid "" 15401"Creates a new one band raster formed by applying a valid PostgreSQL function " 15402"specified by the <varname>onerasteruserfunc</varname> on the input raster " 15403"(<varname>rast</varname>). If no <varname>band</varname> is specified, band " 15404"1 is assumed. The new raster will have the same georeference, width, and " 15405"height as the original raster but will only have one band." 15406msgstr "" 15407 15408#. Tag: para 15409#: reference_raster.xml:8147 15410#, no-c-format 15411msgid "" 15412"The <varname>onerasteruserfunc</varname> parameter must be the name and " 15413"signature of a SQL or PL/pgSQL function, cast to a regprocedure. A very " 15414"simple and quite useless PL/pgSQL function example is: " 15415"<programlisting>CREATE OR REPLACE FUNCTION simple_function(pixel FLOAT, pos " 15416"INTEGER[], VARIADIC args TEXT[])\n" 15417" RETURNS FLOAT\n" 15418" AS $$ BEGIN\n" 15419" RETURN 0.0;\n" 15420" END; $$\n" 15421" LANGUAGE 'plpgsql' IMMUTABLE;</programlisting> The " 15422"<varname>userfunction</varname> may accept two or three arguments: a float " 15423"value, an optional integer array, and a variadic text array. The first " 15424"argument is the value of an individual raster cell (regardless of the raster " 15425"datatype). The second argument is the position of the current processing " 15426"cell in the form '{x,y}'. The third argument indicates that all remaining " 15427"parameters to <xref linkend=\"RT_ST_MapAlgebraFct\"/> shall be passed " 15428"through to the <varname>userfunction</varname>." 15429msgstr "" 15430 15431#. Tag: para 15432#: reference_raster.xml:8152 15433#, no-c-format 15434msgid "" 15435"Passing a <type>regprodedure</type> argument to a SQL function requires the " 15436"full function signature to be passed, then cast to a <type>regprocedure</" 15437"type> type. To pass the above example PL/pgSQL function as an argument, the " 15438"SQL for the argument is:<programlisting>'simple_function(float,integer[]," 15439"text[])'::regprocedure</programlisting>Note that the argument contains the " 15440"name of the function, the types of the function arguments, quotes around the " 15441"name and argument types, and a cast to a <type>regprocedure</type>." 15442msgstr "" 15443 15444#. Tag: para 15445#: reference_raster.xml:8156 15446#, no-c-format 15447msgid "" 15448"The third argument to the <varname>userfunction</varname> is a " 15449"<type>variadic text</type> array. All trailing text arguments to any <xref " 15450"linkend=\"RT_ST_MapAlgebraFct\"/> call are passed through to the specified " 15451"<varname>userfunction</varname>, and are contained in the <varname>args</" 15452"varname> argument." 15453msgstr "" 15454 15455#. Tag: para 15456#: reference_raster.xml:8165 15457#, no-c-format 15458msgid "" 15459"The <type>text[]</type> argument to the <varname>userfunction</varname> is " 15460"required, regardless of whether you choose to pass any arguments to your " 15461"user function for processing or not." 15462msgstr "" 15463 15464#. Tag: programlisting 15465#: reference_raster.xml:8175 15466#, no-c-format 15467msgid "" 15468"ALTER TABLE dummy_rast ADD COLUMN map_rast raster;\n" 15469"CREATE FUNCTION mod_fct(pixel float, pos integer[], variadic args text[])\n" 15470"RETURNS float\n" 15471"AS $$\n" 15472"BEGIN\n" 15473" RETURN pixel::integer % 2;\n" 15474"END;\n" 15475"$$\n" 15476"LANGUAGE 'plpgsql' IMMUTABLE;\n" 15477"\n" 15478"UPDATE dummy_rast SET map_rast = ST_MapAlgebraFct(rast,NULL,'mod_fct(float," 15479"integer[],text[])'::regprocedure) WHERE rid = 2;\n" 15480"\n" 15481"SELECT ST_Value(rast,1,i,j) As origval, ST_Value(map_rast, 1, i, j) As " 15482"mapval\n" 15483"FROM dummy_rast CROSS JOIN generate_series(1, 3) AS i CROSS JOIN " 15484"generate_series(1,3) AS j\n" 15485"WHERE rid = 2;\n" 15486"\n" 15487" origval | mapval\n" 15488"---------+--------\n" 15489" 253 | 1\n" 15490" 254 | 0\n" 15491" 253 | 1\n" 15492" 253 | 1\n" 15493" 254 | 0\n" 15494" 254 | 0\n" 15495" 250 | 0\n" 15496" 254 | 0\n" 15497" 254 | 0" 15498msgstr "" 15499"ALTER TABLE dummy_rast ADD COLUMN map_rast raster;\n" 15500"CREATE FUNCTION mod_fct(pixel float, pos integer[], variadic args text[])\n" 15501"RETURNS float\n" 15502"AS $$\n" 15503"BEGIN\n" 15504" RETURN pixel::integer % 2;\n" 15505"END;\n" 15506"$$\n" 15507"LANGUAGE 'plpgsql' IMMUTABLE;\n" 15508"\n" 15509"UPDATE dummy_rast SET map_rast = ST_MapAlgebraFct(rast,NULL,'mod_fct(float," 15510"integer[],text[])'::regprocedure) WHERE rid = 2;\n" 15511"\n" 15512"SELECT ST_Value(rast,1,i,j) As origval, ST_Value(map_rast, 1, i, j) As " 15513"mapval\n" 15514"FROM dummy_rast CROSS JOIN generate_series(1, 3) AS i CROSS JOIN " 15515"generate_series(1,3) AS j\n" 15516"WHERE rid = 2;\n" 15517"\n" 15518" origval | mapval\n" 15519"---------+--------\n" 15520" 253 | 1\n" 15521" 254 | 0\n" 15522" 253 | 1\n" 15523" 253 | 1\n" 15524" 254 | 0\n" 15525" 254 | 0\n" 15526" 250 | 0\n" 15527" 254 | 0\n" 15528" 254 | 0" 15529 15530#. Tag: para 15531#: reference_raster.xml:8177 15532#, no-c-format 15533msgid "" 15534"Create a new 1 band raster of pixel-type 2BUI from our original that is " 15535"reclassified and set the nodata value to a passed parameter to the user " 15536"function (0)." 15537msgstr "" 15538 15539#. Tag: programlisting 15540#: reference_raster.xml:8178 15541#, fuzzy, no-c-format 15542msgid "" 15543"ALTER TABLE dummy_rast ADD COLUMN map_rast2 raster;\n" 15544"CREATE FUNCTION classify_fct(pixel float, pos integer[], variadic args " 15545"text[])\n" 15546"RETURNS float\n" 15547"AS\n" 15548"$$\n" 15549"DECLARE\n" 15550" nodata float := 0;\n" 15551"BEGIN\n" 15552" IF NOT args[1] IS NULL THEN\n" 15553" nodata := args[1];\n" 15554" END IF;\n" 15555" IF pixel < 251 THEN\n" 15556" RETURN 1;\n" 15557" ELSIF pixel = 252 THEN\n" 15558" RETURN 2;\n" 15559" ELSIF pixel > 252 THEN\n" 15560" RETURN 3;\n" 15561" ELSE\n" 15562" RETURN nodata;\n" 15563" END IF;\n" 15564"END;\n" 15565"$$\n" 15566"LANGUAGE 'plpgsql';\n" 15567"UPDATE dummy_rast SET map_rast2 = " 15568"ST_MapAlgebraFct(rast,'2BUI','classify_fct(float,integer[],text[])'::" 15569"regprocedure, '0') WHERE rid = 2;\n" 15570"\n" 15571"SELECT DISTINCT ST_Value(rast,1,i,j) As origval, ST_Value(map_rast2, 1, i, " 15572"j) As mapval\n" 15573"FROM dummy_rast CROSS JOIN generate_series(1, 5) AS i CROSS JOIN " 15574"generate_series(1,5) AS j\n" 15575"WHERE rid = 2;\n" 15576"\n" 15577" origval | mapval\n" 15578"---------+--------\n" 15579" 249 | 1\n" 15580" 250 | 1\n" 15581" 251 |\n" 15582" 252 | 2\n" 15583" 253 | 3\n" 15584" 254 | 3\n" 15585"\n" 15586"SELECT ST_BandPixelType(map_rast2) As b1pixtyp\n" 15587"FROM dummy_rast WHERE rid = 2;\n" 15588"\n" 15589" b1pixtyp\n" 15590"----------\n" 15591" 2BUI" 15592msgstr "" 15593"ALTER TABLE dummy_rast ADD COLUMN map_rast2 raster;\n" 15594"CREATE FUNCTION classify_fct(pixel float, pos integer[], variadic args " 15595"text[])\n" 15596"RETURNS float\n" 15597"AS\n" 15598"$$\n" 15599"DECLARE\n" 15600" nodata float := 0;\n" 15601"BEGIN\n" 15602" IF NOT args[1] IS NULL THEN\n" 15603" nodata := args[1];\n" 15604" END IF;\n" 15605" IF pixel < 251 THEN\n" 15606" RETURN 1;\n" 15607" ELSIF pixel = 252 THEN\n" 15608" RETURN 2;\n" 15609" ELSIF pixel > 252 THEN\n" 15610" RETURN 3;\n" 15611" ELSE\n" 15612" RETURN nodata;\n" 15613" END IF;\n" 15614"END;\n" 15615"$$\n" 15616"LANGUAGE 'plpgsql';\n" 15617"UPDATE dummy_rast SET map_rast2 = " 15618"ST_MapAlgebraFct(rast,'2BUI','classify_fct(float,integer[],text[])'::" 15619"regprocedure, '0') WHERE rid = 2;\n" 15620"\n" 15621"SELECT DISTINCT ST_Value(rast,1,i,j) As origval, ST_Value(map_rast2, 1, i, " 15622"j) As mapval\n" 15623"FROM dummy_rast CROSS JOIN generate_series(1, 5) AS i CROSS JOIN " 15624"generate_series(1,5) AS j\n" 15625"WHERE rid = 2;\n" 15626"\n" 15627" origval | mapval\n" 15628"---------+--------\n" 15629" 249 | 1\n" 15630" 250 | 1\n" 15631" 251 |\n" 15632" 252 | 2\n" 15633" 253 | 3\n" 15634" 254 | 3\n" 15635" \n" 15636"SELECT ST_BandPixelType(map_rast2) As b1pixtyp\n" 15637"FROM dummy_rast WHERE rid = 2;\n" 15638"\n" 15639" b1pixtyp\n" 15640"----------\n" 15641" 2BUI" 15642 15643#. Tag: para 15644#: reference_raster.xml:8189 15645#, no-c-format 15646msgid "original (column rast-view)" 15647msgstr "" 15648 15649#. Tag: programlisting 15650#: reference_raster.xml:8206 15651#, fuzzy, no-c-format 15652msgid "" 15653"CREATE FUNCTION rast_plus_tan(pixel float, pos integer[], variadic args " 15654"text[])\n" 15655"RETURNS float\n" 15656"AS\n" 15657"$$\n" 15658"BEGIN\n" 15659" RETURN tan(pixel) * pixel;\n" 15660"END;\n" 15661"$$\n" 15662"LANGUAGE 'plpgsql';\n" 15663"\n" 15664"SELECT ST_AddBand(\n" 15665" ST_AddBand(\n" 15666" ST_AddBand(\n" 15667" ST_MakeEmptyRaster(rast_view),\n" 15668" ST_MapAlgebraFct(rast_view,1," 15669"NULL,'rast_plus_tan(float,integer[],text[])'::regprocedure)\n" 15670" ),\n" 15671" ST_Band(rast_view,2)\n" 15672" ),\n" 15673" ST_Band(rast_view, 3) As rast_view_ma\n" 15674")\n" 15675"FROM wind\n" 15676"WHERE rid=167;" 15677msgstr "" 15678"CREATE FUNCTION rast_plus_tan(pixel float, pos integer[], variadic args " 15679"text[])\n" 15680"RETURNS float\n" 15681"AS\n" 15682"$$\n" 15683"BEGIN\n" 15684" RETURN tan(pixel) * pixel;\n" 15685"END;\n" 15686"$$\n" 15687"LANGUAGE 'plpgsql';\n" 15688"\n" 15689"SELECT ST_AddBand(\n" 15690" ST_AddBand(\n" 15691" ST_AddBand(\n" 15692" ST_MakeEmptyRaster(rast_view),\n" 15693" ST_MapAlgebraFct(rast_view,1," 15694"NULL,'rast_plus_tan(float,integer[],text[])'::regprocedure)\n" 15695" ), \n" 15696" ST_Band(rast_view,2)\n" 15697" ),\n" 15698" ST_Band(rast_view, 3) As rast_view_ma\n" 15699")\n" 15700"FROM wind\n" 15701"WHERE rid=167;" 15702 15703#. Tag: para 15704#: reference_raster.xml:8211 reference_raster.xml:8334 15705#, no-c-format 15706msgid "" 15707", <xref linkend=\"RT_ST_BandPixelType\"/>, <xref linkend=\"RT_ST_GeoReference" 15708"\"/>, <xref linkend=\"RT_ST_SetValue\"/>" 15709msgstr "" 15710", <xref linkend=\"RT_ST_BandPixelType\"/>, <xref linkend=\"RT_ST_GeoReference" 15711"\"/>, <xref linkend=\"RT_ST_SetValue\"/>" 15712 15713#. Tag: refpurpose 15714#: reference_raster.xml:8223 15715#, no-c-format 15716msgid "" 15717"2 band version - Creates a new one band raster formed by applying a valid " 15718"PostgreSQL function on the 2 input raster bands and of pixeltype prodived. " 15719"Band 1 is assumed if no band is specified. Extent type defaults to " 15720"INTERSECTION if not specified." 15721msgstr "" 15722 15723#. Tag: funcsynopsis 15724#: reference_raster.xml:8227 15725#, no-c-format 15726msgid "" 15727"<funcprototype> <funcdef>raster <function>ST_MapAlgebraFct</function></" 15728"funcdef> <paramdef><type>raster</type> <parameter>rast1</parameter></" 15729"paramdef> <paramdef><type>raster</type> <parameter>rast2</parameter></" 15730"paramdef> <paramdef><type>regprocedure</type> <parameter>tworastuserfunc</" 15731"parameter></paramdef> <paramdef choice=\"opt\"><type>text</type> " 15732"<parameter>pixeltype=same_as_rast1</parameter></paramdef> <paramdef choice=" 15733"\"opt\"><type>text</type> <parameter>extenttype=INTERSECTION</parameter></" 15734"paramdef> <paramdef><type>text[]</type> <parameter>VARIADIC userargs</" 15735"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 15736"<function>ST_MapAlgebraFct</function></funcdef> <paramdef><type>raster</" 15737"type> <parameter>rast1</parameter></paramdef> <paramdef><type>integer</type> " 15738"<parameter>band1</parameter></paramdef> <paramdef><type>raster</type> " 15739"<parameter>rast2</parameter></paramdef> <paramdef><type>integer</type> " 15740"<parameter>band2</parameter></paramdef> <paramdef><type>regprocedure</type> " 15741"<parameter>tworastuserfunc</parameter></paramdef> <paramdef choice=\"opt" 15742"\"><type>text</type> <parameter>pixeltype=same_as_rast1</parameter></" 15743"paramdef> <paramdef choice=\"opt\"><type>text</type> " 15744"<parameter>extenttype=INTERSECTION</parameter></paramdef> " 15745"<paramdef><type>text[]</type> <parameter>VARIADIC userargs</parameter></" 15746"paramdef> </funcprototype>" 15747msgstr "" 15748"<funcprototype> <funcdef>raster <function>ST_MapAlgebraFct</function></" 15749"funcdef> <paramdef><type>raster</type> <parameter>rast1</parameter></" 15750"paramdef> <paramdef><type>raster</type> <parameter>rast2</parameter></" 15751"paramdef> <paramdef><type>regprocedure</type> <parameter>tworastuserfunc</" 15752"parameter></paramdef> <paramdef choice=\"opt\"><type>text</type> " 15753"<parameter>pixeltype=same_as_rast1</parameter></paramdef> <paramdef choice=" 15754"\"opt\"><type>text</type> <parameter>extenttype=INTERSECTION</parameter></" 15755"paramdef> <paramdef><type>text[]</type> <parameter>VARIADIC userargs</" 15756"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 15757"<function>ST_MapAlgebraFct</function></funcdef> <paramdef><type>raster</" 15758"type> <parameter>rast1</parameter></paramdef> <paramdef><type>integer</type> " 15759"<parameter>band1</parameter></paramdef> <paramdef><type>raster</type> " 15760"<parameter>rast2</parameter></paramdef> <paramdef><type>integer</type> " 15761"<parameter>band2</parameter></paramdef> <paramdef><type>regprocedure</type> " 15762"<parameter>tworastuserfunc</parameter></paramdef> <paramdef choice=\"opt" 15763"\"><type>text</type> <parameter>pixeltype=same_as_rast1</parameter></" 15764"paramdef> <paramdef choice=\"opt\"><type>text</type> " 15765"<parameter>extenttype=INTERSECTION</parameter></paramdef> " 15766"<paramdef><type>text[]</type> <parameter>VARIADIC userargs</parameter></" 15767"paramdef> </funcprototype>" 15768 15769#. Tag: para 15770#: reference_raster.xml:8261 15771#, no-c-format 15772msgid "" 15773"Creates a new one band raster formed by applying a valid PostgreSQL function " 15774"specified by the <varname>tworastuserfunc</varname> on the input raster " 15775"<varname>rast1</varname>, <varname>rast2</varname>. If no <varname>band1</" 15776"varname> or <varname>band2</varname> is specified, band 1 is assumed. The " 15777"new raster will have the same georeference, width, and height as the " 15778"original rasters but will only have one band." 15779msgstr "" 15780 15781#. Tag: para 15782#: reference_raster.xml:8264 15783#, no-c-format 15784msgid "" 15785"If <varname>pixeltype</varname> is passed in, then the new raster will have " 15786"a band of that pixeltype. If pixeltype is passed NULL or left out, then the " 15787"new raster band will have the same pixeltype as the input <varname>rast1</" 15788"varname> band." 15789msgstr "" 15790 15791#. Tag: para 15792#: reference_raster.xml:8267 15793#, no-c-format 15794msgid "" 15795"The <varname>tworastuserfunc</varname> parameter must be the name and " 15796"signature of an SQL or PL/pgSQL function, cast to a regprocedure. An example " 15797"PL/pgSQL function example is: <programlisting>CREATE OR REPLACE FUNCTION " 15798"simple_function_for_two_rasters(pixel1 FLOAT, pixel2 FLOAT, pos INTEGER[], " 15799"VARIADIC args TEXT[])\n" 15800" RETURNS FLOAT\n" 15801" AS $$ BEGIN\n" 15802" RETURN 0.0;\n" 15803" END; $$\n" 15804" LANGUAGE 'plpgsql' IMMUTABLE;</programlisting> The " 15805"<varname>tworastuserfunc</varname> may accept three or four arguments: a " 15806"double precision value, a double precision value, an optional integer array, " 15807"and a variadic text array. The first argument is the value of an individual " 15808"raster cell in <varname>rast1</varname> (regardless of the raster datatype). " 15809"The second argument is an individual raster cell value in <varname>rast2</" 15810"varname>. The third argument is the position of the current processing cell " 15811"in the form '{x,y}'. The fourth argument indicates that all remaining " 15812"parameters to <xref linkend=\"RT_ST_MapAlgebraFct2\"/> shall be passed " 15813"through to the <varname>tworastuserfunc</varname>." 15814msgstr "" 15815 15816#. Tag: para 15817#: reference_raster.xml:8273 15818#, no-c-format 15819msgid "" 15820"Passing a <type>regprodedure</type> argument to a SQL function requires the " 15821"full function signature to be passed, then cast to a <type>regprocedure</" 15822"type> type. To pass the above example PL/pgSQL function as an argument, the " 15823"SQL for the argument is:<programlisting>'simple_function(double precision, " 15824"double precision, integer[], text[])'::regprocedure</programlisting>Note " 15825"that the argument contains the name of the function, the types of the " 15826"function arguments, quotes around the name and argument types, and a cast to " 15827"a <type>regprocedure</type>." 15828msgstr "" 15829 15830#. Tag: para 15831#: reference_raster.xml:8276 15832#, no-c-format 15833msgid "" 15834"The fourth argument to the <varname>tworastuserfunc</varname> is a " 15835"<type>variadic text</type> array. All trailing text arguments to any <xref " 15836"linkend=\"RT_ST_MapAlgebraFct2\"/> call are passed through to the specified " 15837"<varname>tworastuserfunc</varname>, and are contained in the " 15838"<varname>userargs</varname> argument." 15839msgstr "" 15840 15841#. Tag: para 15842#: reference_raster.xml:8284 15843#, no-c-format 15844msgid "" 15845"The <type>text[]</type> argument to the <varname>tworastuserfunc</varname> " 15846"is required, regardless of whether you choose to pass any arguments to your " 15847"user function for processing or not." 15848msgstr "" 15849 15850#. Tag: programlisting 15851#: reference_raster.xml:8292 15852#, no-c-format 15853msgid "" 15854"-- define our user defined function --\n" 15855"CREATE OR REPLACE FUNCTION raster_mapalgebra_union(\n" 15856" rast1 double precision,\n" 15857" rast2 double precision,\n" 15858" pos integer[],\n" 15859" VARIADIC userargs text[]\n" 15860")\n" 15861" RETURNS double precision\n" 15862" AS $$\n" 15863" DECLARE\n" 15864" BEGIN\n" 15865" CASE\n" 15866" WHEN rast1 IS NOT NULL AND rast2 IS NOT NULL THEN\n" 15867" RETURN ((rast1 + rast2)/2.);\n" 15868" WHEN rast1 IS NULL AND rast2 IS NULL THEN\n" 15869" RETURN NULL;\n" 15870" WHEN rast1 IS NULL THEN\n" 15871" RETURN rast2;\n" 15872" ELSE\n" 15873" RETURN rast1;\n" 15874" END CASE;\n" 15875"\n" 15876" RETURN NULL;\n" 15877" END;\n" 15878" $$ LANGUAGE 'plpgsql' IMMUTABLE COST 1000;\n" 15879"\n" 15880"-- prep our test table of rasters\n" 15881"DROP TABLE IF EXISTS map_shapes;\n" 15882"CREATE TABLE map_shapes(rid serial PRIMARY KEY, rast raster, bnum integer, " 15883"descrip text);\n" 15884"INSERT INTO map_shapes(rast,bnum, descrip)\n" 15885"WITH mygeoms\n" 15886" AS ( SELECT 2 As bnum, ST_Buffer(ST_Point(90,90),30) As geom, 'circle' " 15887"As descrip\n" 15888" UNION ALL\n" 15889" SELECT 3 AS bnum,\n" 15890" ST_Buffer(ST_GeomFromText('LINESTRING(50 50,150 150,150 " 15891"50)'), 15) As geom, 'big road' As descrip\n" 15892" UNION ALL\n" 15893" SELECT 1 As bnum,\n" 15894" ST_Translate(ST_Buffer(ST_GeomFromText('LINESTRING(60 50,150 " 15895"150,150 50)'), 8,'join=bevel'), 10,-6) As geom, 'small road' As descrip\n" 15896" ),\n" 15897" -- define our canvas to be 1 to 1 pixel to geometry\n" 15898" canvas\n" 15899" AS ( SELECT ST_AddBand(ST_MakeEmptyRaster(250,\n" 15900" 250,\n" 15901" ST_XMin(e)::integer, ST_YMax(e)::integer, 1, -1, 0, 0 ) , '8BUI'::" 15902"text,0) As rast\n" 15903" FROM (SELECT ST_Extent(geom) As e,\n" 15904" Max(ST_SRID(geom)) As srid\n" 15905" from mygeoms\n" 15906" ) As foo\n" 15907" )\n" 15908"-- return our rasters aligned with our canvas\n" 15909"SELECT ST_AsRaster(m.geom, canvas.rast, '8BUI', 240) As rast, bnum, descrip\n" 15910" FROM mygeoms AS m CROSS JOIN canvas\n" 15911"UNION ALL\n" 15912"SELECT canvas.rast, 4, 'canvas'\n" 15913"FROM canvas;\n" 15914"\n" 15915"-- Map algebra on single band rasters and then collect with ST_AddBand\n" 15916"INSERT INTO map_shapes(rast,bnum,descrip)\n" 15917"SELECT ST_AddBand(ST_AddBand(rasts[1], rasts[2]),rasts[3]), 4, 'map bands " 15918"overlay fct union (canvas)'\n" 15919" FROM (SELECT ARRAY(SELECT ST_MapAlgebraFct(m1.rast, m2.rast,\n" 15920" 'raster_mapalgebra_union(double precision, double " 15921"precision, integer[], text[])'::regprocedure, '8BUI', 'FIRST')\n" 15922" FROM map_shapes As m1 CROSS JOIN map_shapes As m2\n" 15923" WHERE m1.descrip = 'canvas' AND m2.descrip <> 'canvas' ORDER " 15924"BY m2.bnum) As rasts) As foo;" 15925msgstr "" 15926 15927#. Tag: para 15928#: reference_raster.xml:8305 15929#, no-c-format 15930msgid "map bands overlay (canvas) (R: small road, G: circle, B: big road)" 15931msgstr "" 15932 15933#. Tag: title 15934#: reference_raster.xml:8317 15935#, no-c-format 15936msgid "User Defined function that takes extra args" 15937msgstr "" 15938 15939#. Tag: programlisting 15940#: reference_raster.xml:8318 15941#, no-c-format 15942msgid "" 15943"CREATE OR REPLACE FUNCTION raster_mapalgebra_userargs(\n" 15944" rast1 double precision,\n" 15945" rast2 double precision,\n" 15946" pos integer[],\n" 15947" VARIADIC userargs text[]\n" 15948")\n" 15949" RETURNS double precision\n" 15950" AS $$\n" 15951" DECLARE\n" 15952" BEGIN\n" 15953" CASE\n" 15954" WHEN rast1 IS NOT NULL AND rast2 IS NOT NULL THEN\n" 15955" RETURN least(userargs[1]::integer,(rast1 + " 15956"rast2)/2.);\n" 15957" WHEN rast1 IS NULL AND rast2 IS NULL THEN\n" 15958" RETURN userargs[2]::integer;\n" 15959" WHEN rast1 IS NULL THEN\n" 15960" RETURN greatest(rast2,random()*userargs[3]::" 15961"integer)::integer;\n" 15962" ELSE\n" 15963" RETURN greatest(rast1, random()*userargs[4]::" 15964"integer)::integer;\n" 15965" END CASE;\n" 15966"\n" 15967" RETURN NULL;\n" 15968" END;\n" 15969" $$ LANGUAGE 'plpgsql' VOLATILE COST 1000;\n" 15970"\n" 15971"SELECT ST_MapAlgebraFct(m1.rast, 1, m1.rast, 3,\n" 15972" 'raster_mapalgebra_userargs(double precision, double " 15973"precision, integer[], text[])'::regprocedure,\n" 15974" '8BUI', 'INTERSECT', '100','200','200','0')\n" 15975" FROM map_shapes As m1\n" 15976" WHERE m1.descrip = 'map bands overlay fct union (canvas)';" 15977msgstr "" 15978 15979#. Tag: para 15980#: reference_raster.xml:8326 15981#, no-c-format 15982msgid "user defined with extra args and different bands from same raster" 15983msgstr "" 15984 15985#. Tag: refname 15986#: reference_raster.xml:8345 15987#, no-c-format 15988msgid "ST_MapAlgebraFctNgb" 15989msgstr "ST_MapAlgebraFctNgb" 15990 15991#. Tag: refpurpose 15992#: reference_raster.xml:8346 15993#, no-c-format 15994msgid "" 15995"1-band version: Map Algebra Nearest Neighbor using user-defined PostgreSQL " 15996"function. Return a raster which values are the result of a PLPGSQL user " 15997"function involving a neighborhood of values from the input raster band." 15998msgstr "" 15999 16000#. Tag: funcprototype 16001#: reference_raster.xml:8351 16002#, no-c-format 16003msgid "" 16004"<funcdef>raster <function>ST_MapAlgebraFctNgb</function></funcdef> " 16005"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 16006"<paramdef><type>integer </type> <parameter>band</parameter></paramdef> " 16007"<paramdef><type>text </type> <parameter>pixeltype</parameter></paramdef> " 16008"<paramdef><type>integer </type> <parameter>ngbwidth</parameter></paramdef> " 16009"<paramdef><type>integer </type> <parameter>ngbheight</parameter></paramdef> " 16010"<paramdef><type>regprocedure </type> <parameter>onerastngbuserfunc</" 16011"parameter></paramdef> <paramdef><type>text </type> <parameter>nodatamode</" 16012"parameter></paramdef> <paramdef><type>text[] </type> <parameter>VARIADIC " 16013"args</parameter></paramdef>" 16014msgstr "" 16015"<funcdef>raster <function>ST_MapAlgebraFctNgb</function></funcdef> " 16016"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 16017"<paramdef><type>integer </type> <parameter>band</parameter></paramdef> " 16018"<paramdef><type>text </type> <parameter>pixeltype</parameter></paramdef> " 16019"<paramdef><type>integer </type> <parameter>ngbwidth</parameter></paramdef> " 16020"<paramdef><type>integer </type> <parameter>ngbheight</parameter></paramdef> " 16021"<paramdef><type>regprocedure </type> <parameter>onerastngbuserfunc</" 16022"parameter></paramdef> <paramdef><type>text </type> <parameter>nodatamode</" 16023"parameter></paramdef> <paramdef><type>text[] </type> <parameter>VARIADIC " 16024"args</parameter></paramdef>" 16025 16026#. Tag: para 16027#: reference_raster.xml:8374 16028#, no-c-format 16029msgid "" 16030"(one raster version) Return a raster which values are the result of a " 16031"PLPGSQL user function involving a neighborhood of values from the input " 16032"raster band. The user function takes the neighborhood of pixel values as an " 16033"array of numbers, for each pixel, returns the result from the user function, " 16034"replacing pixel value of currently inspected pixel with the function result." 16035msgstr "" 16036 16037#. Tag: term 16038#: reference_raster.xml:8378 16039#, no-c-format 16040msgid "rast" 16041msgstr "rast" 16042 16043#. Tag: para 16044#: reference_raster.xml:8379 16045#, no-c-format 16046msgid "Raster on which the user function is evaluated." 16047msgstr "" 16048 16049#. Tag: term 16050#: reference_raster.xml:8382 16051#, no-c-format 16052msgid "band" 16053msgstr "" 16054 16055#. Tag: para 16056#: reference_raster.xml:8383 16057#, no-c-format 16058msgid "Band number of the raster to be evaluated. Default to 1." 16059msgstr "" 16060 16061#. Tag: para 16062#: reference_raster.xml:8387 16063#, no-c-format 16064msgid "" 16065"The resulting pixel type of the output raster. Must be one listed in <xref " 16066"linkend=\"RT_ST_BandPixelType\"/> or left out or set to NULL. If not passed " 16067"in or set to NULL, will default to the pixeltype of the <varname>rast</" 16068"varname>. Results are truncated if they are larger than what is allowed for " 16069"the pixeltype." 16070msgstr "" 16071 16072#. Tag: term 16073#: reference_raster.xml:8390 16074#, no-c-format 16075msgid "ngbwidth" 16076msgstr "ngbwidth" 16077 16078#. Tag: para 16079#: reference_raster.xml:8391 16080#, no-c-format 16081msgid "The width of the neighborhood, in cells." 16082msgstr "La larghezza dell'intorno, in celle." 16083 16084#. Tag: term 16085#: reference_raster.xml:8394 16086#, no-c-format 16087msgid "ngbheight" 16088msgstr "ngbheight" 16089 16090#. Tag: para 16091#: reference_raster.xml:8395 16092#, no-c-format 16093msgid "The height of the neighborhood, in cells." 16094msgstr "L'altezza dell'intorno, in celle." 16095 16096#. Tag: term 16097#: reference_raster.xml:8398 16098#, no-c-format 16099msgid "onerastngbuserfunc" 16100msgstr "" 16101 16102#. Tag: para 16103#: reference_raster.xml:8399 16104#, no-c-format 16105msgid "" 16106"PLPGSQL/psql user function to apply to neighborhood pixels of a single band " 16107"of a raster. The first element is a 2-dimensional array of numbers " 16108"representing the rectangular pixel neighborhood" 16109msgstr "" 16110 16111#. Tag: term 16112#: reference_raster.xml:8402 16113#, no-c-format 16114msgid "nodatamode" 16115msgstr "" 16116 16117#. Tag: para 16118#: reference_raster.xml:8404 16119#, no-c-format 16120msgid "" 16121"Defines what value to pass to the function for a neighborhood pixel that is " 16122"nodata or NULL" 16123msgstr "" 16124 16125#. Tag: para 16126#: reference_raster.xml:8405 16127#, no-c-format 16128msgid "" 16129"'ignore': any NODATA values encountered in the neighborhood are ignored by " 16130"the computation -- this flag must be sent to the user callback function, and " 16131"the user function decides how to ignore it." 16132msgstr "" 16133 16134#. Tag: para 16135#: reference_raster.xml:8406 16136#, no-c-format 16137msgid "" 16138"'NULL': any NODATA values encountered in the neighborhood will cause the " 16139"resulting pixel to be NULL -- the user callback function is skipped in this " 16140"case." 16141msgstr "" 16142 16143#. Tag: para 16144#: reference_raster.xml:8407 16145#, no-c-format 16146msgid "" 16147"'value': any NODATA values encountered in the neighborhood are replaced by " 16148"the reference pixel (the one in the center of the neighborhood). Note that " 16149"if this value is NODATA, the behavior is the same as 'NULL' (for the " 16150"affected neighborhood)" 16151msgstr "" 16152 16153#. Tag: term 16154#: reference_raster.xml:8411 16155#, no-c-format 16156msgid "args" 16157msgstr "args" 16158 16159#. Tag: para 16160#: reference_raster.xml:8412 16161#, no-c-format 16162msgid "Arguments to pass into the user function." 16163msgstr "argomenti da passare alla funzione utente." 16164 16165#. Tag: para 16166#: reference_raster.xml:8422 16167#, no-c-format 16168msgid "" 16169"Examples utilize the katrina raster loaded as a single tile described in " 16170"<ulink url=\"http://trac.osgeo.org/gdal/wiki/frmts_wtkraster.html\">http://" 16171"trac.osgeo.org/gdal/wiki/frmts_wtkraster.html</ulink> and then prepared in " 16172"the <xref linkend=\"RT_ST_Rescale\"/> examples" 16173msgstr "" 16174 16175#. Tag: programlisting 16176#: reference_raster.xml:8424 16177#, no-c-format 16178msgid "" 16179"--\n" 16180"-- A simple 'callback' user function that averages up all the values in a " 16181"neighborhood.\n" 16182"--\n" 16183"CREATE OR REPLACE FUNCTION rast_avg(matrix float[][], nodatamode text, " 16184"variadic args text[])\n" 16185" RETURNS float AS\n" 16186" $$\n" 16187" DECLARE\n" 16188" _matrix float[][];\n" 16189" x1 integer;\n" 16190" x2 integer;\n" 16191" y1 integer;\n" 16192" y2 integer;\n" 16193" sum float;\n" 16194" BEGIN\n" 16195" _matrix := matrix;\n" 16196" sum := 0;\n" 16197" FOR x in array_lower(matrix, 1)..array_upper(matrix, 1) LOOP\n" 16198" FOR y in array_lower(matrix, 2)..array_upper(matrix, 2) LOOP\n" 16199" sum := sum + _matrix[x][y];\n" 16200" END LOOP;\n" 16201" END LOOP;\n" 16202" RETURN (sum*1.0/(array_upper(matrix,1)*array_upper(matrix,2) ))::" 16203"integer ;\n" 16204" END;\n" 16205" $$\n" 16206"LANGUAGE 'plpgsql' IMMUTABLE COST 1000;\n" 16207"\n" 16208"-- now we apply to our raster averaging pixels within 2 pixels of each other " 16209"in X and Y direction --\n" 16210"SELECT ST_MapAlgebraFctNgb(rast, 1, '8BUI', 4,4,\n" 16211" 'rast_avg(float[][], text, text[])'::regprocedure, 'NULL', " 16212"NULL) As nn_with_border\n" 16213" FROM katrinas_rescaled\n" 16214" limit 1;" 16215msgstr "" 16216 16217#. Tag: para 16218#: reference_raster.xml:8438 16219#, no-c-format 16220msgid "First band of our raster" 16221msgstr "" 16222 16223#. Tag: para 16224#: reference_raster.xml:8452 16225#, no-c-format 16226msgid "new raster after averaging pixels withing 4x4 pixels of each other" 16227msgstr "" 16228 16229#. Tag: para 16230#: reference_raster.xml:8467 16231#, no-c-format 16232msgid "" 16233", <xref linkend=\"RT_ST_MapAlgebraExpr\"/>, <xref linkend=\"RT_ST_Rescale\"/>" 16234msgstr "" 16235", <xref linkend=\"RT_ST_MapAlgebraExpr\"/>, <xref linkend=\"RT_ST_Rescale\"/>" 16236 16237#. Tag: refname 16238#: reference_raster.xml:8477 16239#, no-c-format 16240msgid "ST_Reclass" 16241msgstr "ST_Reclass" 16242 16243#. Tag: refpurpose 16244#: reference_raster.xml:8478 16245#, no-c-format 16246msgid "" 16247"Creates a new raster composed of band types reclassified from original. The " 16248"nband is the band to be changed. If nband is not specified assumed to be 1. " 16249"All other bands are returned unchanged. Use case: convert a 16BUI band to a " 16250"8BUI and so forth for simpler rendering as viewable formats." 16251msgstr "" 16252 16253#. Tag: funcsynopsis 16254#: reference_raster.xml:8482 16255#, no-c-format 16256msgid "" 16257"<funcprototype> <funcdef>raster <function>ST_Reclass</function></funcdef> " 16258"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 16259"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 16260"<paramdef><type>text </type> <parameter>reclassexpr</parameter></paramdef> " 16261"<paramdef><type>text </type> <parameter>pixeltype</parameter></paramdef> " 16262"<paramdef choice=\"opt\"><type>double precision </type> " 16263"<parameter>nodataval=NULL</parameter></paramdef> </funcprototype> " 16264"<funcprototype> <funcdef>raster <function>ST_Reclass</function></funcdef> " 16265"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 16266"<paramdef><type>reclassarg[] </type> <parameter>VARIADIC reclassargset</" 16267"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 16268"<function>ST_Reclass</function></funcdef> <paramdef><type>raster </type> " 16269"<parameter>rast</parameter></paramdef> <paramdef><type>text </type> " 16270"<parameter>reclassexpr</parameter></paramdef> <paramdef><type>text </type> " 16271"<parameter>pixeltype</parameter></paramdef> </funcprototype>" 16272msgstr "" 16273"<funcprototype> <funcdef>raster <function>ST_Reclass</function></funcdef> " 16274"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 16275"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 16276"<paramdef><type>text </type> <parameter>reclassexpr</parameter></paramdef> " 16277"<paramdef><type>text </type> <parameter>pixeltype</parameter></paramdef> " 16278"<paramdef choice=\"opt\"><type>double precision </type> " 16279"<parameter>nodataval=NULL</parameter></paramdef> </funcprototype> " 16280"<funcprototype> <funcdef>raster <function>ST_Reclass</function></funcdef> " 16281"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 16282"<paramdef><type>reclassarg[] </type> <parameter>VARIADIC reclassargset</" 16283"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>raster " 16284"<function>ST_Reclass</function></funcdef> <paramdef><type>raster </type> " 16285"<parameter>rast</parameter></paramdef> <paramdef><type>text </type> " 16286"<parameter>reclassexpr</parameter></paramdef> <paramdef><type>text </type> " 16287"<parameter>pixeltype</parameter></paramdef> </funcprototype>" 16288 16289#. Tag: para 16290#: reference_raster.xml:8510 16291#, no-c-format 16292msgid "" 16293"Creates a new raster formed by applying a valid PostgreSQL algebraic " 16294"operation defined by the <varname>reclassexpr</varname> on the input raster " 16295"(<varname>rast</varname>). If no <varname>band</varname> is specified band 1 " 16296"is assumed. The new raster will have the same georeference, width, and " 16297"height as the original raster. Bands not designated will come back " 16298"unchanged. Refer to <xref linkend=\"reclassarg\"/> for description of valid " 16299"reclassification expressions." 16300msgstr "" 16301 16302#. Tag: para 16303#: reference_raster.xml:8512 16304#, no-c-format 16305msgid "" 16306"The bands of the new raster will have pixel type of <varname>pixeltype</" 16307"varname>. If <varname>reclassargset</varname> is passed in then each " 16308"reclassarg defines behavior of each band generated." 16309msgstr "" 16310 16311#. Tag: para 16312#: reference_raster.xml:8519 16313#, no-c-format 16314msgid "" 16315"Create a new raster from the original where band 2 is converted from 8BUI to " 16316"4BUI and all values from 101-254 are set to nodata value." 16317msgstr "" 16318 16319#. Tag: programlisting 16320#: reference_raster.xml:8520 16321#, no-c-format 16322msgid "" 16323"ALTER TABLE dummy_rast ADD COLUMN reclass_rast raster;\n" 16324"UPDATE dummy_rast SET reclass_rast = ST_Reclass(rast,2,'0-87:1-10, " 16325"88-100:11-15, 101-254:0-0', '4BUI',0) WHERE rid = 2;\n" 16326"\n" 16327"SELECT i as col, j as row, ST_Value(rast,2,i,j) As origval,\n" 16328" ST_Value(reclass_rast, 2, i, j) As reclassval,\n" 16329" ST_Value(reclass_rast, 2, i, j, false) As reclassval_include_nodata\n" 16330"FROM dummy_rast CROSS JOIN generate_series(1, 3) AS i CROSS JOIN " 16331"generate_series(1,3) AS j\n" 16332"WHERE rid = 2;\n" 16333"\n" 16334" col | row | origval | reclassval | reclassval_include_nodata\n" 16335"-----+-----+---------+------------+---------------------------\n" 16336" 1 | 1 | 78 | 9 | 9\n" 16337" 2 | 1 | 98 | 14 | 14\n" 16338" 3 | 1 | 122 | | 0\n" 16339" 1 | 2 | 96 | 14 | 14\n" 16340" 2 | 2 | 118 | | 0\n" 16341" 3 | 2 | 180 | | 0\n" 16342" 1 | 3 | 99 | 15 | 15\n" 16343" 2 | 3 | 112 | | 0\n" 16344" 3 | 3 | 169 | | 0" 16345msgstr "" 16346 16347#. Tag: title 16348#: reference_raster.xml:8524 16349#, no-c-format 16350msgid "Example: Advanced using multiple reclassargs" 16351msgstr "" 16352 16353#. Tag: para 16354#: reference_raster.xml:8526 16355#, no-c-format 16356msgid "" 16357"Create a new raster from the original where band 1,2,3 is converted to " 16358"1BB,4BUI, 4BUI respectively and reclassified. Note this uses the variadic " 16359"<varname>reclassarg</varname> argument which can take as input an indefinite " 16360"number of reclassargs (theoretically as many bands as you have)" 16361msgstr "" 16362 16363#. Tag: programlisting 16364#: reference_raster.xml:8527 16365#, no-c-format 16366msgid "" 16367"UPDATE dummy_rast SET reclass_rast =\n" 16368" ST_Reclass(rast,\n" 16369" ROW(2,'0-87]:1-10, (87-100]:11-15, (101-254]:0-0', '4BUI',NULL)::" 16370"reclassarg,\n" 16371" ROW(1,'0-253]:1, 254:0', '1BB', NULL)::reclassarg,\n" 16372" ROW(3,'0-70]:1, (70-86:2, [86-150):3, [150-255:4', '4BUI', NULL)::" 16373"reclassarg\n" 16374" ) WHERE rid = 2;\n" 16375"\n" 16376"SELECT i as col, j as row,ST_Value(rast,1,i,j) As ov1, " 16377"ST_Value(reclass_rast, 1, i, j) As rv1,\n" 16378" ST_Value(rast,2,i,j) As ov2, ST_Value(reclass_rast, 2, i, j) As rv2,\n" 16379" ST_Value(rast,3,i,j) As ov3, ST_Value(reclass_rast, 3, i, j) As rv3\n" 16380"FROM dummy_rast CROSS JOIN generate_series(1, 3) AS i CROSS JOIN " 16381"generate_series(1,3) AS j\n" 16382"WHERE rid = 2;\n" 16383"\n" 16384"col | row | ov1 | rv1 | ov2 | rv2 | ov3 | rv3\n" 16385"----+-----+-----+-----+-----+-----+-----+-----\n" 16386" 1 | 1 | 253 | 1 | 78 | 9 | 70 | 1\n" 16387" 2 | 1 | 254 | 0 | 98 | 14 | 86 | 3\n" 16388" 3 | 1 | 253 | 1 | 122 | 0 | 100 | 3\n" 16389" 1 | 2 | 253 | 1 | 96 | 14 | 80 | 2\n" 16390" 2 | 2 | 254 | 0 | 118 | 0 | 108 | 3\n" 16391" 3 | 2 | 254 | 0 | 180 | 0 | 162 | 4\n" 16392" 1 | 3 | 250 | 1 | 99 | 15 | 90 | 3\n" 16393" 2 | 3 | 254 | 0 | 112 | 0 | 108 | 3\n" 16394" 3 | 3 | 254 | 0 | 169 | 0 | 175 | 4" 16395msgstr "" 16396 16397#. Tag: title 16398#: reference_raster.xml:8531 16399#, no-c-format 16400msgid "" 16401"Example: Advanced Map a single band 32BF raster to multiple viewable bands" 16402msgstr "" 16403 16404#. Tag: para 16405#: reference_raster.xml:8532 16406#, no-c-format 16407msgid "" 16408"Create a new 3 band (8BUI,8BUI,8BUI viewable raster) from a raster that has " 16409"only one 32bf band" 16410msgstr "" 16411 16412#. Tag: programlisting 16413#: reference_raster.xml:8533 16414#, no-c-format 16415msgid "" 16416"ALTER TABLE wind ADD COLUMN rast_view raster;\n" 16417"UPDATE wind\n" 16418" set rast_view = ST_AddBand( NULL,\n" 16419" ARRAY[\n" 16420" ST_Reclass(rast, 1,'0.1-10]:1-10,9-10]:11,(11-33:0'::text, '8BUI'::" 16421"text,0),\n" 16422" ST_Reclass(rast,1, '11-33):0-255,[0-32:0,(34-1000:0'::text, '8BUI'::" 16423"text,0),\n" 16424" ST_Reclass(rast,1,'0-32]:0,(32-100:100-255'::text, '8BUI'::text,0)\n" 16425" ]\n" 16426" );" 16427msgstr "" 16428 16429#. Tag: para 16430#: reference_raster.xml:8538 16431#, no-c-format 16432msgid "" 16433", <xref linkend=\"RT_ST_Band\"/>, <xref linkend=\"RT_ST_BandPixelType\"/>, " 16434"<xref linkend=\"RT_ST_MakeEmptyRaster\"/>, <xref linkend=\"reclassarg\"/>, " 16435"<xref linkend=\"RT_ST_Value\"/>" 16436msgstr "" 16437", <xref linkend=\"RT_ST_Band\"/>, <xref linkend=\"RT_ST_BandPixelType\"/>, " 16438"<xref linkend=\"RT_ST_MakeEmptyRaster\"/>, <xref linkend=\"reclassarg\"/>, " 16439"<xref linkend=\"RT_ST_Value\"/>" 16440 16441#. Tag: refname 16442#: reference_raster.xml:8551 16443#, no-c-format 16444msgid "ST_Union" 16445msgstr "ST_Union" 16446 16447#. Tag: refpurpose 16448#: reference_raster.xml:8552 16449#, no-c-format 16450msgid "" 16451"Returns the union of a set of raster tiles into a single raster composed of " 16452"1 or more bands." 16453msgstr "" 16454 16455#. Tag: funcprototype 16456#: reference_raster.xml:8557 16457#, no-c-format 16458msgid "" 16459"<funcdef>raster <function>ST_Union</function></funcdef> " 16460"<paramdef><type>setof raster </type> <parameter>rast</parameter></paramdef>" 16461msgstr "" 16462"<funcdef>raster <function>ST_Union</function></funcdef> " 16463"<paramdef><type>setof raster </type> <parameter>rast</parameter></paramdef>" 16464 16465#. Tag: funcprototype 16466#: reference_raster.xml:8563 16467#, no-c-format 16468msgid "" 16469"<funcdef>raster <function>ST_Union</function></funcdef> " 16470"<paramdef><type>setof raster </type> <parameter>rast</parameter></paramdef> " 16471"<paramdef><type>unionarg[] </type> <parameter>unionargset</parameter></" 16472"paramdef>" 16473msgstr "" 16474"<funcdef>raster <function>ST_Union</function></funcdef> " 16475"<paramdef><type>setof raster </type> <parameter>rast</parameter></paramdef> " 16476"<paramdef><type>unionarg[] </type> <parameter>unionargset</parameter></" 16477"paramdef>" 16478 16479#. Tag: funcprototype 16480#: reference_raster.xml:8570 16481#, no-c-format 16482msgid "" 16483"<funcdef>raster <function>ST_Union</function></funcdef> " 16484"<paramdef><type>setof raster</type> <parameter>rast</parameter></paramdef> " 16485"<paramdef><type>integer</type> <parameter>nband</parameter></paramdef>" 16486msgstr "" 16487"<funcdef>raster <function>ST_Union</function></funcdef> " 16488"<paramdef><type>setof raster</type> <parameter>rast</parameter></paramdef> " 16489"<paramdef><type>integer</type> <parameter>nband</parameter></paramdef>" 16490 16491#. Tag: funcprototype 16492#: reference_raster.xml:8577 16493#, no-c-format 16494msgid "" 16495"<funcdef>raster <function>ST_Union</function></funcdef> " 16496"<paramdef><type>setof raster</type> <parameter>rast</parameter></paramdef> " 16497"<paramdef><type>text</type> <parameter>uniontype</parameter></paramdef>" 16498msgstr "" 16499"<funcdef>raster <function>ST_Union</function></funcdef> " 16500"<paramdef><type>setof raster</type> <parameter>rast</parameter></paramdef> " 16501"<paramdef><type>text</type> <parameter>uniontype</parameter></paramdef>" 16502 16503#. Tag: funcprototype 16504#: reference_raster.xml:8584 16505#, no-c-format 16506msgid "" 16507"<funcdef>raster <function>ST_Union</function></funcdef> " 16508"<paramdef><type>setof raster</type> <parameter>rast</parameter></paramdef> " 16509"<paramdef><type>integer</type> <parameter>nband</parameter></paramdef> " 16510"<paramdef><type>text</type> <parameter>uniontype</parameter></paramdef>" 16511msgstr "" 16512"<funcdef>raster <function>ST_Union</function></funcdef> " 16513"<paramdef><type>setof raster</type> <parameter>rast</parameter></paramdef> " 16514"<paramdef><type>integer</type> <parameter>nband</parameter></paramdef> " 16515"<paramdef><type>text</type> <parameter>uniontype</parameter></paramdef>" 16516 16517#. Tag: para 16518#: reference_raster.xml:8596 16519#, no-c-format 16520msgid "" 16521"Returns the union of a set of raster tiles into a single raster composed of " 16522"at least one band. The resulting raster's extent is the extent of the whole " 16523"set. In the case of intersection, the resulting value is defined by " 16524"<varname>uniontype</varname> which is one of the following: LAST (default), " 16525"FIRST, MIN, MAX, COUNT, SUM, MEAN, RANGE." 16526msgstr "" 16527 16528#. Tag: para 16529#: reference_raster.xml:8599 16530#, no-c-format 16531msgid "" 16532"In order for rasters to be unioned, they must all have the same alignment. " 16533"Use <xref linkend=\"RT_ST_SameAlignment\"/> and <xref linkend=" 16534"\"RT_ST_NotSameAlignmentReason\"/> for more details and help. One way to fix " 16535"alignment issues is to use <xref linkend=\"RT_ST_Resample\"/> and use the " 16536"same reference raster for alignment." 16537msgstr "" 16538 16539#. Tag: para 16540#: reference_raster.xml:8603 16541#, no-c-format 16542msgid "Enhanced: 2.1.0 Improved Speed (fully C-Based)." 16543msgstr "" 16544 16545#. Tag: para 16546#: reference_raster.xml:8604 16547#, no-c-format 16548msgid "Availability: 2.1.0 ST_Union(rast, unionarg) variant was introduced." 16549msgstr "" 16550 16551#. Tag: para 16552#: reference_raster.xml:8605 16553#, no-c-format 16554msgid "" 16555"Enhanced: 2.1.0 ST_Union(rast) (variant 1) unions all bands of all input " 16556"rasters. Prior versions of PostGIS assumed the first band." 16557msgstr "" 16558 16559#. Tag: para 16560#: reference_raster.xml:8606 16561#, no-c-format 16562msgid "" 16563"Enhanced: 2.1.0 ST_Union(rast, uniontype) (variant 4) unions all bands of " 16564"all input rasters." 16565msgstr "" 16566 16567#. Tag: title 16568#: reference_raster.xml:8609 16569#, no-c-format 16570msgid "Examples: Reconstitute a single band chunked raster tile" 16571msgstr "" 16572 16573#. Tag: programlisting 16574#: reference_raster.xml:8610 16575#, no-c-format 16576msgid "" 16577"-- this creates a single band from first band of raster tiles\n" 16578"-- that form the original file system tile\n" 16579"SELECT filename, ST_Union(rast,1) As file_rast\n" 16580"FROM sometable WHERE filename IN('dem01', 'dem02') GROUP BY filename;" 16581msgstr "" 16582 16583#. Tag: title 16584#: reference_raster.xml:8614 reference_raster.xml:8618 16585#, no-c-format 16586msgid "" 16587"Examples: Return a multi-band raster that is the union of tiles intersecting " 16588"geometry" 16589msgstr "" 16590 16591#. Tag: programlisting 16592#: reference_raster.xml:8615 16593#, no-c-format 16594msgid "" 16595"-- this creates a multi band raster collecting all the tiles that intersect " 16596"a line\n" 16597"-- Note: In 2.0, this would have just returned a single band raster\n" 16598"-- , new union works on all bands by default\n" 16599"-- this is equivalent to unionarg: ARRAY[ROW(1, 'LAST'), ROW(2, 'LAST'), " 16600"ROW(3, 'LAST')]::unionarg[]\n" 16601"SELECT ST_Union(rast)\n" 16602"FROM aerials.boston\n" 16603"WHERE ST_Intersects(rast, ST_GeomFromText('LINESTRING(230486 887771, 230500 " 16604"88772)',26986) );" 16605msgstr "" 16606 16607#. Tag: para 16608#: reference_raster.xml:8619 16609#, no-c-format 16610msgid "" 16611"Here we use the longer syntax if we only wanted a subset of bands or we want " 16612"to change order of bands" 16613msgstr "" 16614 16615#. Tag: programlisting 16616#: reference_raster.xml:8620 16617#, no-c-format 16618msgid "" 16619"-- this creates a multi band raster collecting all the tiles that intersect " 16620"a line\n" 16621"SELECT ST_Union(rast,ARRAY[ROW(2, 'LAST'), ROW(1, 'LAST'), ROW(3, 'LAST')]::" 16622"unionarg[])\n" 16623"FROM aerials.boston\n" 16624"WHERE ST_Intersects(rast, ST_GeomFromText('LINESTRING(230486 887771, 230500 " 16625"88772)',26986) );" 16626msgstr "" 16627 16628#. Tag: para 16629#: reference_raster.xml:8626 16630#, no-c-format 16631msgid "" 16632", <xref linkend=\"RT_ST_Envelope\"/>, <xref linkend=\"RT_ST_ConvexHull\"/>, " 16633"<xref linkend=\"RT_ST_Clip\"/>, <xref linkend=\"ST_Union\"/>" 16634msgstr "" 16635 16636#. Tag: title 16637#: reference_raster.xml:8639 16638#, no-c-format 16639msgid "Built-in Map Algebra Callback Functions" 16640msgstr "" 16641 16642#. Tag: refname 16643#: reference_raster.xml:8643 16644#, no-c-format 16645msgid "ST_Distinct4ma" 16646msgstr "ST_Distinct4ma" 16647 16648#. Tag: refpurpose 16649#: reference_raster.xml:8644 16650#, no-c-format 16651msgid "" 16652"Raster processing function that calculates the number of unique pixel values " 16653"in a neighborhood." 16654msgstr "" 16655 16656#. Tag: funcsynopsis 16657#: reference_raster.xml:8648 16658#, no-c-format 16659msgid "" 16660"<funcprototype> <funcdef>float8 <function>ST_Distinct4ma</function></" 16661"funcdef> <paramdef><type>float8[][]</type> <parameter>matrix</parameter></" 16662"paramdef> <paramdef><type>text</type> <parameter>nodatamode</parameter></" 16663"paramdef> <paramdef><type>text[]</type> <parameter>VARIADIC args</" 16664"parameter></paramdef> </funcprototype> <funcprototype> <funcdef>double " 16665"precision <function>ST_Distinct4ma</function></funcdef> " 16666"<paramdef><type>double precision[][][]</type> <parameter>value</parameter></" 16667"paramdef> <paramdef><type>integer[][] </type> <parameter>pos</parameter></" 16668"paramdef> <paramdef><type>text[]</type> <parameter>VARIADIC userargs</" 16669"parameter></paramdef> </funcprototype>" 16670msgstr "" 16671 16672#. Tag: para 16673#: reference_raster.xml:8668 16674#, no-c-format 16675msgid "" 16676"Calculate the number of unique pixel values in a neighborhood of pixels." 16677msgstr "" 16678 16679#. Tag: para 16680#: reference_raster.xml:8671 reference_raster.xml:8810 16681#: reference_raster.xml:8885 reference_raster.xml:8970 16682#: reference_raster.xml:9095 reference_raster.xml:9166 16683#: reference_raster.xml:9241 16684#, no-c-format 16685msgid "" 16686"Variant 1 is a specialized callback function for use as a callback parameter " 16687"to <xref linkend=\"RT_ST_MapAlgebraFctNgb\"/>." 16688msgstr "" 16689 16690#. Tag: para 16691#: reference_raster.xml:8675 reference_raster.xml:8814 16692#: reference_raster.xml:8889 reference_raster.xml:8976 16693#: reference_raster.xml:9099 reference_raster.xml:9170 16694#: reference_raster.xml:9245 16695#, no-c-format 16696msgid "" 16697"Variant 2 is a specialized callback function for use as a callback parameter " 16698"to <xref linkend=\"RT_ST_MapAlgebra\"/>." 16699msgstr "" 16700 16701#. Tag: para 16702#: reference_raster.xml:8681 reference_raster.xml:8820 16703#: reference_raster.xml:8895 reference_raster.xml:8982 16704#: reference_raster.xml:9105 reference_raster.xml:9176 16705#: reference_raster.xml:9251 16706#, no-c-format 16707msgid "" 16708"Use of Variant 1 is discouraged since <xref linkend=\"RT_ST_MapAlgebraFctNgb" 16709"\"/> has been deprecated as of 2.1.0." 16710msgstr "" 16711 16712#. Tag: para 16713#: reference_raster.xml:8687 reference_raster.xml:8826 16714#: reference_raster.xml:8901 reference_raster.xml:8988 16715#: reference_raster.xml:9111 reference_raster.xml:9182 16716#: reference_raster.xml:9257 16717#, no-c-format 16718msgid "Enhanced: 2.1.0 Addition of Variant 2" 16719msgstr "" 16720 16721#. Tag: programlisting 16722#: reference_raster.xml:8693 16723#, fuzzy, no-c-format 16724msgid "" 16725"SELECT\n" 16726" rid,\n" 16727" st_value(\n" 16728" st_mapalgebrafctngb(rast, 1, NULL, 1, 1, 'st_distinct4ma(float[][]," 16729"text,text[])'::regprocedure, 'ignore', NULL), 2, 2\n" 16730" )\n" 16731"FROM dummy_rast\n" 16732"WHERE rid = 2;\n" 16733" rid | st_value\n" 16734"-----+----------\n" 16735" 2 | 3\n" 16736"(1 row)" 16737msgstr "" 16738"SELECT \n" 16739" rid,\n" 16740" st_value(\n" 16741" st_mapalgebrafctngb(rast, 1, NULL, 1, 1, 'st_distinct4ma(float[][]," 16742"text,text[])'::regprocedure, 'ignore', NULL), 2, 2\n" 16743" ) \n" 16744"FROM dummy_rast \n" 16745"WHERE rid = 2;\n" 16746" rid | st_value\n" 16747"-----+----------\n" 16748" 2 | 3\n" 16749"(1 row)" 16750 16751#. Tag: para 16752#: reference_raster.xml:8699 reference_raster.xml:9123 16753#: reference_raster.xml:9194 16754#, no-c-format 16755msgid "" 16756", <xref linkend=\"RT_ST_MapAlgebra\"/>, <xref linkend=\"RT_ST_Min4ma\"/>, " 16757"<xref linkend=\"RT_ST_Max4ma\"/>, <xref linkend=\"RT_ST_Sum4ma\"/>, <xref " 16758"linkend=\"RT_ST_Mean4ma\"/>, <xref linkend=\"RT_ST_Distinct4ma\"/>, <xref " 16759"linkend=\"RT_ST_StdDev4ma\"/>" 16760msgstr "" 16761 16762#. Tag: refname 16763#: reference_raster.xml:8714 16764#, no-c-format 16765msgid "ST_InvDistWeight4ma" 16766msgstr "ST_InvDistWeight4ma" 16767 16768#. Tag: refpurpose 16769#: reference_raster.xml:8715 16770#, no-c-format 16771msgid "" 16772"Raster processing function that interpolates a pixel's value from the " 16773"pixel's neighborhood." 16774msgstr "" 16775 16776#. Tag: funcprototype 16777#: reference_raster.xml:8720 16778#, no-c-format 16779msgid "" 16780"<funcdef>double precision <function>ST_InvDistWeight4ma</function></funcdef> " 16781"<paramdef><type>double precision[][][]</type> <parameter>value</parameter></" 16782"paramdef> <paramdef><type>integer[][]</type> <parameter>pos</parameter></" 16783"paramdef> <paramdef><type>text[]</type> <parameter>VARIADIC userargs</" 16784"parameter></paramdef>" 16785msgstr "" 16786 16787#. Tag: para 16788#: reference_raster.xml:8732 16789#, no-c-format 16790msgid "" 16791"Calculate an interpolated value for a pixel using the Inverse Distance " 16792"Weighted method." 16793msgstr "" 16794 16795#. Tag: para 16796#: reference_raster.xml:8734 16797#, no-c-format 16798msgid "" 16799"There are two optional parameters that can be passed through " 16800"<varname>userargs</varname>. The first parameter is the power factor " 16801"(variable k in the equation below) between 0 and 1 used in the Inverse " 16802"Distance Weighted equation. If not specified, default value is 1. The second " 16803"parameter is the weight percentage applied only when the value of the pixel " 16804"of interest is included with the interpolated value from the neighborhood. " 16805"If not specified and the pixel of interest has a value, that value is " 16806"returned." 16807msgstr "" 16808 16809#. Tag: para 16810#: reference_raster.xml:8738 16811#, no-c-format 16812msgid "The basic inverse distance weight equation is:" 16813msgstr "" 16814 16815#. Tag: para 16816#: reference_raster.xml:8747 16817#, no-c-format 16818msgid "k = power factor, a real number between 0 and 1" 16819msgstr "" 16820 16821#. Tag: para 16822#: reference_raster.xml:8756 reference_raster.xml:9041 16823#, no-c-format 16824msgid "" 16825"This function is a specialized callback function for use as a callback " 16826"parameter to <xref linkend=\"RT_ST_MapAlgebra\"/>." 16827msgstr "" 16828 16829#. Tag: programlisting 16830#: reference_raster.xml:8764 reference_raster.xml:9049 16831#, no-c-format 16832msgid "-- NEEDS EXAMPLE" 16833msgstr "-- SERVE ESEMPIO" 16834 16835#. Tag: para 16836#: reference_raster.xml:8769 16837#, no-c-format 16838msgid ", <xref linkend=\"RT_ST_MinDist4ma\"/>" 16839msgstr ", <xref linkend=\"RT_ST_MinDist4ma\"/>" 16840 16841#. Tag: refname 16842#: reference_raster.xml:8778 16843#, no-c-format 16844msgid "ST_Max4ma" 16845msgstr "ST_Max4ma" 16846 16847#. Tag: refpurpose 16848#: reference_raster.xml:8779 16849#, no-c-format 16850msgid "" 16851"Raster processing function that calculates the maximum pixel value in a " 16852"neighborhood." 16853msgstr "" 16854 16855#. Tag: funcsynopsis 16856#: reference_raster.xml:8783 16857#, no-c-format 16858msgid "" 16859"<funcprototype> <funcdef>float8 <function>ST_Max4ma</function></funcdef> " 16860"<paramdef><type>float8[][]</type> <parameter>matrix</parameter></paramdef> " 16861"<paramdef><type>text</type> <parameter>nodatamode</parameter></paramdef> " 16862"<paramdef><type>text[]</type> <parameter>VARIADIC args</parameter></" 16863"paramdef> </funcprototype> <funcprototype> <funcdef>double precision " 16864"<function>ST_Max4ma</function></funcdef> <paramdef><type>double precision[][]" 16865"[]</type> <parameter>value</parameter></paramdef> <paramdef><type>integer[]" 16866"[] </type> <parameter>pos</parameter></paramdef> <paramdef><type>text[]</" 16867"type> <parameter>VARIADIC userargs</parameter></paramdef> </funcprototype>" 16868msgstr "" 16869 16870#. Tag: para 16871#: reference_raster.xml:8803 16872#, no-c-format 16873msgid "Calculate the maximum pixel value in a neighborhood of pixels." 16874msgstr "" 16875 16876#. Tag: para 16877#: reference_raster.xml:8805 reference_raster.xml:8880 16878#: reference_raster.xml:8965 reference_raster.xml:9090 16879#: reference_raster.xml:9236 16880#, no-c-format 16881msgid "" 16882"For Variant 2, a substitution value for NODATA pixels can be specified by " 16883"passing that value to userargs." 16884msgstr "" 16885 16886#. Tag: programlisting 16887#: reference_raster.xml:8832 16888#, fuzzy, no-c-format 16889msgid "" 16890"SELECT\n" 16891" rid,\n" 16892" st_value(\n" 16893" st_mapalgebrafctngb(rast, 1, NULL, 1, 1, 'st_max4ma(float[][],text," 16894"text[])'::regprocedure, 'ignore', NULL), 2, 2\n" 16895" )\n" 16896"FROM dummy_rast\n" 16897"WHERE rid = 2;\n" 16898" rid | st_value\n" 16899"-----+----------\n" 16900" 2 | 254\n" 16901"(1 row)" 16902msgstr "" 16903"SELECT \n" 16904" rid,\n" 16905" st_value(\n" 16906" st_mapalgebrafctngb(rast, 1, NULL, 1, 1, 'st_max4ma(float[][],text," 16907"text[])'::regprocedure, 'ignore', NULL), 2, 2\n" 16908" ) \n" 16909"FROM dummy_rast \n" 16910"WHERE rid = 2;\n" 16911" rid | st_value\n" 16912"-----+----------\n" 16913" 2 | 254\n" 16914"(1 row)" 16915 16916#. Tag: para 16917#: reference_raster.xml:8838 16918#, no-c-format 16919msgid "" 16920", <xref linkend=\"RT_ST_MapAlgebra\"/>, <xref linkend=\"RT_ST_Min4ma\"/>, " 16921"<xref linkend=\"RT_ST_Sum4ma\"/>, <xref linkend=\"RT_ST_Mean4ma\"/>, <xref " 16922"linkend=\"RT_ST_Range4ma\"/>, <xref linkend=\"RT_ST_Distinct4ma\"/>, <xref " 16923"linkend=\"RT_ST_StdDev4ma\"/>" 16924msgstr "" 16925 16926#. Tag: refname 16927#: reference_raster.xml:8853 16928#, no-c-format 16929msgid "ST_Mean4ma" 16930msgstr "ST_Mean4ma" 16931 16932#. Tag: refpurpose 16933#: reference_raster.xml:8854 16934#, no-c-format 16935msgid "" 16936"Raster processing function that calculates the mean pixel value in a " 16937"neighborhood." 16938msgstr "" 16939 16940#. Tag: funcsynopsis 16941#: reference_raster.xml:8858 16942#, no-c-format 16943msgid "" 16944"<funcprototype> <funcdef>float8 <function>ST_Mean4ma</function></funcdef> " 16945"<paramdef><type>float8[][]</type> <parameter>matrix</parameter></paramdef> " 16946"<paramdef><type>text</type> <parameter>nodatamode</parameter></paramdef> " 16947"<paramdef><type>text[]</type> <parameter>VARIADIC args</parameter></" 16948"paramdef> </funcprototype> <funcprototype> <funcdef>double precision " 16949"<function>ST_Mean4ma</function></funcdef> <paramdef><type>double precision[]" 16950"[][]</type> <parameter>value</parameter></paramdef> <paramdef><type>integer[]" 16951"[] </type> <parameter>pos</parameter></paramdef> <paramdef><type>text[]</" 16952"type> <parameter>VARIADIC userargs</parameter></paramdef> </funcprototype>" 16953msgstr "" 16954 16955#. Tag: para 16956#: reference_raster.xml:8878 16957#, no-c-format 16958msgid "Calculate the mean pixel value in a neighborhood of pixels." 16959msgstr "" 16960 16961#. Tag: programlisting 16962#: reference_raster.xml:8907 16963#, fuzzy, no-c-format 16964msgid "" 16965"SELECT\n" 16966" rid,\n" 16967" st_value(\n" 16968" st_mapalgebrafctngb(rast, 1, '32BF', 1, 1, 'st_mean4ma(float[][]," 16969"text,text[])'::regprocedure, 'ignore', NULL), 2, 2\n" 16970" )\n" 16971"FROM dummy_rast\n" 16972"WHERE rid = 2;\n" 16973" rid | st_value\n" 16974"-----+------------------\n" 16975" 2 | 253.222229003906\n" 16976"(1 row)" 16977msgstr "" 16978"SELECT \n" 16979" rid,\n" 16980" st_value(\n" 16981" st_mapalgebrafctngb(rast, 1, '32BF', 1, 1, 'st_mean4ma(float[][]," 16982"text,text[])'::regprocedure, 'ignore', NULL), 2, 2\n" 16983" ) \n" 16984"FROM dummy_rast \n" 16985"WHERE rid = 2;\n" 16986" rid | st_value\n" 16987"-----+------------------\n" 16988" 2 | 253.222229003906\n" 16989"(1 row)" 16990 16991#. Tag: programlisting 16992#: reference_raster.xml:8914 16993#, fuzzy, no-c-format 16994msgid "" 16995"SELECT\n" 16996" rid,\n" 16997" st_value(\n" 16998" ST_MapAlgebra(rast, 1, 'st_mean4ma(double precision[][][], " 16999"integer[][], text[])'::regprocedure,'32BF', 'FIRST', NULL, 1, 1)\n" 17000" , 2, 2)\n" 17001" FROM dummy_rast\n" 17002" WHERE rid = 2;\n" 17003" rid | st_value\n" 17004"-----+------------------\n" 17005" 2 | 253.222229003906\n" 17006"(1 row)" 17007msgstr "" 17008"SELECT \n" 17009" rid,\n" 17010" st_value(\n" 17011" st_mapalgebrafctngb(rast, 1, '32BF', 1, 1, 'st_mean4ma(float[][]," 17012"text,text[])'::regprocedure, 'ignore', NULL), 2, 2\n" 17013" ) \n" 17014"FROM dummy_rast \n" 17015"WHERE rid = 2;\n" 17016" rid | st_value\n" 17017"-----+------------------\n" 17018" 2 | 253.222229003906\n" 17019"(1 row)" 17020 17021#. Tag: para 17022#: reference_raster.xml:8920 17023#, no-c-format 17024msgid "" 17025", <xref linkend=\"RT_ST_MapAlgebra\"/>, <xref linkend=\"RT_ST_Min4ma\"/>, " 17026"<xref linkend=\"RT_ST_Max4ma\"/>, <xref linkend=\"RT_ST_Sum4ma\"/>, <xref " 17027"linkend=\"RT_ST_Range4ma\"/>, <xref linkend=\"RT_ST_StdDev4ma\"/>" 17028msgstr "" 17029 17030#. Tag: refname 17031#: reference_raster.xml:8934 17032#, no-c-format 17033msgid "ST_Min4ma" 17034msgstr "ST_Min4ma" 17035 17036#. Tag: refpurpose 17037#: reference_raster.xml:8935 17038#, no-c-format 17039msgid "" 17040"Raster processing function that calculates the minimum pixel value in a " 17041"neighborhood." 17042msgstr "" 17043 17044#. Tag: funcsynopsis 17045#: reference_raster.xml:8941 17046#, no-c-format 17047msgid "" 17048"<funcprototype> <funcdef>float8 <function>ST_Min4ma</function></funcdef> " 17049"<paramdef><type>float8[][]</type> <parameter>matrix</parameter></paramdef> " 17050"<paramdef><type>text </type> <parameter>nodatamode</parameter></paramdef> " 17051"<paramdef><type>text[]</type> <parameter>VARIADIC args</parameter></" 17052"paramdef> </funcprototype> <funcprototype> <funcdef>double precision " 17053"<function>ST_Min4ma</function></funcdef> <paramdef><type>double precision[][]" 17054"[]</type> <parameter>value</parameter></paramdef> <paramdef><type>integer[]" 17055"[] </type> <parameter>pos</parameter></paramdef> <paramdef><type>text[]</" 17056"type> <parameter>VARIADIC userargs</parameter></paramdef> </funcprototype>" 17057msgstr "" 17058 17059#. Tag: para 17060#: reference_raster.xml:8961 17061#, no-c-format 17062msgid "Calculate the minimum pixel value in a neighborhood of pixels." 17063msgstr "" 17064 17065#. Tag: programlisting 17066#: reference_raster.xml:8994 17067#, fuzzy, no-c-format 17068msgid "" 17069"SELECT\n" 17070" rid,\n" 17071" st_value(\n" 17072" st_mapalgebrafctngb(rast, 1, NULL, 1, 1, 'st_min4ma(float[][],text," 17073"text[])'::regprocedure, 'ignore', NULL), 2, 2\n" 17074" )\n" 17075"FROM dummy_rast\n" 17076"WHERE rid = 2;\n" 17077" rid | st_value\n" 17078"-----+----------\n" 17079" 2 | 250\n" 17080"(1 row)" 17081msgstr "" 17082"SELECT \n" 17083" rid,\n" 17084" st_value(\n" 17085" st_mapalgebrafctngb(rast, 1, NULL, 1, 1, 'st_min4ma(float[][],text," 17086"text[])'::regprocedure, 'ignore', NULL), 2, 2\n" 17087" ) \n" 17088"FROM dummy_rast \n" 17089"WHERE rid = 2;\n" 17090" rid | st_value\n" 17091"-----+----------\n" 17092" 2 | 250\n" 17093"(1 row)" 17094 17095#. Tag: para 17096#: reference_raster.xml:8999 17097#, no-c-format 17098msgid "" 17099", <xref linkend=\"RT_ST_MapAlgebra\"/>, <xref linkend=\"RT_ST_Max4ma\"/>, " 17100"<xref linkend=\"RT_ST_Sum4ma\"/>, <xref linkend=\"RT_ST_Mean4ma\"/>, <xref " 17101"linkend=\"RT_ST_Range4ma\"/>, <xref linkend=\"RT_ST_Distinct4ma\"/>, <xref " 17102"linkend=\"RT_ST_StdDev4ma\"/>" 17103msgstr "" 17104 17105#. Tag: refname 17106#: reference_raster.xml:9014 17107#, no-c-format 17108msgid "ST_MinDist4ma" 17109msgstr "ST_MinDist4ma" 17110 17111#. Tag: refpurpose 17112#: reference_raster.xml:9015 17113#, no-c-format 17114msgid "" 17115"Raster processing function that returns the minimum distance (in number of " 17116"pixels) between the pixel of interest and a neighboring pixel with value." 17117msgstr "" 17118 17119#. Tag: funcprototype 17120#: reference_raster.xml:9020 17121#, no-c-format 17122msgid "" 17123"<funcdef>double precision <function>ST_MinDist4ma</function></funcdef> " 17124"<paramdef><type>double precision[][][]</type> <parameter>value</parameter></" 17125"paramdef> <paramdef><type>integer[][]</type> <parameter>pos</parameter></" 17126"paramdef> <paramdef><type>text[]</type> <parameter>VARIADIC userargs</" 17127"parameter></paramdef>" 17128msgstr "" 17129 17130#. Tag: para 17131#: reference_raster.xml:9032 17132#, no-c-format 17133msgid "" 17134"Return the shortest distance (in number of pixels) between the pixel of " 17135"interest and the closest pixel with value in the neighborhood." 17136msgstr "" 17137 17138#. Tag: para 17139#: reference_raster.xml:9035 17140#, no-c-format 17141msgid "" 17142"The intent of this function is to provide an informative data point that " 17143"helps infer the usefulness of the pixel of interest's interpolated value " 17144"from <xref linkend=\"RT_ST_InvDistWeight4ma\"/>. This function is " 17145"particularly useful when the neighborhood is sparsely populated." 17146msgstr "" 17147 17148#. Tag: para 17149#: reference_raster.xml:9054 17150#, no-c-format 17151msgid ", <xref linkend=\"RT_ST_InvDistWeight4ma\"/>" 17152msgstr ", <xref linkend=\"RT_ST_InvDistWeight4ma\"/>" 17153 17154#. Tag: refname 17155#: reference_raster.xml:9063 17156#, no-c-format 17157msgid "ST_Range4ma" 17158msgstr "ST_Range4ma" 17159 17160#. Tag: refpurpose 17161#: reference_raster.xml:9064 17162#, no-c-format 17163msgid "" 17164"Raster processing function that calculates the range of pixel values in a " 17165"neighborhood." 17166msgstr "" 17167 17168#. Tag: funcsynopsis 17169#: reference_raster.xml:9068 17170#, no-c-format 17171msgid "" 17172"<funcprototype> <funcdef>float8 <function>ST_Range4ma</function></funcdef> " 17173"<paramdef><type>float8[][]</type> <parameter>matrix</parameter></paramdef> " 17174"<paramdef><type>text</type> <parameter>nodatamode</parameter></paramdef> " 17175"<paramdef><type>text[]</type> <parameter>VARIADIC args</parameter></" 17176"paramdef> </funcprototype> <funcprototype> <funcdef>double precision " 17177"<function>ST_Range4ma</function></funcdef> <paramdef><type>double precision[]" 17178"[][]</type> <parameter>value</parameter></paramdef> <paramdef><type>integer[]" 17179"[] </type> <parameter>pos</parameter></paramdef> <paramdef><type>text[]</" 17180"type> <parameter>VARIADIC userargs</parameter></paramdef> </funcprototype>" 17181msgstr "" 17182 17183#. Tag: para 17184#: reference_raster.xml:9088 17185#, no-c-format 17186msgid "Calculate the range of pixel values in a neighborhood of pixels." 17187msgstr "" 17188 17189#. Tag: programlisting 17190#: reference_raster.xml:9117 17191#, fuzzy, no-c-format 17192msgid "" 17193"SELECT\n" 17194" rid,\n" 17195" st_value(\n" 17196" st_mapalgebrafctngb(rast, 1, NULL, 1, 1, 'st_range4ma(float[][],text," 17197"text[])'::regprocedure, 'ignore', NULL), 2, 2\n" 17198" )\n" 17199"FROM dummy_rast\n" 17200"WHERE rid = 2;\n" 17201" rid | st_value\n" 17202"-----+----------\n" 17203" 2 | 4\n" 17204"(1 row)" 17205msgstr "" 17206"SELECT \n" 17207" rid,\n" 17208" st_value(\n" 17209" st_mapalgebrafctngb(rast, 1, NULL, 1, 1, 'st_range4ma(float[][],text," 17210"text[])'::regprocedure, 'ignore', NULL), 2, 2\n" 17211" ) \n" 17212"FROM dummy_rast \n" 17213"WHERE rid = 2;\n" 17214" rid | st_value\n" 17215"-----+----------\n" 17216" 2 | 4\n" 17217"(1 row)" 17218 17219#. Tag: refname 17220#: reference_raster.xml:9138 17221#, no-c-format 17222msgid "ST_StdDev4ma" 17223msgstr "ST_StdDev4ma" 17224 17225#. Tag: refpurpose 17226#: reference_raster.xml:9139 17227#, no-c-format 17228msgid "" 17229"Raster processing function that calculates the standard deviation of pixel " 17230"values in a neighborhood." 17231msgstr "" 17232 17233#. Tag: funcsynopsis 17234#: reference_raster.xml:9143 17235#, no-c-format 17236msgid "" 17237"<funcprototype> <funcdef>float8 <function>ST_StdDev4ma</function></funcdef> " 17238"<paramdef><type>float8[][]</type> <parameter>matrix</parameter></paramdef> " 17239"<paramdef><type>text </type> <parameter>nodatamode</parameter></paramdef> " 17240"<paramdef><type>text[]</type> <parameter>VARIADIC args</parameter></" 17241"paramdef> </funcprototype> <funcprototype> <funcdef>double precision " 17242"<function>ST_StdDev4ma</function></funcdef> <paramdef><type>double " 17243"precision[][][]</type> <parameter>value</parameter></paramdef> " 17244"<paramdef><type>integer[][] </type> <parameter>pos</parameter></paramdef> " 17245"<paramdef><type>text[]</type> <parameter>VARIADIC userargs</parameter></" 17246"paramdef> </funcprototype>" 17247msgstr "" 17248 17249#. Tag: para 17250#: reference_raster.xml:9163 17251#, no-c-format 17252msgid "" 17253"Calculate the standard deviation of pixel values in a neighborhood of pixels." 17254msgstr "" 17255 17256#. Tag: programlisting 17257#: reference_raster.xml:9188 17258#, fuzzy, no-c-format 17259msgid "" 17260"SELECT\n" 17261" rid,\n" 17262" st_value(\n" 17263" st_mapalgebrafctngb(rast, 1, '32BF', 1, 1, 'st_stddev4ma(float[][]," 17264"text,text[])'::regprocedure, 'ignore', NULL), 2, 2\n" 17265" )\n" 17266"FROM dummy_rast\n" 17267"WHERE rid = 2;\n" 17268" rid | st_value\n" 17269"-----+------------------\n" 17270" 2 | 1.30170822143555\n" 17271"(1 row)" 17272msgstr "" 17273"SELECT \n" 17274" rid,\n" 17275" st_value(\n" 17276" st_mapalgebrafctngb(rast, 1, '32BF', 1, 1, 'st_stddev4ma(float[][]," 17277"text,text[])'::regprocedure, 'ignore', NULL), 2, 2\n" 17278" ) \n" 17279"FROM dummy_rast \n" 17280"WHERE rid = 2;\n" 17281" rid | st_value\n" 17282"-----+------------------\n" 17283" 2 | 1.30170822143555\n" 17284"(1 row)" 17285 17286#. Tag: refname 17287#: reference_raster.xml:9209 17288#, no-c-format 17289msgid "ST_Sum4ma" 17290msgstr "ST_Sum4ma" 17291 17292#. Tag: refpurpose 17293#: reference_raster.xml:9210 17294#, no-c-format 17295msgid "" 17296"Raster processing function that calculates the sum of all pixel values in a " 17297"neighborhood." 17298msgstr "" 17299 17300#. Tag: funcsynopsis 17301#: reference_raster.xml:9214 17302#, no-c-format 17303msgid "" 17304"<funcprototype> <funcdef>float8 <function>ST_Sum4ma</function></funcdef> " 17305"<paramdef><type>float8[][]</type> <parameter>matrix</parameter></paramdef> " 17306"<paramdef><type>text</type> <parameter>nodatamode</parameter></paramdef> " 17307"<paramdef><type>text[]</type> <parameter>VARIADIC args</parameter></" 17308"paramdef> </funcprototype> <funcprototype> <funcdef>double precision " 17309"<function>ST_Sum4ma</function></funcdef> <paramdef><type>double precision[][]" 17310"[]</type> <parameter>value</parameter></paramdef> <paramdef><type>integer[]" 17311"[] </type> <parameter>pos</parameter></paramdef> <paramdef><type>text[]</" 17312"type> <parameter>VARIADIC userargs</parameter></paramdef> </funcprototype>" 17313msgstr "" 17314 17315#. Tag: para 17316#: reference_raster.xml:9234 17317#, no-c-format 17318msgid "Calculate the sum of all pixel values in a neighborhood of pixels." 17319msgstr "" 17320 17321#. Tag: programlisting 17322#: reference_raster.xml:9263 17323#, fuzzy, no-c-format 17324msgid "" 17325"SELECT\n" 17326" rid,\n" 17327" st_value(\n" 17328" st_mapalgebrafctngb(rast, 1, '32BF', 1, 1, 'st_sum4ma(float[][],text," 17329"text[])'::regprocedure, 'ignore', NULL), 2, 2\n" 17330" )\n" 17331"FROM dummy_rast\n" 17332"WHERE rid = 2;\n" 17333" rid | st_value\n" 17334"-----+----------\n" 17335" 2 | 2279\n" 17336"(1 row)" 17337msgstr "" 17338"SELECT \n" 17339" rid,\n" 17340" st_value(\n" 17341" st_mapalgebrafctngb(rast, 1, '32BF', 1, 1, 'st_sum4ma(float[][],text," 17342"text[])'::regprocedure, 'ignore', NULL), 2, 2\n" 17343" ) \n" 17344"FROM dummy_rast \n" 17345"WHERE rid = 2;\n" 17346" rid | st_value\n" 17347"-----+----------\n" 17348" 2 | 2279\n" 17349"(1 row)" 17350 17351#. Tag: para 17352#: reference_raster.xml:9269 17353#, no-c-format 17354msgid "" 17355", <xref linkend=\"RT_ST_MapAlgebra\"/>, <xref linkend=\"RT_ST_Min4ma\"/>, " 17356"<xref linkend=\"RT_ST_Max4ma\"/>, <xref linkend=\"RT_ST_Mean4ma\"/>, <xref " 17357"linkend=\"RT_ST_Range4ma\"/>, <xref linkend=\"RT_ST_Distinct4ma\"/>, <xref " 17358"linkend=\"RT_ST_StdDev4ma\"/>" 17359msgstr "" 17360 17361#. Tag: title 17362#: reference_raster.xml:9285 17363#, no-c-format 17364msgid "DEM (Elevation)" 17365msgstr "" 17366 17367#. Tag: refname 17368#: reference_raster.xml:9289 17369#, no-c-format 17370msgid "ST_Aspect" 17371msgstr "ST_Aspect" 17372 17373#. Tag: refpurpose 17374#: reference_raster.xml:9290 17375#, no-c-format 17376msgid "" 17377"Returns the aspect (in degrees by default) of an elevation raster band. " 17378"Useful for analyzing terrain." 17379msgstr "" 17380 17381#. Tag: funcsynopsis 17382#: reference_raster.xml:9293 17383#, no-c-format 17384msgid "" 17385"<funcprototype> <funcdef>raster <function>ST_Aspect</function></funcdef> " 17386"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 17387"<paramdef choice=\"opt\"><type>integer </type> <parameter>band=1</" 17388"parameter></paramdef> <paramdef choice=\"opt\"><type>text </type> " 17389"<parameter>pixeltype=32BF</parameter></paramdef> <paramdef choice=\"opt" 17390"\"><type>text </type> <parameter>units=DEGREES</parameter></paramdef> " 17391"<paramdef choice=\"opt\"><type>boolean </type> " 17392"<parameter>interpolate_nodata=FALSE</parameter></paramdef> </funcprototype> " 17393"<funcprototype> <funcdef>raster <function>ST_Aspect</function></funcdef> " 17394"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 17395"<paramdef><type>integer </type> <parameter>band</parameter></paramdef> " 17396"<paramdef><type>raster </type> <parameter>customextent</parameter></" 17397"paramdef> <paramdef choice=\"opt\"><type>text </type> " 17398"<parameter>pixeltype=32BF</parameter></paramdef> <paramdef choice=\"opt" 17399"\"><type>text </type> <parameter>units=DEGREES</parameter></paramdef> " 17400"<paramdef choice=\"opt\"><type>boolean </type> " 17401"<parameter>interpolate_nodata=FALSE</parameter></paramdef> </funcprototype>" 17402msgstr "" 17403 17404#. Tag: para 17405#: reference_raster.xml:9318 17406#, no-c-format 17407msgid "" 17408"Returns the aspect (in degrees by default) of an elevation raster band. " 17409"Utilizes map algebra and applies the aspect equation to neighboring pixels." 17410msgstr "" 17411 17412#. Tag: para 17413#: reference_raster.xml:9320 17414#, no-c-format 17415msgid "" 17416"<varname>units</varname> indicates the units of the aspect. Possible values " 17417"are: RADIANS, DEGREES (default)." 17418msgstr "" 17419 17420#. Tag: para 17421#: reference_raster.xml:9324 17422#, no-c-format 17423msgid "" 17424"When <varname>units</varname> = RADIANS, values are between 0 and 2 * pi " 17425"radians measured clockwise from North." 17426msgstr "" 17427 17428#. Tag: para 17429#: reference_raster.xml:9328 17430#, no-c-format 17431msgid "" 17432"When <varname>units</varname> = DEGREES, values are between 0 and 360 " 17433"degrees measured clockwise from North." 17434msgstr "" 17435 17436#. Tag: para 17437#: reference_raster.xml:9332 17438#, no-c-format 17439msgid "If slope of pixel is zero, aspect of pixel is -1." 17440msgstr "" 17441 17442#. Tag: para 17443#: reference_raster.xml:9337 17444#, no-c-format 17445msgid "" 17446"For more information about Slope, Aspect and Hillshade, please refer to " 17447"<ulink url=\"http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?" 17448"TopicName=How%20Hillshade%20works\">ESRI - How hillshade works</ulink> and " 17449"<ulink url=\"http://e2b.erdas.com/fieldguide/wwhelp/wwhimpl/common/html/" 17450"wwhelp.htm?context=FieldGuide&file=Aspect_Images.html\">ERDAS Field " 17451"Guide - Aspect Images</ulink>." 17452msgstr "" 17453 17454#. Tag: para 17455#: reference_raster.xml:9343 reference_raster.xml:9439 17456#, no-c-format 17457msgid "" 17458"Enhanced: 2.1.0 Uses ST_MapAlgebra() and added optional " 17459"<varname>interpolate_nodata</varname> function parameter" 17460msgstr "" 17461 17462#. Tag: para 17463#: reference_raster.xml:9344 reference_raster.xml:9568 17464#, no-c-format 17465msgid "" 17466"Changed: 2.1.0 In prior versions, return values were in radians. Now, return " 17467"values default to degrees" 17468msgstr "" 17469 17470#. Tag: programlisting 17471#: reference_raster.xml:9349 17472#, no-c-format 17473msgid "" 17474"WITH foo AS (\n" 17475" SELECT ST_SetValues(\n" 17476" ST_AddBand(ST_MakeEmptyRaster(5, 5, 0, 0, 1, -1, 0, 0, 0), " 17477"1, '32BF', 0, -9999),\n" 17478" 1, 1, 1, ARRAY[\n" 17479" [1, 1, 1, 1, 1],\n" 17480" [1, 2, 2, 2, 1],\n" 17481" [1, 2, 3, 2, 1],\n" 17482" [1, 2, 2, 2, 1],\n" 17483" [1, 1, 1, 1, 1]\n" 17484" ]::double precision[][]\n" 17485" ) AS rast\n" 17486")\n" 17487"SELECT\n" 17488" ST_DumpValues(ST_Aspect(rast, 1, '32BF'))\n" 17489"FROM foo\n" 17490"\n" 17491" st_dumpvalues\n" 17492"\n" 17493"------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n" 17494"----------------------------------\n" 17495" (1,\"{{315,341.565063476562,0,18.4349479675293,45}," 17496"{288.434936523438,315,0,45,71.5650482177734},{270,270,-1,90,90}," 17497"{251.565048217773,225,180,135,108.434951782227},{225,198.43495178\n" 17498"2227,180,161.565048217773,135}}\")\n" 17499"(1 row)" 17500msgstr "" 17501 17502#. Tag: para 17503#: reference_raster.xml:9355 reference_raster.xml:9452 17504#: reference_raster.xml:9580 17505#, no-c-format 17506msgid "" 17507"Complete example of tiles of a coverage. This query only works with " 17508"PostgreSQL 9.1 or higher." 17509msgstr "" 17510 17511#. Tag: programlisting 17512#: reference_raster.xml:9357 17513#, no-c-format 17514msgid "" 17515"WITH foo AS (\n" 17516" SELECT ST_Tile(\n" 17517" ST_SetValues(\n" 17518" ST_AddBand(\n" 17519" ST_MakeEmptyRaster(6, 6, 0, 0, 1, -1, 0, 0, " 17520"0),\n" 17521" 1, '32BF', 0, -9999\n" 17522" ),\n" 17523" 1, 1, 1, ARRAY[\n" 17524" [1, 1, 1, 1, 1, 1],\n" 17525" [1, 1, 1, 1, 2, 1],\n" 17526" [1, 2, 2, 3, 3, 1],\n" 17527" [1, 1, 3, 2, 1, 1],\n" 17528" [1, 2, 2, 1, 2, 1],\n" 17529" [1, 1, 1, 1, 1, 1]\n" 17530" ]::double precision[]\n" 17531" ),\n" 17532" 2, 2\n" 17533" ) AS rast\n" 17534")\n" 17535"SELECT\n" 17536" t1.rast,\n" 17537" ST_Aspect(ST_Union(t2.rast), 1, t1.rast)\n" 17538"FROM foo t1\n" 17539"CROSS JOIN foo t2\n" 17540"WHERE ST_Intersects(t1.rast, t2.rast)\n" 17541"GROUP BY t1.rast;" 17542msgstr "" 17543 17544#. Tag: para 17545#: reference_raster.xml:9362 17546#, no-c-format 17547msgid "" 17548", <xref linkend=\"RT_ST_TRI\"/>, <xref linkend=\"RT_ST_TPI\"/>, <xref " 17549"linkend=\"RT_ST_Roughness\"/>, <xref linkend=\"RT_ST_HillShade\"/>, <xref " 17550"linkend=\"RT_ST_Slope\"/>" 17551msgstr "" 17552 17553#. Tag: refname 17554#: reference_raster.xml:9375 17555#, no-c-format 17556msgid "ST_HillShade" 17557msgstr "ST_HillShade" 17558 17559#. Tag: refpurpose 17560#: reference_raster.xml:9376 17561#, no-c-format 17562msgid "" 17563"Returns the hypothetical illumination of an elevation raster band using " 17564"provided azimuth, altitude, brightness and scale inputs." 17565msgstr "" 17566 17567#. Tag: funcsynopsis 17568#: reference_raster.xml:9379 17569#, no-c-format 17570msgid "" 17571"<funcprototype> <funcdef>raster <function>ST_HillShade</function></funcdef> " 17572"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 17573"<paramdef choice=\"opt\"><type>integer </type> <parameter>band=1</" 17574"parameter></paramdef> <paramdef choice=\"opt\"><type>text </type> " 17575"<parameter>pixeltype=32BF</parameter></paramdef> <paramdef choice=\"opt" 17576"\"><type>double precision </type> <parameter>azimuth=315</parameter></" 17577"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 17578"<parameter>altitude=45</parameter></paramdef> <paramdef choice=\"opt" 17579"\"><type>double precision </type> <parameter>max_bright=255</parameter></" 17580"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 17581"<parameter>scale=1.0</parameter></paramdef> <paramdef choice=\"opt" 17582"\"><type>boolean </type> <parameter>interpolate_nodata=FALSE</parameter></" 17583"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 17584"<function>ST_HillShade</function></funcdef> <paramdef><type>raster </type> " 17585"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 17586"<parameter>band</parameter></paramdef> <paramdef><type>raster </type> " 17587"<parameter>customextent</parameter></paramdef> <paramdef choice=\"opt" 17588"\"><type>text </type> <parameter>pixeltype=32BF</parameter></paramdef> " 17589"<paramdef choice=\"opt\"><type>double precision </type> " 17590"<parameter>azimuth=315</parameter></paramdef> <paramdef choice=\"opt" 17591"\"><type>double precision </type> <parameter>altitude=45</parameter></" 17592"paramdef> <paramdef choice=\"opt\"><type>double precision </type> " 17593"<parameter>max_bright=255</parameter></paramdef> <paramdef choice=\"opt" 17594"\"><type>double precision </type> <parameter>scale=1.0</parameter></" 17595"paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 17596"<parameter>interpolate_nodata=FALSE</parameter></paramdef> </funcprototype>" 17597msgstr "" 17598 17599#. Tag: para 17600#: reference_raster.xml:9410 17601#, no-c-format 17602msgid "" 17603"Returns the hypothetical illumination of an elevation raster band using the " 17604"azimuth, altitude, brightness, and scale inputs. Utilizes map algebra and " 17605"applies the hill shade equation to neighboring pixels. Return pixel values " 17606"are between 0 and 255." 17607msgstr "" 17608 17609#. Tag: para 17610#: reference_raster.xml:9412 17611#, no-c-format 17612msgid "" 17613"<varname>azimuth</varname> is a value between 0 and 360 degrees measured " 17614"clockwise from North." 17615msgstr "" 17616 17617#. Tag: para 17618#: reference_raster.xml:9416 17619#, no-c-format 17620msgid "" 17621"<varname>altitude</varname> is a value between 0 and 90 degrees where 0 " 17622"degrees is at the horizon and 90 degrees is directly overhead." 17623msgstr "" 17624 17625#. Tag: para 17626#: reference_raster.xml:9420 17627#, no-c-format 17628msgid "" 17629"<varname>max_bright</varname> is a value between 0 and 255 with 0 as no " 17630"brightness and 255 as max brightness." 17631msgstr "" 17632 17633#. Tag: para 17634#: reference_raster.xml:9424 reference_raster.xml:9552 17635#, no-c-format 17636msgid "" 17637"<varname>scale</varname> is the ratio of vertical units to horizontal. For " 17638"Feet:LatLon use scale=370400, for Meters:LatLon use scale=111120." 17639msgstr "" 17640 17641#. Tag: para 17642#: reference_raster.xml:9428 17643#, no-c-format 17644msgid "" 17645"If <varname>interpolate_nodata</varname> is TRUE, values for NODATA pixels " 17646"from the input raster will be interpolated using <xref linkend=" 17647"\"RT_ST_InvDistWeight4ma\"/> before computing the hillshade illumination." 17648msgstr "" 17649 17650#. Tag: para 17651#: reference_raster.xml:9433 17652#, no-c-format 17653msgid "" 17654"For more information about Hillshade, please refer to <ulink url=\"http://" 17655"webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=How%20Hillshade" 17656"%20works\">How hillshade works</ulink>." 17657msgstr "" 17658 17659#. Tag: para 17660#: reference_raster.xml:9440 17661#, no-c-format 17662msgid "" 17663"Changed: 2.1.0 In prior versions, azimuth and altitude were expressed in " 17664"radians. Now, azimuth and altitude are expressed in degrees" 17665msgstr "" 17666 17667#. Tag: programlisting 17668#: reference_raster.xml:9446 17669#, no-c-format 17670msgid "" 17671"WITH foo AS (\n" 17672" SELECT ST_SetValues(\n" 17673" ST_AddBand(ST_MakeEmptyRaster(5, 5, 0, 0, 1, -1, 0, 0, 0), " 17674"1, '32BF', 0, -9999),\n" 17675" 1, 1, 1, ARRAY[\n" 17676" [1, 1, 1, 1, 1],\n" 17677" [1, 2, 2, 2, 1],\n" 17678" [1, 2, 3, 2, 1],\n" 17679" [1, 2, 2, 2, 1],\n" 17680" [1, 1, 1, 1, 1]\n" 17681" ]::double precision[][]\n" 17682" ) AS rast\n" 17683")\n" 17684"SELECT\n" 17685" ST_DumpValues(ST_Hillshade(rast, 1, '32BF'))\n" 17686"FROM foo\n" 17687"\n" 17688" st_dumpvalues\n" 17689"\n" 17690"------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n" 17691"-----------------------------------------------------------------------\n" 17692" (1,\"{{NULL,NULL,NULL,NULL,NULL}," 17693"{NULL,251.32763671875,220.749786376953,147.224319458008,NULL}," 17694"{NULL,220.749786376953,180.312225341797,67.7497863769531,NULL}," 17695"{NULL,147.224319458008\n" 17696",67.7497863769531,43.1210060119629,NULL},{NULL,NULL,NULL,NULL,NULL}}\")\n" 17697"(1 row)" 17698msgstr "" 17699 17700#. Tag: programlisting 17701#: reference_raster.xml:9454 17702#, no-c-format 17703msgid "" 17704"WITH foo AS (\n" 17705" SELECT ST_Tile(\n" 17706" ST_SetValues(\n" 17707" ST_AddBand(\n" 17708" ST_MakeEmptyRaster(6, 6, 0, 0, 1, -1, 0, 0, " 17709"0),\n" 17710" 1, '32BF', 0, -9999\n" 17711" ),\n" 17712" 1, 1, 1, ARRAY[\n" 17713" [1, 1, 1, 1, 1, 1],\n" 17714" [1, 1, 1, 1, 2, 1],\n" 17715" [1, 2, 2, 3, 3, 1],\n" 17716" [1, 1, 3, 2, 1, 1],\n" 17717" [1, 2, 2, 1, 2, 1],\n" 17718" [1, 1, 1, 1, 1, 1]\n" 17719" ]::double precision[]\n" 17720" ),\n" 17721" 2, 2\n" 17722" ) AS rast\n" 17723")\n" 17724"SELECT\n" 17725" t1.rast,\n" 17726" ST_Hillshade(ST_Union(t2.rast), 1, t1.rast)\n" 17727"FROM foo t1\n" 17728"CROSS JOIN foo t2\n" 17729"WHERE ST_Intersects(t1.rast, t2.rast)\n" 17730"GROUP BY t1.rast;" 17731msgstr "" 17732 17733#. Tag: para 17734#: reference_raster.xml:9459 17735#, no-c-format 17736msgid "" 17737", <xref linkend=\"RT_ST_TRI\"/>, <xref linkend=\"RT_ST_TPI\"/>, <xref " 17738"linkend=\"RT_ST_Roughness\"/>, <xref linkend=\"RT_ST_Aspect\"/>, <xref " 17739"linkend=\"RT_ST_Slope\"/>" 17740msgstr "" 17741 17742#. Tag: refname 17743#: reference_raster.xml:9472 17744#, no-c-format 17745msgid "ST_Roughness" 17746msgstr "" 17747 17748#. Tag: refpurpose 17749#: reference_raster.xml:9473 17750#, no-c-format 17751msgid "Returns a raster with the calculated \"roughness\" of a DEM." 17752msgstr "" 17753 17754#. Tag: funcprototype 17755#: reference_raster.xml:9478 17756#, no-c-format 17757msgid "" 17758"<funcdef>raster <function>ST_Roughness</function></funcdef> " 17759"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 17760"<paramdef><type>integer </type> <parameter>nband</parameter></paramdef> " 17761"<paramdef><type>raster </type> <parameter>customextent</parameter></" 17762"paramdef> <paramdef choice=\"opt\"><type>text </type> <parameter>pixeltype=" 17763"\"32BF\"</parameter> </paramdef> <paramdef choice=\"opt\"><type>boolean </" 17764"type> <parameter> interpolate_nodata=FALSE </parameter> </paramdef>" 17765msgstr "" 17766 17767#. Tag: para 17768#: reference_raster.xml:9491 17769#, no-c-format 17770msgid "" 17771"Calculates the \"roughness\" of a DEM, by subtracting the maximum from the " 17772"minimum for a given area." 17773msgstr "" 17774 17775#. Tag: programlisting 17776#: reference_raster.xml:9497 reference_raster.xml:9630 17777#: reference_raster.xml:9681 17778#, no-c-format 17779msgid "-- needs examples" 17780msgstr "" 17781 17782#. Tag: para 17783#: reference_raster.xml:9502 17784#, no-c-format 17785msgid "" 17786", <xref linkend=\"RT_ST_TRI\"/>, <xref linkend=\"RT_ST_TPI\"/>, <xref " 17787"linkend=\"RT_ST_Slope\"/>, <xref linkend=\"RT_ST_HillShade\"/>, <xref " 17788"linkend=\"RT_ST_Aspect\"/>" 17789msgstr "" 17790 17791#. Tag: refname 17792#: reference_raster.xml:9515 17793#, no-c-format 17794msgid "ST_Slope" 17795msgstr "ST_Slope" 17796 17797#. Tag: refpurpose 17798#: reference_raster.xml:9516 17799#, no-c-format 17800msgid "" 17801"Returns the slope (in degrees by default) of an elevation raster band. " 17802"Useful for analyzing terrain." 17803msgstr "" 17804 17805#. Tag: funcsynopsis 17806#: reference_raster.xml:9519 17807#, no-c-format 17808msgid "" 17809"<funcprototype> <funcdef>raster <function>ST_Slope</function></funcdef> " 17810"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 17811"<paramdef choice=\"opt\"><type>integer </type> <parameter>nband=1</" 17812"parameter></paramdef> <paramdef choice=\"opt\"><type>text </type> " 17813"<parameter>pixeltype=32BF</parameter></paramdef> <paramdef choice=\"opt" 17814"\"><type>text </type> <parameter>units=DEGREES</parameter></paramdef> " 17815"<paramdef choice=\"opt\"><type>double precision </type> " 17816"<parameter>scale=1.0</parameter></paramdef> <paramdef choice=\"opt" 17817"\"><type>boolean </type> <parameter>interpolate_nodata=FALSE</parameter></" 17818"paramdef> </funcprototype> <funcprototype> <funcdef>raster " 17819"<function>ST_Slope</function></funcdef> <paramdef><type>raster </type> " 17820"<parameter>rast</parameter></paramdef> <paramdef><type>integer </type> " 17821"<parameter>nband</parameter></paramdef> <paramdef><type>raster </type> " 17822"<parameter>customextent</parameter></paramdef> <paramdef choice=\"opt" 17823"\"><type>text </type> <parameter>pixeltype=32BF</parameter></paramdef> " 17824"<paramdef choice=\"opt\"><type>text </type> <parameter>units=DEGREES</" 17825"parameter></paramdef> <paramdef choice=\"opt\"><type>double precision </" 17826"type> <parameter>scale=1.0</parameter></paramdef> <paramdef choice=\"opt" 17827"\"><type>boolean </type> <parameter>interpolate_nodata=FALSE</parameter></" 17828"paramdef> </funcprototype>" 17829msgstr "" 17830 17831#. Tag: para 17832#: reference_raster.xml:9546 17833#, no-c-format 17834msgid "" 17835"Returns the slope (in degrees by default) of an elevation raster band. " 17836"Utilizes map algebra and applies the slope equation to neighboring pixels." 17837msgstr "" 17838 17839#. Tag: para 17840#: reference_raster.xml:9548 17841#, no-c-format 17842msgid "" 17843"<varname>units</varname> indicates the units of the slope. Possible values " 17844"are: RADIANS, DEGREES (default), PERCENT." 17845msgstr "" 17846 17847#. Tag: para 17848#: reference_raster.xml:9556 17849#, no-c-format 17850msgid "" 17851"If <varname>interpolate_nodata</varname> is TRUE, values for NODATA pixels " 17852"from the input raster will be interpolated using <xref linkend=" 17853"\"RT_ST_InvDistWeight4ma\"/> before computing the surface slope." 17854msgstr "" 17855 17856#. Tag: para 17857#: reference_raster.xml:9561 17858#, no-c-format 17859msgid "" 17860"For more information about Slope, Aspect and Hillshade, please refer to " 17861"<ulink url=\"http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?" 17862"TopicName=How%20Hillshade%20works\">ESRI - How hillshade works</ulink> and " 17863"<ulink url=\"http://e2b.erdas.com/fieldguide/wwhelp/wwhimpl/common/html/" 17864"wwhelp.htm?context=FieldGuide&file=Slope_Images.html\">ERDAS Field Guide " 17865"- Slope Images</ulink>." 17866msgstr "" 17867 17868#. Tag: para 17869#: reference_raster.xml:9567 17870#, no-c-format 17871msgid "" 17872"Enhanced: 2.1.0 Uses ST_MapAlgebra() and added optional <varname>units</" 17873"varname>, <varname>scale</varname>, <varname>interpolate_nodata</varname> " 17874"function parameters" 17875msgstr "" 17876 17877#. Tag: programlisting 17878#: reference_raster.xml:9574 17879#, no-c-format 17880msgid "" 17881"WITH foo AS (\n" 17882" SELECT ST_SetValues(\n" 17883" ST_AddBand(ST_MakeEmptyRaster(5, 5, 0, 0, 1, -1, 0, 0, 0), " 17884"1, '32BF', 0, -9999),\n" 17885" 1, 1, 1, ARRAY[\n" 17886" [1, 1, 1, 1, 1],\n" 17887" [1, 2, 2, 2, 1],\n" 17888" [1, 2, 3, 2, 1],\n" 17889" [1, 2, 2, 2, 1],\n" 17890" [1, 1, 1, 1, 1]\n" 17891" ]::double precision[][]\n" 17892" ) AS rast\n" 17893")\n" 17894"SELECT\n" 17895" ST_DumpValues(ST_Slope(rast, 1, '32BF'))\n" 17896"FROM foo\n" 17897"\n" 17898" st_dumpvalues\n" 17899"\n" 17900"------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n" 17901"------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n" 17902"---------------------------------------------------------------------\n" 17903" (1," 17904"\"{{10.0249881744385,21.5681285858154,26.5650520324707,21.5681285858154,10.0249881744385}," 17905"{21.5681285858154,35.2643890380859,36.8698959350586,35.2643890380859,21.5681285858154},\n" 17906"{26.5650520324707,36.8698959350586,0,36.8698959350586,26.5650520324707}," 17907"{21.5681285858154,35.2643890380859,36.8698959350586,35.2643890380859,21.5681285858154}," 17908"{10.0249881744385,21.\n" 17909"5681285858154,26.5650520324707,21.5681285858154,10.0249881744385}}\")\n" 17910"(1 row)" 17911msgstr "" 17912 17913#. Tag: programlisting 17914#: reference_raster.xml:9582 17915#, no-c-format 17916msgid "" 17917"WITH foo AS (\n" 17918" SELECT ST_Tile(\n" 17919" ST_SetValues(\n" 17920" ST_AddBand(\n" 17921" ST_MakeEmptyRaster(6, 6, 0, 0, 1, -1, 0, 0, " 17922"0),\n" 17923" 1, '32BF', 0, -9999\n" 17924" ),\n" 17925" 1, 1, 1, ARRAY[\n" 17926" [1, 1, 1, 1, 1, 1],\n" 17927" [1, 1, 1, 1, 2, 1],\n" 17928" [1, 2, 2, 3, 3, 1],\n" 17929" [1, 1, 3, 2, 1, 1],\n" 17930" [1, 2, 2, 1, 2, 1],\n" 17931" [1, 1, 1, 1, 1, 1]\n" 17932" ]::double precision[]\n" 17933" ),\n" 17934" 2, 2\n" 17935" ) AS rast\n" 17936")\n" 17937"SELECT\n" 17938" t1.rast,\n" 17939" ST_Slope(ST_Union(t2.rast), 1, t1.rast)\n" 17940"FROM foo t1\n" 17941"CROSS JOIN foo t2\n" 17942"WHERE ST_Intersects(t1.rast, t2.rast)\n" 17943"GROUP BY t1.rast;" 17944msgstr "" 17945 17946#. Tag: para 17947#: reference_raster.xml:9587 17948#, no-c-format 17949msgid "" 17950", <xref linkend=\"RT_ST_TRI\"/>, <xref linkend=\"RT_ST_TPI\"/>, <xref " 17951"linkend=\"RT_ST_Roughness\"/>, <xref linkend=\"RT_ST_HillShade\"/>, <xref " 17952"linkend=\"RT_ST_Aspect\"/>" 17953msgstr "" 17954 17955#. Tag: refname 17956#: reference_raster.xml:9600 17957#, no-c-format 17958msgid "ST_TPI" 17959msgstr "" 17960 17961#. Tag: refpurpose 17962#: reference_raster.xml:9601 17963#, no-c-format 17964msgid "Returns a raster with the calculated Topographic Position Index." 17965msgstr "" 17966 17967#. Tag: funcprototype 17968#: reference_raster.xml:9606 17969#, no-c-format 17970msgid "" 17971"<funcdef>raster <function>ST_TPI</function></funcdef> <paramdef><type>raster " 17972"</type> <parameter>rast</parameter></paramdef> <paramdef><type>integer </" 17973"type> <parameter>nband</parameter></paramdef> <paramdef><type>raster </type> " 17974"<parameter>customextent</parameter></paramdef> <paramdef choice=\"opt" 17975"\"><type>text </type> <parameter>pixeltype=\"32BF\"</parameter> </paramdef> " 17976"<paramdef choice=\"opt\"><type>boolean </type> <parameter> " 17977"interpolate_nodata=FALSE </parameter> </paramdef>" 17978msgstr "" 17979 17980#. Tag: para 17981#: reference_raster.xml:9620 17982#, no-c-format 17983msgid "" 17984"Calculates the Topographic Position Index, which is defined as the focal " 17985"mean with radius of one minus the center cell." 17986msgstr "" 17987 17988#. Tag: para 17989#: reference_raster.xml:9623 reference_raster.xml:9673 17990#, no-c-format 17991msgid "This function only supports a focalmean radius of one." 17992msgstr "" 17993 17994#. Tag: para 17995#: reference_raster.xml:9635 17996#, no-c-format 17997msgid "" 17998", <xref linkend=\"RT_ST_TRI\"/>, <xref linkend=\"RT_ST_Roughness\"/>, <xref " 17999"linkend=\"RT_ST_Slope\"/>, <xref linkend=\"RT_ST_HillShade\"/>, <xref " 18000"linkend=\"RT_ST_Aspect\"/>" 18001msgstr "" 18002 18003#. Tag: refname 18004#: reference_raster.xml:9648 18005#, no-c-format 18006msgid "ST_TRI" 18007msgstr "" 18008 18009#. Tag: refpurpose 18010#: reference_raster.xml:9649 18011#, no-c-format 18012msgid "Returns a raster with the calculated Terrain Ruggedness Index." 18013msgstr "" 18014 18015#. Tag: funcprototype 18016#: reference_raster.xml:9654 18017#, no-c-format 18018msgid "" 18019"<funcdef>raster <function>ST_TRI</function></funcdef> <paramdef><type>raster " 18020"</type> <parameter>rast</parameter></paramdef> <paramdef><type>integer </" 18021"type> <parameter>nband</parameter></paramdef> <paramdef><type>raster </type> " 18022"<parameter>customextent</parameter></paramdef> <paramdef choice=\"opt" 18023"\"><type>text </type> <parameter>pixeltype=\"32BF\"</parameter> </paramdef> " 18024"<paramdef choice=\"opt\"><type>boolean </type> <parameter> " 18025"interpolate_nodata=FALSE </parameter> </paramdef>" 18026msgstr "" 18027 18028#. Tag: para 18029#: reference_raster.xml:9668 18030#, no-c-format 18031msgid "" 18032"Terrain Ruggedness Index is calculated by comparing a central pixel with its " 18033"neighbors, taking the absolute values of the differences, and averaging the " 18034"result." 18035msgstr "" 18036 18037#. Tag: para 18038#: reference_raster.xml:9686 18039#, no-c-format 18040msgid "" 18041", <xref linkend=\"RT_ST_Roughness\"/>, <xref linkend=\"RT_ST_TPI\"/>, <xref " 18042"linkend=\"RT_ST_Slope\"/>, <xref linkend=\"RT_ST_HillShade\"/>, <xref " 18043"linkend=\"RT_ST_Aspect\"/>" 18044msgstr "" 18045 18046#. Tag: title 18047#: reference_raster.xml:9700 18048#, no-c-format 18049msgid "Raster to Geometry" 18050msgstr "" 18051 18052#. Tag: refname 18053#: reference_raster.xml:9704 18054#, no-c-format 18055msgid "Box3D" 18056msgstr "Box3D" 18057 18058#. Tag: refpurpose 18059#: reference_raster.xml:9705 18060#, no-c-format 18061msgid "Returns the box 3d representation of the enclosing box of the raster." 18062msgstr "" 18063 18064#. Tag: funcprototype 18065#: reference_raster.xml:9710 18066#, no-c-format 18067msgid "" 18068"<funcdef>box3d <function>Box3D</function></funcdef> <paramdef><type>raster </" 18069"type> <parameter>rast</parameter></paramdef>" 18070msgstr "" 18071"<funcdef>box3d <function>Box3D</function></funcdef> <paramdef><type>raster </" 18072"type> <parameter>rast</parameter></paramdef>" 18073 18074#. Tag: para 18075#: reference_raster.xml:9720 18076#, no-c-format 18077msgid "Returns the box representing the extent of the raster." 18078msgstr "" 18079 18080#. Tag: para 18081#: reference_raster.xml:9721 18082#, no-c-format 18083msgid "" 18084"The polygon is defined by the corner points of the bounding box " 18085"((<varname>MINX</varname>, <varname>MINY</varname>), (<varname>MAXX</" 18086"varname>, <varname>MAXY</varname>))" 18087msgstr "" 18088 18089#. Tag: para 18090#: reference_raster.xml:9725 18091#, no-c-format 18092msgid "" 18093"Changed: 2.0.0 In pre-2.0 versions, there used to be a box2d instead of " 18094"box3d. Since box2d is a deprecated type, this was changed to box3d." 18095msgstr "" 18096 18097#. Tag: programlisting 18098#: reference_raster.xml:9731 18099#, no-c-format 18100msgid "" 18101"SELECT\n" 18102" rid,\n" 18103" Box3D(rast) AS rastbox\n" 18104"FROM dummy_rast;\n" 18105"\n" 18106"rid | rastbox\n" 18107"----+-------------------------------------------------\n" 18108"1 | BOX3D(0.5 0.5 0,20.5 60.5 0)\n" 18109"2 | BOX3D(3427927.75 5793243.5 0,3427928 5793244 0)" 18110msgstr "" 18111 18112#. Tag: refname 18113#: reference_raster.xml:9744 18114#, no-c-format 18115msgid "ST_ConvexHull" 18116msgstr "ST_ConvexHull" 18117 18118#. Tag: refpurpose 18119#: reference_raster.xml:9745 18120#, no-c-format 18121msgid "" 18122"Return the convex hull geometry of the raster including pixel values equal " 18123"to BandNoDataValue. For regular shaped and non-skewed rasters, this gives " 18124"the same result as ST_Envelope so only useful for irregularly shaped or " 18125"skewed rasters." 18126msgstr "" 18127 18128#. Tag: funcprototype 18129#: reference_raster.xml:9752 18130#, no-c-format 18131msgid "" 18132"<funcdef>geometry <function>ST_ConvexHull</function></funcdef> " 18133"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 18134msgstr "" 18135"<funcdef>geometry <function>ST_ConvexHull</function></funcdef> " 18136"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 18137 18138#. Tag: para 18139#: reference_raster.xml:9762 18140#, no-c-format 18141msgid "" 18142"Return the convex hull geometry of the raster including the NoDataBandValue " 18143"band pixels. For regular shaped and non-skewed rasters, this gives more or " 18144"less the same result as ST_Envelope so only useful for irregularly shaped or " 18145"skewed rasters." 18146msgstr "" 18147 18148#. Tag: para 18149#: reference_raster.xml:9766 18150#, no-c-format 18151msgid "" 18152"ST_Envelope floors the coordinates and hence add a little buffer around the " 18153"raster so the answer is subtly different from ST_ConvexHull which does not " 18154"floor." 18155msgstr "" 18156 18157#. Tag: para 18158#: reference_raster.xml:9773 18159#, no-c-format 18160msgid "" 18161"Refer to <ulink url=\"http://trac.osgeo.org/postgis/wiki/WKTRaster/" 18162"SpecificationWorking01\">PostGIS Raster Specification</ulink> for a diagram " 18163"of this." 18164msgstr "" 18165 18166#. Tag: programlisting 18167#: reference_raster.xml:9774 18168#, fuzzy, no-c-format 18169msgid "" 18170"-- Note envelope and convexhull are more or less the same\n" 18171"SELECT ST_AsText(ST_ConvexHull(rast)) As convhull,\n" 18172" ST_AsText(ST_Envelope(rast)) As env\n" 18173"FROM dummy_rast WHERE rid=1;\n" 18174"\n" 18175" convhull | " 18176"env\n" 18177"--------------------------------------------------------" 18178"+------------------------------------\n" 18179" POLYGON((0.5 0.5,20.5 0.5,20.5 60.5,0.5 60.5,0.5 0.5)) | POLYGON((0 0,20 " 18180"0,20 60,0 60,0 0))" 18181msgstr "" 18182"SELECT rid, ST_AsText(ST_Envelope(rast)) As envgeomwkt\n" 18183"FROM dummy_rast;\n" 18184"\n" 18185" rid | envgeomwkt\n" 18186"-----+--------------------------------------------------------------------\n" 18187" 1 | POLYGON((0 0,20 0,20 60,0 60,0 0))\n" 18188" 2 | POLYGON((3427927 5793243,3427928 5793243,\n" 18189" 3427928 5793244,3427927 5793244, 3427927 5793243))" 18190 18191#. Tag: programlisting 18192#: reference_raster.xml:9775 18193#, no-c-format 18194msgid "" 18195"-- now we skew the raster\n" 18196"-- note how the convex hull and envelope are now different\n" 18197"SELECT ST_AsText(ST_ConvexHull(rast)) As convhull,\n" 18198" ST_AsText(ST_Envelope(rast)) As env\n" 18199"FROM (SELECT ST_SetRotation(rast, 0.1, 0.1) As rast\n" 18200" FROM dummy_rast WHERE rid=1) As foo;\n" 18201"\n" 18202" convhull | " 18203"env\n" 18204"--------------------------------------------------------" 18205"+------------------------------------\n" 18206" POLYGON((0.5 0.5,20.5 1.5,22.5 61.5,2.5 60.5,0.5 0.5)) | POLYGON((0 0,22 " 18207"0,22 61,0 61,0 0))" 18208msgstr "" 18209 18210#. Tag: para 18211#: reference_raster.xml:9781 18212#, no-c-format 18213msgid "" 18214", <xref linkend=\"RT_ST_MinConvexHull\"/>, <xref linkend=\"ST_ConvexHull\"/" 18215">, <xref linkend=\"ST_AsText\"/>" 18216msgstr "" 18217 18218#. Tag: refname 18219#: reference_raster.xml:9792 18220#, no-c-format 18221msgid "ST_DumpAsPolygons" 18222msgstr "ST_DumpAsPolygons" 18223 18224#. Tag: refpurpose 18225#: reference_raster.xml:9793 18226#, no-c-format 18227msgid "" 18228"Returns a set of geomval (geom,val) rows, from a given raster band. If no " 18229"band number is specified, band num defaults to 1." 18230msgstr "" 18231 18232#. Tag: funcprototype 18233#: reference_raster.xml:9798 18234#, no-c-format 18235msgid "" 18236"<funcdef>setof geomval <function>ST_DumpAsPolygons</function></funcdef> " 18237"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 18238"<paramdef choice=\"opt\"><type>integer </type> <parameter>band_num=1</" 18239"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 18240"<parameter>exclude_nodata_value=TRUE</parameter></paramdef>" 18241msgstr "" 18242"<funcdef>setof geomval <function>ST_DumpAsPolygons</function></funcdef> " 18243"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 18244"<paramdef choice=\"opt\"><type>integer </type> <parameter>band_num=1</" 18245"parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 18246"<parameter>exclude_nodata_value=TRUE</parameter></paramdef>" 18247 18248#. Tag: para 18249#: reference_raster.xml:9809 18250#, no-c-format 18251msgid "" 18252"This is a set-returning function (SRF). It returns a set of geomval rows, " 18253"formed by a geometry (geom) and a pixel band value (val). Each polygon is " 18254"the union of all pixels for that band that have the same pixel value denoted " 18255"by val." 18256msgstr "" 18257 18258#. Tag: para 18259#: reference_raster.xml:9813 18260#, no-c-format 18261msgid "" 18262"ST_DumpAsPolygon is useful for polygonizing rasters. It is the reverse of a " 18263"GROUP BY in that it creates new rows. For example it can be used to expand a " 18264"single raster into multiple POLYGONS/MULTIPOLYGONS." 18265msgstr "" 18266 18267#. Tag: para 18268#: reference_raster.xml:9817 18269#, no-c-format 18270msgid "Availability: Requires GDAL 1.7 or higher." 18271msgstr "" 18272 18273#. Tag: para 18274#: reference_raster.xml:9818 18275#, no-c-format 18276msgid "" 18277"If there is a no data value set for a band, pixels with that value will not " 18278"be returned except in the case of exclude_nodata_value=false." 18279msgstr "" 18280 18281#. Tag: para 18282#: reference_raster.xml:9819 18283#, no-c-format 18284msgid "" 18285"If you only care about count of pixels with a given value in a raster, it is " 18286"faster to use <xref linkend=\"RT_ST_ValueCount\"/>." 18287msgstr "" 18288 18289#. Tag: para 18290#: reference_raster.xml:9821 18291#, no-c-format 18292msgid "" 18293"This is different than ST_PixelAsPolygons where one geometry is returned for " 18294"each pixel regardless of pixel value." 18295msgstr "" 18296 18297#. Tag: programlisting 18298#: reference_raster.xml:9829 18299#, fuzzy, no-c-format 18300msgid "" 18301"-- this syntax requires PostgreSQL 9.3+\n" 18302"SELECT val, ST_AsText(geom) As geomwkt\n" 18303"FROM (\n" 18304"SELECT dp.*\n" 18305"FROM dummy_rast, LATERAL ST_DumpAsPolygons(rast) AS dp\n" 18306"WHERE rid = 2\n" 18307") As foo\n" 18308"WHERE val BETWEEN 249 and 251\n" 18309"ORDER BY val;\n" 18310"\n" 18311" val | geomwkt\n" 18312"-----" 18313"+--------------------------------------------------------------------------\n" 18314" 249 | POLYGON((3427927.95 5793243.95,3427927.95 5793243.85,3427928 " 18315"5793243.85,\n" 18316" 3427928 5793243.95,3427927.95 5793243.95))\n" 18317" 250 | POLYGON((3427927.75 5793243.9,3427927.75 5793243.85,3427927.8 " 18318"5793243.85,\n" 18319" 3427927.8 5793243.9,3427927.75 5793243.9))\n" 18320" 250 | POLYGON((3427927.8 5793243.8,3427927.8 5793243.75,3427927.85 " 18321"5793243.75,\n" 18322" 3427927.85 5793243.8, 3427927.8 5793243.8))\n" 18323" 251 | POLYGON((3427927.75 5793243.85,3427927.75 5793243.8,3427927.8 " 18324"5793243.8,\n" 18325" 3427927.8 5793243.85,3427927.75 5793243.85))" 18326msgstr "" 18327"SELECT val, ST_AsText(geom) As geomwkt\n" 18328"FROM (\n" 18329"SELECT (ST_DumpAsPolygons(rast)).*\n" 18330"FROM dummy_rast \n" 18331"WHERE rid = 2\n" 18332") As foo\n" 18333"WHERE val BETWEEN 249 and 251\n" 18334"ORDER BY val;\n" 18335"\n" 18336" val | geomwkt\n" 18337"-----" 18338"+--------------------------------------------------------------------------\n" 18339" 249 | POLYGON((3427927.95 5793243.95,3427927.95 5793243.85,3427928 " 18340"5793243.85,\n" 18341" 3427928 5793243.95,3427927.95 5793243.95))\n" 18342" 250 | POLYGON((3427927.75 5793243.9,3427927.75 5793243.85,3427927.8 " 18343"5793243.85,\n" 18344" 3427927.8 5793243.9,3427927.75 5793243.9))\n" 18345" 250 | POLYGON((3427927.8 5793243.8,3427927.8 5793243.75,3427927.85 " 18346"5793243.75,\n" 18347" 3427927.85 5793243.8, 3427927.8 5793243.8))\n" 18348" 251 | POLYGON((3427927.75 5793243.85,3427927.75 5793243.8,3427927.8 " 18349"5793243.8,\n" 18350" 3427927.8 5793243.85,3427927.75 5793243.85))" 18351 18352#. Tag: para 18353#: reference_raster.xml:9834 18354#, no-c-format 18355msgid "" 18356", <xref linkend=\"RT_ST_Value\"/>, <xref linkend=\"RT_ST_Polygon\"/>, <xref " 18357"linkend=\"RT_ST_ValueCount\"/>" 18358msgstr "" 18359", <xref linkend=\"RT_ST_Value\"/>, <xref linkend=\"RT_ST_Polygon\"/>, <xref " 18360"linkend=\"RT_ST_ValueCount\"/>" 18361 18362#. Tag: refname 18363#: reference_raster.xml:9845 18364#, no-c-format 18365msgid "ST_Envelope" 18366msgstr "ST_Envelope" 18367 18368#. Tag: refpurpose 18369#: reference_raster.xml:9846 18370#, no-c-format 18371msgid "Returns the polygon representation of the extent of the raster." 18372msgstr "" 18373 18374#. Tag: funcprototype 18375#: reference_raster.xml:9851 18376#, no-c-format 18377msgid "" 18378"<funcdef>geometry <function>ST_Envelope</function></funcdef> " 18379"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 18380msgstr "" 18381"<funcdef>geometry <function>ST_Envelope</function></funcdef> " 18382"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef>" 18383 18384#. Tag: para 18385#: reference_raster.xml:9861 18386#, no-c-format 18387msgid "" 18388"Returns the polygon representation of the extent of the raster in spatial " 18389"coordinate units defined by srid. It is a float8 minimum bounding box " 18390"represented as a polygon." 18391msgstr "" 18392 18393#. Tag: para 18394#: reference_raster.xml:9863 18395#, no-c-format 18396msgid "" 18397"The polygon is defined by the corner points of the bounding box " 18398"((<varname>MINX</varname>, <varname>MINY</varname>), (<varname>MINX</" 18399"varname>, <varname>MAXY</varname>), (<varname>MAXX</varname>, <varname>MAXY</" 18400"varname>), (<varname>MAXX</varname>, <varname>MINY</varname>), " 18401"(<varname>MINX</varname>, <varname>MINY</varname>))" 18402msgstr "" 18403 18404#. Tag: programlisting 18405#: reference_raster.xml:9875 18406#, fuzzy, no-c-format 18407msgid "" 18408"SELECT rid, ST_AsText(ST_Envelope(rast)) As envgeomwkt\n" 18409"FROM dummy_rast;\n" 18410"\n" 18411" rid | envgeomwkt\n" 18412"-----+--------------------------------------------------------------------\n" 18413" 1 | POLYGON((0 0,20 0,20 60,0 60,0 0))\n" 18414" 2 | POLYGON((3427927 5793243,3427928 5793243,\n" 18415" 3427928 5793244,3427927 5793244, 3427927 5793243))" 18416msgstr "" 18417"SELECT rid, ST_AsText(ST_Envelope(rast)) As envgeomwkt\n" 18418"FROM dummy_rast;\n" 18419"\n" 18420" rid | envgeomwkt\n" 18421"-----+--------------------------------------------------------------------\n" 18422" 1 | POLYGON((0 0,20 0,20 60,0 60,0 0))\n" 18423" 2 | POLYGON((3427927 5793243,3427928 5793243,\n" 18424" 3427928 5793244,3427927 5793244, 3427927 5793243))" 18425 18426#. Tag: para 18427#: reference_raster.xml:9880 18428#, no-c-format 18429msgid ", <xref linkend=\"ST_AsText\"/>, <xref linkend=\"RT_ST_SRID\"/>" 18430msgstr ", <xref linkend=\"ST_AsText\"/>, <xref linkend=\"RT_ST_SRID\"/>" 18431 18432#. Tag: refname 18433#: reference_raster.xml:9890 18434#, no-c-format 18435msgid "ST_MinConvexHull" 18436msgstr "" 18437 18438#. Tag: refpurpose 18439#: reference_raster.xml:9891 18440#, no-c-format 18441msgid "Return the convex hull geometry of the raster excluding NODATA pixels." 18442msgstr "" 18443 18444#. Tag: funcprototype 18445#: reference_raster.xml:9898 18446#, no-c-format 18447msgid "" 18448"<funcdef>geometry <function>ST_MinConvexHull</function></funcdef> " 18449"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 18450"<paramdef choice=\"opt\"><type>integer </type> <parameter>nband=NULL</" 18451"parameter></paramdef>" 18452msgstr "" 18453 18454#. Tag: para 18455#: reference_raster.xml:9909 18456#, no-c-format 18457msgid "" 18458"Return the convex hull geometry of the raster excluding NODATA pixels. If " 18459"<varname>nband</varname> is NULL, all bands of the raster are considered." 18460msgstr "" 18461 18462#. Tag: programlisting 18463#: reference_raster.xml:9918 18464#, no-c-format 18465msgid "" 18466"WITH foo AS (\n" 18467" SELECT\n" 18468" ST_SetValues(\n" 18469" ST_SetValues(\n" 18470" ST_AddBand(ST_AddBand(ST_MakeEmptyRaster(9, " 18471"9, 0, 0, 1, -1, 0, 0, 0), 1, '8BUI', 0, 0), 2, '8BUI', 1, 0),\n" 18472" 1, 1, 1,\n" 18473" ARRAY[\n" 18474" [0, 0, 0, 0, 0, 0, 0, 0, 0],\n" 18475" [0, 0, 0, 0, 0, 0, 0, 0, 0],\n" 18476" [0, 0, 0, 0, 0, 0, 0, 0, 0],\n" 18477" [0, 0, 0, 1, 0, 0, 0, 0, 1],\n" 18478" [0, 0, 0, 1, 1, 0, 0, 0, 0],\n" 18479" [0, 0, 0, 1, 0, 0, 0, 0, 0],\n" 18480" [0, 0, 0, 0, 0, 0, 0, 0, 0],\n" 18481" [0, 0, 0, 0, 0, 0, 0, 0, 0],\n" 18482" [0, 0, 0, 0, 0, 0, 0, 0, 0]\n" 18483" ]::double precision[][]\n" 18484" ),\n" 18485" 2, 1, 1,\n" 18486" ARRAY[\n" 18487" [0, 0, 0, 0, 0, 0, 0, 0, 0],\n" 18488" [0, 0, 0, 0, 0, 0, 0, 0, 0],\n" 18489" [0, 0, 0, 0, 0, 0, 0, 0, 0],\n" 18490" [1, 0, 0, 0, 0, 1, 0, 0, 0],\n" 18491" [0, 0, 0, 0, 1, 1, 0, 0, 0],\n" 18492" [0, 0, 0, 0, 0, 1, 0, 0, 0],\n" 18493" [0, 0, 0, 0, 0, 0, 0, 0, 0],\n" 18494" [0, 0, 0, 0, 0, 0, 0, 0, 0],\n" 18495" [0, 0, 1, 0, 0, 0, 0, 0, 0]\n" 18496" ]::double precision[][]\n" 18497" ) AS rast\n" 18498")\n" 18499"SELECT\n" 18500" ST_AsText(ST_ConvexHull(rast)) AS hull,\n" 18501" ST_AsText(ST_MinConvexHull(rast)) AS mhull,\n" 18502" ST_AsText(ST_MinConvexHull(rast, 1)) AS mhull_1,\n" 18503" ST_AsText(ST_MinConvexHull(rast, 2)) AS mhull_2\n" 18504"FROM foo\n" 18505"\n" 18506" hull | mhull " 18507"| mhull_1 | mhull_2\n" 18508"----------------------------------+-------------------------------------" 18509"+-------------------------------------" 18510"+-------------------------------------\n" 18511" POLYGON((0 0,9 0,9 -9,0 -9,0 0)) | POLYGON((0 -3,9 -3,9 -9,0 -9,0 -3)) | " 18512"POLYGON((3 -3,9 -3,9 -6,3 -6,3 -3)) | POLYGON((0 -3,6 -3,6 -9,0 -9,0 -3))" 18513msgstr "" 18514 18515#. Tag: para 18516#: reference_raster.xml:9923 18517#, no-c-format 18518msgid "" 18519", <xref linkend=\"RT_ST_ConvexHull\"/>, <xref linkend=\"ST_ConvexHull\"/>, " 18520"<xref linkend=\"ST_AsText\"/>" 18521msgstr "" 18522 18523#. Tag: refname 18524#: reference_raster.xml:9934 18525#, no-c-format 18526msgid "ST_Polygon" 18527msgstr "ST_Polygon" 18528 18529#. Tag: refpurpose 18530#: reference_raster.xml:9935 18531#, no-c-format 18532msgid "" 18533"Returns a multipolygon geometry formed by the union of pixels that have a " 18534"pixel value that is not no data value. If no band number is specified, band " 18535"num defaults to 1." 18536msgstr "" 18537 18538#. Tag: funcprototype 18539#: reference_raster.xml:9940 18540#, no-c-format 18541msgid "" 18542"<funcdef>geometry <function>ST_Polygon</function></funcdef> " 18543"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 18544"<paramdef choice=\"opt\"><type>integer </type> <parameter>band_num=1</" 18545"parameter></paramdef>" 18546msgstr "" 18547"<funcdef>geometry <function>ST_Polygon</function></funcdef> " 18548"<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 18549"<paramdef choice=\"opt\"><type>integer </type> <parameter>band_num=1</" 18550"parameter></paramdef>" 18551 18552#. Tag: para 18553#: reference_raster.xml:9950 18554#, no-c-format 18555msgid "Availability: 0.1.6 Requires GDAL 1.7 or higher." 18556msgstr "" 18557 18558#. Tag: para 18559#: reference_raster.xml:9951 18560#, no-c-format 18561msgid "" 18562"Enhanced: 2.1.0 Improved Speed (fully C-Based) and the returning " 18563"multipolygon is ensured to be valid." 18564msgstr "" 18565 18566#. Tag: para 18567#: reference_raster.xml:9952 18568#, no-c-format 18569msgid "" 18570"Changed: 2.1.0 In prior versions would sometimes return a polygon, changed " 18571"to always return multipolygon." 18572msgstr "" 18573 18574#. Tag: programlisting 18575#: reference_raster.xml:9957 18576#, no-c-format 18577msgid "" 18578"-- by default no data band value is 0 or not set, so polygon will return a " 18579"square polygon\n" 18580"SELECT ST_AsText(ST_Polygon(rast)) As geomwkt\n" 18581"FROM dummy_rast\n" 18582"WHERE rid = 2;\n" 18583"\n" 18584"geomwkt\n" 18585"--------------------------------------------\n" 18586"MULTIPOLYGON(((3427927.75 5793244,3427928 5793244,3427928 " 18587"5793243.75,3427927.75 5793243.75,3427927.75 5793244)))\n" 18588"\n" 18589"\n" 18590"-- now we change the no data value of first band\n" 18591"UPDATE dummy_rast SET rast = ST_SetBandNoDataValue(rast,1,254)\n" 18592"WHERE rid = 2;\n" 18593"SELECt rid, ST_BandNoDataValue(rast)\n" 18594"from dummy_rast where rid = 2;\n" 18595"\n" 18596"-- ST_Polygon excludes the pixel value 254 and returns a multipolygon\n" 18597"SELECT ST_AsText(ST_Polygon(rast)) As geomwkt\n" 18598"FROM dummy_rast\n" 18599"WHERE rid = 2;\n" 18600"\n" 18601"geomwkt\n" 18602"---------------------------------------------------------\n" 18603"MULTIPOLYGON(((3427927.9 5793243.95,3427927.85 5793243.95,3427927.85 " 18604"5793244,3427927.9 5793244,3427927.9 5793243.95)),((3427928 " 18605"5793243.85,3427928 5793243.8,3427927.95 5793243.8,3427927.95 " 18606"5793243.85,3427927.9 5793243.85,3427927.9 5793243.9,3427927.9 " 18607"5793243.95,3427927.95 5793243.95,3427928 5793243.95,3427928 5793243.85))," 18608"((3427927.8 5793243.75,3427927.75 5793243.75,3427927.75 5793243.8,3427927.75 " 18609"5793243.85,3427927.75 5793243.9,3427927.75 5793244,3427927.8 " 18610"5793244,3427927.8 5793243.9,3427927.8 5793243.85,3427927.85 " 18611"5793243.85,3427927.85 5793243.8,3427927.85 5793243.75,3427927.8 " 18612"5793243.75)))\n" 18613"\n" 18614"-- Or if you want the no data value different for just one time\n" 18615"\n" 18616"SELECT ST_AsText(\n" 18617" ST_Polygon(\n" 18618" ST_SetBandNoDataValue(rast,1,252)\n" 18619" )\n" 18620" ) As geomwkt\n" 18621"FROM dummy_rast\n" 18622"WHERE rid =2;\n" 18623"\n" 18624"geomwkt\n" 18625"---------------------------------\n" 18626"MULTIPOLYGON(((3427928 5793243.85,3427928 5793243.8,3427928 " 18627"5793243.75,3427927.85 5793243.75,3427927.8 5793243.75,3427927.8 " 18628"5793243.8,3427927.75 5793243.8,3427927.75 5793243.85,3427927.75 " 18629"5793243.9,3427927.75 5793244,3427927.8 5793244,3427927.85 5793244,3427927.9 " 18630"5793244,3427928 5793244,3427928 5793243.95,3427928 5793243.85),(3427927.9 " 18631"5793243.9,3427927.9 5793243.85,3427927.95 5793243.85,3427927.95 " 18632"5793243.9,3427927.9 5793243.9)))" 18633msgstr "" 18634 18635#. Tag: title 18636#: reference_raster.xml:9974 18637#, no-c-format 18638msgid "Raster Operators" 18639msgstr "" 18640 18641#. Tag: refname 18642#: reference_raster.xml:9977 18643#, no-c-format 18644msgid "&&" 18645msgstr "&&" 18646 18647#. Tag: refpurpose 18648#: reference_raster.xml:9979 18649#, no-c-format 18650msgid "" 18651"Returns <varname>TRUE</varname> if A's bounding box intersects B's bounding " 18652"box." 18653msgstr "" 18654 18655#. Tag: funcsynopsis 18656#: reference_raster.xml:9983 18657#, no-c-format 18658msgid "" 18659"<funcprototype> <funcdef>boolean <function>&&</function></funcdef> " 18660"<paramdef> <type>raster </type> <parameter>A</parameter> </paramdef> " 18661"<paramdef> <type>raster </type> <parameter>B</parameter> </paramdef> </" 18662"funcprototype> <funcprototype> <funcdef>boolean <function>&&</" 18663"function></funcdef> <paramdef> <type>raster </type> <parameter>A</parameter> " 18664"</paramdef> <paramdef> <type>geometry </type> <parameter>B</parameter> </" 18665"paramdef> </funcprototype> <funcprototype> <funcdef>boolean <function>&" 18666"&</function></funcdef> <paramdef> <type>geometry </type> <parameter>B</" 18667"parameter> </paramdef> <paramdef> <type>raster </type> <parameter>A</" 18668"parameter> </paramdef> </funcprototype>" 18669msgstr "" 18670 18671#. Tag: para 18672#: reference_raster.xml:10025 18673#, no-c-format 18674msgid "" 18675"The <varname>&&</varname> operator returns <varname>TRUE</varname> " 18676"if the bounding box of raster/geometr A intersects the bounding box of " 18677"raster/geometr B." 18678msgstr "" 18679 18680#. Tag: para 18681#: reference_raster.xml:10027 reference_raster.xml:10074 18682#: reference_raster.xml:10278 reference_raster.xml:11288 18683#: reference_raster.xml:11389 reference_raster.xml:11482 18684#, no-c-format 18685msgid "" 18686"This operand will make use of any indexes that may be available on the " 18687"rasters." 18688msgstr "" 18689 18690#. Tag: programlisting 18691#: reference_raster.xml:10036 18692#, no-c-format 18693msgid "" 18694"SELECT A.rid As a_rid, B.rid As b_rid, A.rast && B.rast As " 18695"intersect\n" 18696" FROM dummy_rast AS A CROSS JOIN dummy_rast AS B LIMIT 3;\n" 18697"\n" 18698" a_rid | b_rid | intersect\n" 18699"-------+-------+---------\n" 18700" 2 | 2 | t\n" 18701" 2 | 3 | f\n" 18702" 2 | 1 | f" 18703msgstr "" 18704"SELECT A.rid As a_rid, B.rid As b_rid, A.rast && B.rast As " 18705"intersect\n" 18706" FROM dummy_rast AS A CROSS JOIN dummy_rast AS B LIMIT 3;\n" 18707"\n" 18708" a_rid | b_rid | intersect\n" 18709"-------+-------+---------\n" 18710" 2 | 2 | t\n" 18711" 2 | 3 | f\n" 18712" 2 | 1 | f" 18713 18714#. Tag: refname 18715#: reference_raster.xml:10042 18716#, no-c-format 18717msgid "&<" 18718msgstr "" 18719 18720#. Tag: refpurpose 18721#: reference_raster.xml:10044 18722#, no-c-format 18723msgid "" 18724"Returns <varname>TRUE</varname> if A's bounding box is to the left of B's." 18725msgstr "" 18726 18727#. Tag: funcprototype 18728#: reference_raster.xml:10049 18729#, no-c-format 18730msgid "" 18731"<funcdef>boolean <function>&<</function></funcdef> <paramdef> " 18732"<type>raster </type> <parameter>A</parameter> </paramdef> <paramdef> " 18733"<type>raster </type> <parameter>B</parameter> </paramdef>" 18734msgstr "" 18735"<funcdef>boolean <function>&<</function></funcdef> <paramdef> " 18736"<type>raster </type> <parameter>A</parameter> </paramdef> <paramdef> " 18737"<type>raster </type> <parameter>B</parameter> </paramdef>" 18738 18739#. Tag: para 18740#: reference_raster.xml:10070 18741#, no-c-format 18742msgid "" 18743"The <varname>&<</varname> operator returns <varname>TRUE</varname> if " 18744"the bounding box of raster A overlaps or is to the left of the bounding box " 18745"of raster B, or more accurately, overlaps or is NOT to the right of the " 18746"bounding box of raster B." 18747msgstr "" 18748 18749#. Tag: programlisting 18750#: reference_raster.xml:10080 18751#, no-c-format 18752msgid "" 18753"SELECT A.rid As a_rid, B.rid As b_rid, A.rast &< B.rast As overleft\n" 18754" FROM dummy_rast AS A CROSS JOIN dummy_rast AS B;\n" 18755"\n" 18756"a_rid | b_rid | overleft\n" 18757"------+-------+----------\n" 18758" 2 | 2 | t\n" 18759" 2 | 3 | f\n" 18760" 2 | 1 | f\n" 18761" 3 | 2 | t\n" 18762" 3 | 3 | t\n" 18763" 3 | 1 | f\n" 18764" 1 | 2 | t\n" 18765" 1 | 3 | t\n" 18766" 1 | 1 | t" 18767msgstr "" 18768"SELECT A.rid As a_rid, B.rid As b_rid, A.rast &< B.rast As overleft\n" 18769" FROM dummy_rast AS A CROSS JOIN dummy_rast AS B;\n" 18770"\n" 18771"a_rid | b_rid | overleft\n" 18772"------+-------+----------\n" 18773" 2 | 2 | t\n" 18774" 2 | 3 | f\n" 18775" 2 | 1 | f\n" 18776" 3 | 2 | t\n" 18777" 3 | 3 | t\n" 18778" 3 | 1 | f\n" 18779" 1 | 2 | t\n" 18780" 1 | 3 | t\n" 18781" 1 | 1 | t" 18782 18783#. Tag: refname 18784#: reference_raster.xml:10086 18785#, no-c-format 18786msgid "&>" 18787msgstr "&>" 18788 18789#. Tag: refpurpose 18790#: reference_raster.xml:10088 18791#, no-c-format 18792msgid "" 18793"Returns <varname>TRUE</varname> if A's bounding box is to the right of B's." 18794msgstr "" 18795 18796#. Tag: funcprototype 18797#: reference_raster.xml:10093 18798#, no-c-format 18799msgid "" 18800"<funcdef>boolean <function>&></function></funcdef> <paramdef> " 18801"<type>raster </type> <parameter>A</parameter> </paramdef> <paramdef> " 18802"<type>raster </type> <parameter>B</parameter> </paramdef>" 18803msgstr "" 18804"<funcdef>boolean <function>&></function></funcdef> <paramdef> " 18805"<type>raster </type> <parameter>A</parameter> </paramdef> <paramdef> " 18806"<type>raster </type> <parameter>B</parameter> </paramdef>" 18807 18808#. Tag: para 18809#: reference_raster.xml:10114 18810#, no-c-format 18811msgid "" 18812"The <varname>&></varname> operator returns <varname>TRUE</varname> if " 18813"the bounding box of raster A overlaps or is to the right of the bounding box " 18814"of raster B, or more accurately, overlaps or is NOT to the left of the " 18815"bounding box of raster B." 18816msgstr "" 18817 18818#. Tag: para 18819#: reference_raster.xml:10118 18820#, no-c-format 18821msgid "" 18822"This operand will make use of any indexes that may be available on the " 18823"geometries." 18824msgstr "" 18825 18826#. Tag: programlisting 18827#: reference_raster.xml:10125 18828#, no-c-format 18829msgid "" 18830"SELECT A.rid As a_rid, B.rid As b_rid, A.rast &> B.rast As overright\n" 18831" FROM dummy_rast AS A CROSS JOIN dummy_rast AS B;\n" 18832"\n" 18833" a_rid | b_rid | overright\n" 18834"-------+-------+----------\n" 18835" 2 | 2 | t\n" 18836" 2 | 3 | t\n" 18837" 2 | 1 | t\n" 18838" 3 | 2 | f\n" 18839" 3 | 3 | t\n" 18840" 3 | 1 | f\n" 18841" 1 | 2 | f\n" 18842" 1 | 3 | t\n" 18843" 1 | 1 | t" 18844msgstr "" 18845"SELECT A.rid As a_rid, B.rid As b_rid, A.rast &> B.rast As overright\n" 18846" FROM dummy_rast AS A CROSS JOIN dummy_rast AS B;\n" 18847"\n" 18848" a_rid | b_rid | overright\n" 18849"-------+-------+----------\n" 18850" 2 | 2 | t\n" 18851" 2 | 3 | t\n" 18852" 2 | 1 | t\n" 18853" 3 | 2 | f\n" 18854" 3 | 3 | t\n" 18855" 3 | 1 | f\n" 18856" 1 | 2 | f\n" 18857" 1 | 3 | t\n" 18858" 1 | 1 | t" 18859 18860#. Tag: refname 18861#: reference_raster.xml:10131 18862#, no-c-format 18863msgid "=" 18864msgstr "" 18865 18866#. Tag: refpurpose 18867#: reference_raster.xml:10133 18868#, no-c-format 18869msgid "" 18870"Returns <varname>TRUE</varname> if A's bounding box is the same as B's. Uses " 18871"double precision bounding box." 18872msgstr "" 18873 18874#. Tag: funcprototype 18875#: reference_raster.xml:10138 18876#, no-c-format 18877msgid "" 18878"<funcdef>boolean <function>=</function></funcdef> <paramdef> " 18879"<type>raster </type> <parameter>A</parameter> </paramdef> <paramdef> " 18880"<type>raster </type> <parameter>B</parameter> </paramdef>" 18881msgstr "" 18882 18883#. Tag: para 18884#: reference_raster.xml:10159 18885#, no-c-format 18886msgid "" 18887"The <varname>=</varname> operator returns <varname>TRUE</varname> if the " 18888"bounding box of raster A is the same as the bounding box of raster B. " 18889"PostgreSQL uses the =, <, and > operators defined for rasters to " 18890"perform internal orderings and comparison of rasters (ie. in a GROUP BY or " 18891"ORDER BY clause)." 18892msgstr "" 18893 18894#. Tag: para 18895#: reference_raster.xml:10163 18896#, no-c-format 18897msgid "" 18898"This operand will NOT make use of any indexes that may be available on the " 18899"rasters. Use <xref linkend=\"RT_Raster_Same\"/> instead. This operator " 18900"exists mostly so one can group by the raster column." 18901msgstr "" 18902 18903#. Tag: refname 18904#: reference_raster.xml:10179 18905#, no-c-format 18906msgid "<refname>@</refname>" 18907msgstr "" 18908 18909#. Tag: refpurpose 18910#: reference_raster.xml:10181 18911#, no-c-format 18912msgid "" 18913"Returns <varname>TRUE</varname> if A's bounding box is contained by B's. " 18914"Uses double precision bounding box." 18915msgstr "" 18916 18917#. Tag: funcsynopsis 18918#: reference_raster.xml:10185 18919#, no-c-format 18920msgid "" 18921"<funcprototype> <funcdef>boolean <function>@</function></funcdef> <paramdef> " 18922"<type>raster </type> <parameter>A</parameter> </paramdef> <paramdef> " 18923"<type>raster </type> <parameter>B</parameter> </paramdef> </funcprototype> " 18924"<funcprototype> <funcdef>boolean <function>@</function></funcdef> <paramdef> " 18925"<type>geometry </type> <parameter>A</parameter> </paramdef> <paramdef> " 18926"<type>raster </type> <parameter>B</parameter> </paramdef> </funcprototype> " 18927"<funcprototype> <funcdef>boolean <function>@</function></funcdef> <paramdef> " 18928"<type>raster </type> <parameter>B</parameter> </paramdef> <paramdef> " 18929"<type>geometry </type> <parameter>A</parameter> </paramdef> </funcprototype>" 18930msgstr "" 18931 18932#. Tag: para 18933#: reference_raster.xml:10228 18934#, no-c-format 18935msgid "" 18936"The <varname>@</varname> operator returns <varname>TRUE</varname> if the " 18937"bounding box of raster/geometry A is contained by bounding box of raster/" 18938"geometr B." 18939msgstr "" 18940 18941#. Tag: para 18942#: reference_raster.xml:10231 reference_raster.xml:10351 18943#, no-c-format 18944msgid "This operand will use spatial indexes on the rasters." 18945msgstr "" 18946 18947#. Tag: para 18948#: reference_raster.xml:10233 18949#, no-c-format 18950msgid "Availability: 2.0.0 raster @ raster, raster @ geometry introduced" 18951msgstr "" 18952 18953#. Tag: para 18954#: reference_raster.xml:10234 18955#, no-c-format 18956msgid "Availability: 2.0.5 geometry @ raster introduced" 18957msgstr "" 18958 18959#. Tag: refname 18960#: reference_raster.xml:10247 18961#, no-c-format 18962msgid "<refname>~=</refname>" 18963msgstr "" 18964 18965#. Tag: refpurpose 18966#: reference_raster.xml:10249 18967#, no-c-format 18968msgid "Returns <varname>TRUE</varname> if A's bounding box is the same as B's." 18969msgstr "" 18970 18971#. Tag: funcprototype 18972#: reference_raster.xml:10254 18973#, no-c-format 18974msgid "" 18975"<funcdef>boolean <function>~=</function></funcdef> <paramdef> <type>raster </" 18976"type> <parameter>A</parameter> </paramdef> <paramdef> <type>raster </type> " 18977"<parameter>B</parameter> </paramdef>" 18978msgstr "" 18979 18980#. Tag: para 18981#: reference_raster.xml:10275 18982#, no-c-format 18983msgid "" 18984"The <varname>~=</varname> operator returns <varname>TRUE</varname> if the " 18985"bounding box of raster A is the same as the bounding box of raster B." 18986msgstr "" 18987 18988#. Tag: para 18989#: reference_raster.xml:10287 18990#, no-c-format 18991msgid "" 18992"Very useful usecase is for taking two sets of single band rasters that are " 18993"of the same chunk but represent different themes and creating a multi-band " 18994"raster" 18995msgstr "" 18996 18997#. Tag: programlisting 18998#: reference_raster.xml:10288 18999#, no-c-format 19000msgid "" 19001"SELECT ST_AddBand(prec.rast, alt.rast) As new_rast\n" 19002" FROM prec INNER JOIN alt ON (prec.rast ~= alt.rast);" 19003msgstr "" 19004 19005#. Tag: para 19006#: reference_raster.xml:10293 19007#, no-c-format 19008msgid ", <xref linkend=\"RT_Raster_EQ\"/>" 19009msgstr "" 19010 19011#. Tag: refname 19012#: reference_raster.xml:10299 19013#, no-c-format 19014msgid "<refname>~</refname>" 19015msgstr "" 19016 19017#. Tag: refpurpose 19018#: reference_raster.xml:10301 19019#, no-c-format 19020msgid "" 19021"Returns <varname>TRUE</varname> if A's bounding box is contains B's. Uses " 19022"double precision bounding box." 19023msgstr "" 19024 19025#. Tag: funcsynopsis 19026#: reference_raster.xml:10305 19027#, no-c-format 19028msgid "" 19029"<funcprototype> <funcdef>boolean <function>~</function></funcdef> <paramdef> " 19030"<type>raster </type> <parameter>A</parameter> </paramdef> <paramdef> " 19031"<type>raster </type> <parameter>B</parameter> </paramdef> </funcprototype> " 19032"<funcprototype> <funcdef>boolean <function>~</function></funcdef> <paramdef> " 19033"<type>geometry </type> <parameter>A</parameter> </paramdef> <paramdef> " 19034"<type>raster </type> <parameter>B</parameter> </paramdef> </funcprototype> " 19035"<funcprototype> <funcdef>boolean <function>~</function></funcdef> <paramdef> " 19036"<type>raster </type> <parameter>B</parameter> </paramdef> <paramdef> " 19037"<type>geometry </type> <parameter>A</parameter> </paramdef> </funcprototype>" 19038msgstr "" 19039 19040#. Tag: para 19041#: reference_raster.xml:10348 19042#, no-c-format 19043msgid "" 19044"The <varname>~</varname> operator returns <varname>TRUE</varname> if the " 19045"bounding box of raster/geometry A is contains bounding box of raster/geometr " 19046"B." 19047msgstr "" 19048 19049#. Tag: title 19050#: reference_raster.xml:10366 19051#, no-c-format 19052msgid "Raster and Raster Band Spatial Relationships" 19053msgstr "" 19054 19055#. Tag: refname 19056#: reference_raster.xml:10370 19057#, no-c-format 19058msgid "ST_Contains" 19059msgstr "ST_Contains" 19060 19061#. Tag: refpurpose 19062#: reference_raster.xml:10371 19063#, no-c-format 19064msgid "" 19065"Return true if no points of raster rastB lie in the exterior of raster rastA " 19066"and at least one point of the interior of rastB lies in the interior of " 19067"rastA." 19068msgstr "" 19069 19070#. Tag: funcsynopsis 19071#: reference_raster.xml:10377 19072#, no-c-format 19073msgid "" 19074"<funcprototype> <funcdef>boolean <function>ST_Contains</function></funcdef> " 19075"<paramdef> <type>raster </type> <parameter>rastA</parameter> </paramdef> " 19076"<paramdef> <type>integer </type> <parameter>nbandA</parameter> </paramdef> " 19077"<paramdef> <type>raster </type> <parameter>rastB</parameter> </paramdef> " 19078"<paramdef> <type>integer </type> <parameter>nbandB</parameter> </paramdef> </" 19079"funcprototype> <funcprototype> <funcdef>boolean <function>ST_Contains</" 19080"function></funcdef> <paramdef> <type>raster </type> <parameter>rastA</" 19081"parameter> </paramdef> <paramdef> <type>raster </type> <parameter>rastB</" 19082"parameter> </paramdef> </funcprototype>" 19083msgstr "" 19084 19085#. Tag: para 19086#: reference_raster.xml:10416 19087#, no-c-format 19088msgid "" 19089"Raster rastA contains rastB if and only if no points of rastB lie in the " 19090"exterior of rastA and at least one point of the interior of rastB lies in " 19091"the interior of rastA. If the band number is not provided (or set to NULL), " 19092"only the convex hull of the raster is considered in the test. If the band " 19093"number is provided, only those pixels with value (not NODATA) are considered " 19094"in the test." 19095msgstr "" 19096 19097#. Tag: para 19098#: reference_raster.xml:10421 reference_raster.xml:10514 19099#: reference_raster.xml:10595 reference_raster.xml:10676 19100#: reference_raster.xml:10886 reference_raster.xml:10970 19101#: reference_raster.xml:11050 19102#, no-c-format 19103msgid "" 19104"This function will make use of any indexes that may be available on the " 19105"rasters." 19106msgstr "" 19107 19108#. Tag: para 19109#: reference_raster.xml:10427 19110#, no-c-format 19111msgid "" 19112"To test the spatial relationship of a raster and a geometry, use ST_Polygon " 19113"on the raster, e.g. ST_Contains(ST_Polygon(raster), geometry) or " 19114"ST_Contains(geometry, ST_Polygon(raster))." 19115msgstr "" 19116 19117#. Tag: para 19118#: reference_raster.xml:10433 19119#, no-c-format 19120msgid "" 19121"ST_Contains() is the inverse of ST_Within(). So, ST_Contains(rastA, rastB) " 19122"implies ST_Within(rastB, rastA)." 19123msgstr "" 19124 19125#. Tag: programlisting 19126#: reference_raster.xml:10444 19127#, fuzzy, no-c-format 19128msgid "" 19129"-- specified band numbers\n" 19130"SELECT r1.rid, r2.rid, ST_Contains(r1.rast, 1, r2.rast, 1) FROM dummy_rast " 19131"r1 CROSS JOIN dummy_rast r2 WHERE r1.rid = 1;\n" 19132"\n" 19133"NOTICE: The first raster provided has no bands\n" 19134" rid | rid | st_contains\n" 19135"-----+-----+-------------\n" 19136" 1 | 1 |\n" 19137" 1 | 2 | f" 19138msgstr "" 19139"SELECT r1.rid, r2.rid, ST_ContainsProperly(r1.rast, 1, r2.rast, 1) FROM " 19140"dummy_rast r1 CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 19141"\n" 19142" rid | rid | st_containsproperly \n" 19143"-----+-----+---------------------\n" 19144" 2 | 1 | f\n" 19145" 2 | 2 | f" 19146 19147#. Tag: programlisting 19148#: reference_raster.xml:10446 19149#, fuzzy, no-c-format 19150msgid "" 19151"-- no band numbers specified\n" 19152"SELECT r1.rid, r2.rid, ST_Contains(r1.rast, r2.rast) FROM dummy_rast r1 " 19153"CROSS JOIN dummy_rast r2 WHERE r1.rid = 1;\n" 19154" rid | rid | st_contains\n" 19155"-----+-----+-------------\n" 19156" 1 | 1 | t\n" 19157" 1 | 2 | f" 19158msgstr "" 19159"SELECT r1.rid, r2.rid, ST_ContainsProperly(r1.rast, 1, r2.rast, 1) FROM " 19160"dummy_rast r1 CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 19161"\n" 19162" rid | rid | st_containsproperly \n" 19163"-----+-----+---------------------\n" 19164" 2 | 1 | f\n" 19165" 2 | 2 | f" 19166 19167#. Tag: para 19168#: reference_raster.xml:10450 19169#, no-c-format 19170msgid ", <xref linkend=\"RT_ST_Within\"/>" 19171msgstr ", <xref linkend=\"RT_ST_Within\"/>" 19172 19173#. Tag: refname 19174#: reference_raster.xml:10459 19175#, no-c-format 19176msgid "ST_ContainsProperly" 19177msgstr "ST_ContainsProperly" 19178 19179#. Tag: refpurpose 19180#: reference_raster.xml:10460 19181#, no-c-format 19182msgid "" 19183"Return true if rastB intersects the interior of rastA but not the boundary " 19184"or exterior of rastA." 19185msgstr "" 19186 19187#. Tag: funcsynopsis 19188#: reference_raster.xml:10466 19189#, no-c-format 19190msgid "" 19191"<funcprototype> <funcdef>boolean <function>ST_ContainsProperly</function></" 19192"funcdef> <paramdef> <type>raster </type> <parameter>rastA</parameter> </" 19193"paramdef> <paramdef> <type>integer </type> <parameter>nbandA</parameter> </" 19194"paramdef> <paramdef> <type>raster </type> <parameter>rastB</parameter> </" 19195"paramdef> <paramdef> <type>integer </type> <parameter>nbandB</parameter> </" 19196"paramdef> </funcprototype> <funcprototype> <funcdef>boolean " 19197"<function>ST_ContainsProperly</function></funcdef> <paramdef> <type>raster </" 19198"type> <parameter>rastA</parameter> </paramdef> <paramdef> <type>raster </" 19199"type> <parameter>rastB</parameter> </paramdef> </funcprototype>" 19200msgstr "" 19201"<funcprototype> <funcdef>boolean <function>ST_ContainsProperly</function></" 19202"funcdef> <paramdef> <type>raster </type> <parameter>rastA</parameter> </" 19203"paramdef> <paramdef> <type>integer </type> <parameter>nbandA</parameter> </" 19204"paramdef> <paramdef> <type>raster </type> <parameter>rastB</parameter> </" 19205"paramdef> <paramdef> <type>integer </type> <parameter>nbandB</parameter> </" 19206"paramdef> </funcprototype> <funcprototype> <funcdef>boolean " 19207"<function>ST_ContainsProperly</function></funcdef> <paramdef> <type>raster </" 19208"type> <parameter>rastA</parameter> </paramdef> <paramdef> <type>raster </" 19209"type> <parameter>rastB</parameter> </paramdef> </funcprototype>" 19210 19211#. Tag: para 19212#: reference_raster.xml:10505 19213#, no-c-format 19214msgid "" 19215"Raster rastA contains properly rastB if rastB intersects the interior of " 19216"rastA but not the boundary or exterior of rastA. If the band number is not " 19217"provided (or set to NULL), only the convex hull of the raster is considered " 19218"in the test. If the band number is provided, only those pixels with value " 19219"(not NODATA) are considered in the test." 19220msgstr "" 19221 19222#. Tag: para 19223#: reference_raster.xml:10509 19224#, no-c-format 19225msgid "Raster rastA does not contain properly itself but does contain itself." 19226msgstr "" 19227 19228#. Tag: para 19229#: reference_raster.xml:10520 19230#, no-c-format 19231msgid "" 19232"To test the spatial relationship of a raster and a geometry, use ST_Polygon " 19233"on the raster, e.g. ST_ContainsProperly(ST_Polygon(raster), geometry) or " 19234"ST_ContainsProperly(geometry, ST_Polygon(raster))." 19235msgstr "" 19236 19237#. Tag: programlisting 19238#: reference_raster.xml:10531 19239#, fuzzy, no-c-format 19240msgid "" 19241"SELECT r1.rid, r2.rid, ST_ContainsProperly(r1.rast, 1, r2.rast, 1) FROM " 19242"dummy_rast r1 CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 19243"\n" 19244" rid | rid | st_containsproperly\n" 19245"-----+-----+---------------------\n" 19246" 2 | 1 | f\n" 19247" 2 | 2 | f" 19248msgstr "" 19249"SELECT r1.rid, r2.rid, ST_ContainsProperly(r1.rast, 1, r2.rast, 1) FROM " 19250"dummy_rast r1 CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 19251"\n" 19252" rid | rid | st_containsproperly \n" 19253"-----+-----+---------------------\n" 19254" 2 | 1 | f\n" 19255" 2 | 2 | f" 19256 19257#. Tag: para 19258#: reference_raster.xml:10535 19259#, no-c-format 19260msgid ", <xref linkend=\"RT_ST_Contains\"/>" 19261msgstr ", <xref linkend=\"RT_ST_Contains\"/>" 19262 19263#. Tag: refname 19264#: reference_raster.xml:10544 19265#, no-c-format 19266msgid "ST_Covers" 19267msgstr "ST_Covers" 19268 19269#. Tag: refpurpose 19270#: reference_raster.xml:10545 19271#, no-c-format 19272msgid "Return true if no points of raster rastB lie outside raster rastA." 19273msgstr "" 19274 19275#. Tag: funcsynopsis 19276#: reference_raster.xml:10551 19277#, no-c-format 19278msgid "" 19279"<funcprototype> <funcdef>boolean <function>ST_Covers</function></funcdef> " 19280"<paramdef> <type>raster </type> <parameter>rastA</parameter> </paramdef> " 19281"<paramdef> <type>integer </type> <parameter>nbandA</parameter> </paramdef> " 19282"<paramdef> <type>raster </type> <parameter>rastB</parameter> </paramdef> " 19283"<paramdef> <type>integer </type> <parameter>nbandB</parameter> </paramdef> </" 19284"funcprototype> <funcprototype> <funcdef>boolean <function>ST_Covers</" 19285"function></funcdef> <paramdef> <type>raster </type> <parameter>rastA</" 19286"parameter> </paramdef> <paramdef> <type>raster </type> <parameter>rastB</" 19287"parameter> </paramdef> </funcprototype>" 19288msgstr "" 19289"<funcprototype> <funcdef>boolean <function>ST_Covers</function></funcdef> " 19290"<paramdef> <type>raster </type> <parameter>rastA</parameter> </paramdef> " 19291"<paramdef> <type>integer </type> <parameter>nbandA</parameter> </paramdef> " 19292"<paramdef> <type>raster </type> <parameter>rastB</parameter> </paramdef> " 19293"<paramdef> <type>integer </type> <parameter>nbandB</parameter> </paramdef> </" 19294"funcprototype> <funcprototype> <funcdef>boolean <function>ST_Covers</" 19295"function></funcdef> <paramdef> <type>raster </type> <parameter>rastA</" 19296"parameter> </paramdef> <paramdef> <type>raster </type> <parameter>rastB</" 19297"parameter> </paramdef> </funcprototype>" 19298 19299#. Tag: para 19300#: reference_raster.xml:10590 19301#, no-c-format 19302msgid "" 19303"Raster rastA covers rastB if and only if no points of rastB lie in the " 19304"exterior of rastA. If the band number is not provided (or set to NULL), only " 19305"the convex hull of the raster is considered in the test. If the band number " 19306"is provided, only those pixels with value (not NODATA) are considered in the " 19307"test." 19308msgstr "" 19309 19310#. Tag: para 19311#: reference_raster.xml:10601 19312#, no-c-format 19313msgid "" 19314"To test the spatial relationship of a raster and a geometry, use ST_Polygon " 19315"on the raster, e.g. ST_Covers(ST_Polygon(raster), geometry) or " 19316"ST_Covers(geometry, ST_Polygon(raster))." 19317msgstr "" 19318 19319#. Tag: programlisting 19320#: reference_raster.xml:10612 19321#, fuzzy, no-c-format 19322msgid "" 19323"SELECT r1.rid, r2.rid, ST_Covers(r1.rast, 1, r2.rast, 1) FROM dummy_rast r1 " 19324"CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 19325"\n" 19326" rid | rid | st_covers\n" 19327"-----+-----+-----------\n" 19328" 2 | 1 | f\n" 19329" 2 | 2 | t" 19330msgstr "" 19331"SELECT r1.rid, r2.rid, ST_Covers(r1.rast, 1, r2.rast, 1) FROM dummy_rast r1 " 19332"CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 19333"\n" 19334" rid | rid | st_covers \n" 19335"-----+-----+-----------\n" 19336" 2 | 1 | f\n" 19337" 2 | 2 | t" 19338 19339#. Tag: para 19340#: reference_raster.xml:10616 19341#, no-c-format 19342msgid ", <xref linkend=\"RT_ST_CoveredBy\"/>" 19343msgstr ", <xref linkend=\"RT_ST_CoveredBy\"/>" 19344 19345#. Tag: refname 19346#: reference_raster.xml:10625 19347#, no-c-format 19348msgid "ST_CoveredBy" 19349msgstr "ST_CoveredBy" 19350 19351#. Tag: refpurpose 19352#: reference_raster.xml:10626 19353#, no-c-format 19354msgid "Return true if no points of raster rastA lie outside raster rastB." 19355msgstr "" 19356 19357#. Tag: funcsynopsis 19358#: reference_raster.xml:10632 19359#, no-c-format 19360msgid "" 19361"<funcprototype> <funcdef>boolean <function>ST_CoveredBy</function></funcdef> " 19362"<paramdef> <type>raster </type> <parameter>rastA</parameter> </paramdef> " 19363"<paramdef> <type>integer </type> <parameter>nbandA</parameter> </paramdef> " 19364"<paramdef> <type>raster </type> <parameter>rastB</parameter> </paramdef> " 19365"<paramdef> <type>integer </type> <parameter>nbandB</parameter> </paramdef> </" 19366"funcprototype> <funcprototype> <funcdef>boolean <function>ST_CoveredBy</" 19367"function></funcdef> <paramdef> <type>raster </type> <parameter>rastA</" 19368"parameter> </paramdef> <paramdef> <type>raster </type> <parameter>rastB</" 19369"parameter> </paramdef> </funcprototype>" 19370msgstr "" 19371"<funcprototype> <funcdef>boolean <function>ST_CoveredBy</function></funcdef> " 19372"<paramdef> <type>raster </type> <parameter>rastA</parameter> </paramdef> " 19373"<paramdef> <type>integer </type> <parameter>nbandA</parameter> </paramdef> " 19374"<paramdef> <type>raster </type> <parameter>rastB</parameter> </paramdef> " 19375"<paramdef> <type>integer </type> <parameter>nbandB</parameter> </paramdef> </" 19376"funcprototype> <funcprototype> <funcdef>boolean <function>ST_CoveredBy</" 19377"function></funcdef> <paramdef> <type>raster </type> <parameter>rastA</" 19378"parameter> </paramdef> <paramdef> <type>raster </type> <parameter>rastB</" 19379"parameter> </paramdef> </funcprototype>" 19380 19381#. Tag: para 19382#: reference_raster.xml:10671 19383#, no-c-format 19384msgid "" 19385"Raster rastA is covered by rastB if and only if no points of rastA lie in " 19386"the exterior of rastB. If the band number is not provided (or set to NULL), " 19387"only the convex hull of the raster is considered in the test. If the band " 19388"number is provided, only those pixels with value (not NODATA) are considered " 19389"in the test." 19390msgstr "" 19391 19392#. Tag: para 19393#: reference_raster.xml:10682 19394#, no-c-format 19395msgid "" 19396"To test the spatial relationship of a raster and a geometry, use ST_Polygon " 19397"on the raster, e.g. ST_CoveredBy(ST_Polygon(raster), geometry) or " 19398"ST_CoveredBy(geometry, ST_Polygon(raster))." 19399msgstr "" 19400 19401#. Tag: programlisting 19402#: reference_raster.xml:10693 19403#, fuzzy, no-c-format 19404msgid "" 19405"SELECT r1.rid, r2.rid, ST_CoveredBy(r1.rast, 1, r2.rast, 1) FROM dummy_rast " 19406"r1 CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 19407"\n" 19408" rid | rid | st_coveredby\n" 19409"-----+-----+--------------\n" 19410" 2 | 1 | f\n" 19411" 2 | 2 | t" 19412msgstr "" 19413"SELECT r1.rid, r2.rid, ST_CoveredBy(r1.rast, 1, r2.rast, 1) FROM dummy_rast " 19414"r1 CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 19415"\n" 19416" rid | rid | st_coveredby \n" 19417"-----+-----+--------------\n" 19418" 2 | 1 | f\n" 19419" 2 | 2 | t" 19420 19421#. Tag: para 19422#: reference_raster.xml:10697 19423#, no-c-format 19424msgid ", <xref linkend=\"RT_ST_Covers\"/>" 19425msgstr ", <xref linkend=\"RT_ST_Covers\"/>" 19426 19427#. Tag: refname 19428#: reference_raster.xml:10706 19429#, no-c-format 19430msgid "ST_Disjoint" 19431msgstr "ST_Disjoint" 19432 19433#. Tag: refpurpose 19434#: reference_raster.xml:10707 19435#, no-c-format 19436msgid "Return true if raster rastA does not spatially intersect rastB." 19437msgstr "" 19438 19439#. Tag: funcsynopsis 19440#: reference_raster.xml:10713 19441#, no-c-format 19442msgid "" 19443"<funcprototype> <funcdef>boolean <function>ST_Disjoint</function></funcdef> " 19444"<paramdef> <type>raster </type> <parameter>rastA</parameter> </paramdef> " 19445"<paramdef> <type>integer </type> <parameter>nbandA</parameter> </paramdef> " 19446"<paramdef> <type>raster </type> <parameter>rastB</parameter> </paramdef> " 19447"<paramdef> <type>integer </type> <parameter>nbandB</parameter> </paramdef> </" 19448"funcprototype> <funcprototype> <funcdef>boolean <function>ST_Disjoint</" 19449"function></funcdef> <paramdef> <type>raster </type> <parameter>rastA</" 19450"parameter> </paramdef> <paramdef> <type>raster </type> <parameter>rastB</" 19451"parameter> </paramdef> </funcprototype>" 19452msgstr "" 19453"<funcprototype> <funcdef>boolean <function>ST_Disjoint</function></funcdef> " 19454"<paramdef> <type>raster </type> <parameter>rastA</parameter> </paramdef> " 19455"<paramdef> <type>integer </type> <parameter>nbandA</parameter> </paramdef> " 19456"<paramdef> <type>raster </type> <parameter>rastB</parameter> </paramdef> " 19457"<paramdef> <type>integer </type> <parameter>nbandB</parameter> </paramdef> </" 19458"funcprototype> <funcprototype> <funcdef>boolean <function>ST_Disjoint</" 19459"function></funcdef> <paramdef> <type>raster </type> <parameter>rastA</" 19460"parameter> </paramdef> <paramdef> <type>raster </type> <parameter>rastB</" 19461"parameter> </paramdef> </funcprototype>" 19462 19463#. Tag: para 19464#: reference_raster.xml:10752 19465#, no-c-format 19466msgid "" 19467"Raster rastA and rastB are disjointed if they do not share any space " 19468"together. If the band number is not provided (or set to NULL), only the " 19469"convex hull of the raster is considered in the test. If the band number is " 19470"provided, only those pixels with value (not NODATA) are considered in the " 19471"test." 19472msgstr "" 19473 19474#. Tag: para 19475#: reference_raster.xml:10757 19476#, no-c-format 19477msgid "This function does NOT use any indexes." 19478msgstr "" 19479 19480#. Tag: para 19481#: reference_raster.xml:10763 19482#, no-c-format 19483msgid "" 19484"To test the spatial relationship of a raster and a geometry, use ST_Polygon " 19485"on the raster, e.g. ST_Disjoint(ST_Polygon(raster), geometry)." 19486msgstr "" 19487 19488#. Tag: programlisting 19489#: reference_raster.xml:10774 19490#, fuzzy, no-c-format 19491msgid "" 19492"-- rid = 1 has no bands, hence the NOTICE and the NULL value for " 19493"st_disjoint\n" 19494"SELECT r1.rid, r2.rid, ST_Disjoint(r1.rast, 1, r2.rast, 1) FROM dummy_rast " 19495"r1 CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 19496"\n" 19497"NOTICE: The second raster provided has no bands\n" 19498" rid | rid | st_disjoint\n" 19499"-----+-----+-------------\n" 19500" 2 | 1 |\n" 19501" 2 | 2 | f" 19502msgstr "" 19503"SELECT r1.rid, r2.rid, ST_Within(r1.rast, 1, r2.rast, 1) FROM dummy_rast r1 " 19504"CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 19505"\n" 19506" rid | rid | st_within \n" 19507"-----+-----+-----------\n" 19508" 2 | 1 | f\n" 19509" 2 | 2 | t" 19510 19511#. Tag: programlisting 19512#: reference_raster.xml:10776 19513#, fuzzy, no-c-format 19514msgid "" 19515"-- this time, without specifying band numbers\n" 19516"SELECT r1.rid, r2.rid, ST_Disjoint(r1.rast, r2.rast) FROM dummy_rast r1 " 19517"CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 19518"\n" 19519" rid | rid | st_disjoint\n" 19520"-----+-----+-------------\n" 19521" 2 | 1 | t\n" 19522" 2 | 2 | f" 19523msgstr "" 19524"SELECT r1.rid, r2.rid, ST_Within(r1.rast, 1, r2.rast, 1) FROM dummy_rast r1 " 19525"CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 19526"\n" 19527" rid | rid | st_within \n" 19528"-----+-----+-----------\n" 19529" 2 | 1 | f\n" 19530" 2 | 2 | t" 19531 19532#. Tag: refname 19533#: reference_raster.xml:10789 19534#, no-c-format 19535msgid "ST_Intersects" 19536msgstr "ST_Intersects" 19537 19538#. Tag: refpurpose 19539#: reference_raster.xml:10790 19540#, no-c-format 19541msgid "Return true if raster rastA spatially intersects raster rastB." 19542msgstr "" 19543 19544#. Tag: funcsynopsis 19545#: reference_raster.xml:10794 19546#, no-c-format 19547msgid "" 19548"<funcprototype> <funcdef>boolean <function>ST_Intersects</function></" 19549"funcdef> <paramdef> <type>raster </type> <parameter>rastA</parameter> </" 19550"paramdef> <paramdef> <type>integer </type> <parameter>nbandA</parameter> </" 19551"paramdef> <paramdef> <type>raster </type> <parameter>rastB</parameter> </" 19552"paramdef> <paramdef> <type>integer </type> <parameter>nbandB</parameter> </" 19553"paramdef> </funcprototype> <funcprototype> <funcdef>boolean " 19554"<function>ST_Intersects</function></funcdef> <paramdef> <type>raster </type> " 19555"<parameter>rastA</parameter> </paramdef> <paramdef> <type>raster </type> " 19556"<parameter>rastB</parameter> </paramdef> </funcprototype> <funcprototype> " 19557"<funcdef>boolean <function>ST_Intersects</function></funcdef> <paramdef> " 19558"<type>raster </type> <parameter>rast</parameter> </paramdef> <paramdef> " 19559"<type>integer </type> <parameter>nband</parameter> </paramdef> <paramdef> " 19560"<type>geometry </type> <parameter>geommin</parameter> </paramdef> </" 19561"funcprototype> <funcprototype> <funcdef>boolean <function>ST_Intersects</" 19562"function></funcdef> <paramdef> <type>raster </type> <parameter>rast</" 19563"parameter> </paramdef> <paramdef> <type>geometry </type> <parameter>geommin</" 19564"parameter> </paramdef> <paramdef choice=\"opt\"> <type>integer </type> " 19565"<parameter>nband=NULL</parameter> </paramdef> </funcprototype> " 19566"<funcprototype> <funcdef>boolean <function>ST_Intersects</function></" 19567"funcdef> <paramdef> <type>geometry </type> <parameter>geommin</parameter> </" 19568"paramdef> <paramdef> <type>raster </type> <parameter>rast</parameter> </" 19569"paramdef> <paramdef choice=\"opt\"> <type>integer </type> " 19570"<parameter>nband=NULL</parameter> </paramdef> </funcprototype>" 19571msgstr "" 19572"<funcprototype> <funcdef>boolean <function>ST_Intersects</function></" 19573"funcdef> <paramdef> <type>raster </type> <parameter>rastA</parameter> </" 19574"paramdef> <paramdef> <type>integer </type> <parameter>nbandA</parameter> </" 19575"paramdef> <paramdef> <type>raster </type> <parameter>rastB</parameter> </" 19576"paramdef> <paramdef> <type>integer </type> <parameter>nbandB</parameter> </" 19577"paramdef> </funcprototype> <funcprototype> <funcdef>boolean " 19578"<function>ST_Intersects</function></funcdef> <paramdef> <type>raster </type> " 19579"<parameter>rastA</parameter> </paramdef> <paramdef> <type>raster </type> " 19580"<parameter>rastB</parameter> </paramdef> </funcprototype> <funcprototype> " 19581"<funcdef>boolean <function>ST_Intersects</function></funcdef> <paramdef> " 19582"<type>raster </type> <parameter>rast</parameter> </paramdef> <paramdef> " 19583"<type>integer </type> <parameter>nband</parameter> </paramdef> <paramdef> " 19584"<type>geometry </type> <parameter>geommin</parameter> </paramdef> </" 19585"funcprototype> <funcprototype> <funcdef>boolean <function>ST_Intersects</" 19586"function></funcdef> <paramdef> <type>raster </type> <parameter>rast</" 19587"parameter> </paramdef> <paramdef> <type>geometry </type> <parameter>geommin</" 19588"parameter> </paramdef> <paramdef choice=\"opt\"> <type>integer </type> " 19589"<parameter>nband=NULL</parameter> </paramdef> </funcprototype> " 19590"<funcprototype> <funcdef>boolean <function>ST_Intersects</function></" 19591"funcdef> <paramdef> <type>geometry </type> <parameter>geommin</parameter> </" 19592"paramdef> <paramdef> <type>raster </type> <parameter>rast</parameter> </" 19593"paramdef> <paramdef choice=\"opt\"> <type>integer </type> " 19594"<parameter>nband=NULL</parameter> </paramdef> </funcprototype>" 19595 19596#. Tag: para 19597#: reference_raster.xml:10881 19598#, no-c-format 19599msgid "" 19600"Return true if raster rastA spatially intersects raster rastB. If the band " 19601"number is not provided (or set to NULL), only the convex hull of the raster " 19602"is considered in the test. If the band number is provided, only those pixels " 19603"with value (not NODATA) are considered in the test." 19604msgstr "" 19605 19606#. Tag: para 19607#: reference_raster.xml:10891 19608#, no-c-format 19609msgid "Enhanced: 2.0.0 support raster/raster intersects was introduced." 19610msgstr "" 19611 19612#. Tag: para 19613#: reference_raster.xml:10896 19614#, no-c-format 19615msgid "" 19616"Changed: 2.1.0 The behavior of the ST_Intersects(raster, geometry) variants " 19617"changed to match that of ST_Intersects(geometry, raster)." 19618msgstr "" 19619 19620#. Tag: programlisting 19621#: reference_raster.xml:10905 19622#, fuzzy, no-c-format 19623msgid "" 19624"-- different bands of same raster\n" 19625"SELECT ST_Intersects(rast, 2, rast, 3) FROM dummy_rast WHERE rid = 2;\n" 19626"\n" 19627" st_intersects\n" 19628"---------------\n" 19629" t" 19630msgstr "" 19631"SELECT ST_Width(rast) As rastwidth\n" 19632"FROM dummy_rast WHERE rid=1;\n" 19633"\n" 19634"rastwidth\n" 19635"----------------\n" 19636"10" 19637 19638#. Tag: para 19639#: reference_raster.xml:10910 19640#, no-c-format 19641msgid ", <xref linkend=\"RT_ST_Disjoint\"/>" 19642msgstr ", <xref linkend=\"RT_ST_Disjoint\"/>" 19643 19644#. Tag: refname 19645#: reference_raster.xml:10919 19646#, no-c-format 19647msgid "ST_Overlaps" 19648msgstr "ST_Overlaps" 19649 19650#. Tag: refpurpose 19651#: reference_raster.xml:10920 19652#, no-c-format 19653msgid "" 19654"Return true if raster rastA and rastB intersect but one does not completely " 19655"contain the other." 19656msgstr "" 19657 19658#. Tag: funcsynopsis 19659#: reference_raster.xml:10926 19660#, no-c-format 19661msgid "" 19662"<funcprototype> <funcdef>boolean <function>ST_Overlaps</function></funcdef> " 19663"<paramdef> <type>raster </type> <parameter>rastA</parameter> </paramdef> " 19664"<paramdef> <type>integer </type> <parameter>nbandA</parameter> </paramdef> " 19665"<paramdef> <type>raster </type> <parameter>rastB</parameter> </paramdef> " 19666"<paramdef> <type>integer </type> <parameter>nbandB</parameter> </paramdef> </" 19667"funcprototype> <funcprototype> <funcdef>boolean <function>ST_Overlaps</" 19668"function></funcdef> <paramdef> <type>raster </type> <parameter>rastA</" 19669"parameter> </paramdef> <paramdef> <type>raster </type> <parameter>rastB</" 19670"parameter> </paramdef> </funcprototype>" 19671msgstr "" 19672"<funcprototype> <funcdef>boolean <function>ST_Overlaps</function></funcdef> " 19673"<paramdef> <type>raster </type> <parameter>rastA</parameter> </paramdef> " 19674"<paramdef> <type>integer </type> <parameter>nbandA</parameter> </paramdef> " 19675"<paramdef> <type>raster </type> <parameter>rastB</parameter> </paramdef> " 19676"<paramdef> <type>integer </type> <parameter>nbandB</parameter> </paramdef> </" 19677"funcprototype> <funcprototype> <funcdef>boolean <function>ST_Overlaps</" 19678"function></funcdef> <paramdef> <type>raster </type> <parameter>rastA</" 19679"parameter> </paramdef> <paramdef> <type>raster </type> <parameter>rastB</" 19680"parameter> </paramdef> </funcprototype>" 19681 19682#. Tag: para 19683#: reference_raster.xml:10965 19684#, no-c-format 19685msgid "" 19686"Return true if raster rastA spatially overlaps raster rastB. This means that " 19687"rastA and rastB intersect but one does not completely contain the other. If " 19688"the band number is not provided (or set to NULL), only the convex hull of " 19689"the raster is considered in the test. If the band number is provided, only " 19690"those pixels with value (not NODATA) are considered in the test." 19691msgstr "" 19692 19693#. Tag: para 19694#: reference_raster.xml:10976 19695#, no-c-format 19696msgid "" 19697"To test the spatial relationship of a raster and a geometry, use ST_Polygon " 19698"on the raster, e.g. ST_Overlaps(ST_Polygon(raster), geometry)." 19699msgstr "" 19700 19701#. Tag: programlisting 19702#: reference_raster.xml:10987 19703#, no-c-format 19704msgid "" 19705"-- comparing different bands of same raster\n" 19706"SELECT ST_Overlaps(rast, 1, rast, 2) FROM dummy_rast WHERE rid = 2;\n" 19707"\n" 19708" st_overlaps\n" 19709"-------------\n" 19710" f" 19711msgstr "" 19712 19713#. Tag: refname 19714#: reference_raster.xml:10999 19715#, no-c-format 19716msgid "ST_Touches" 19717msgstr "ST_Touches" 19718 19719#. Tag: refpurpose 19720#: reference_raster.xml:11000 19721#, no-c-format 19722msgid "" 19723"Return true if raster rastA and rastB have at least one point in common but " 19724"their interiors do not intersect." 19725msgstr "" 19726 19727#. Tag: funcsynopsis 19728#: reference_raster.xml:11006 19729#, no-c-format 19730msgid "" 19731"<funcprototype> <funcdef>boolean <function>ST_Touches</function></funcdef> " 19732"<paramdef> <type>raster </type> <parameter>rastA</parameter> </paramdef> " 19733"<paramdef> <type>integer </type> <parameter>nbandA</parameter> </paramdef> " 19734"<paramdef> <type>raster </type> <parameter>rastB</parameter> </paramdef> " 19735"<paramdef> <type>integer </type> <parameter>nbandB</parameter> </paramdef> </" 19736"funcprototype> <funcprototype> <funcdef>boolean <function>ST_Touches</" 19737"function></funcdef> <paramdef> <type>raster </type> <parameter>rastA</" 19738"parameter> </paramdef> <paramdef> <type>raster </type> <parameter>rastB</" 19739"parameter> </paramdef> </funcprototype>" 19740msgstr "" 19741"<funcprototype> <funcdef>boolean <function>ST_Touches</function></funcdef> " 19742"<paramdef> <type>raster </type> <parameter>rastA</parameter> </paramdef> " 19743"<paramdef> <type>integer </type> <parameter>nbandA</parameter> </paramdef> " 19744"<paramdef> <type>raster </type> <parameter>rastB</parameter> </paramdef> " 19745"<paramdef> <type>integer </type> <parameter>nbandB</parameter> </paramdef> </" 19746"funcprototype> <funcprototype> <funcdef>boolean <function>ST_Touches</" 19747"function></funcdef> <paramdef> <type>raster </type> <parameter>rastA</" 19748"parameter> </paramdef> <paramdef> <type>raster </type> <parameter>rastB</" 19749"parameter> </paramdef> </funcprototype>" 19750 19751#. Tag: para 19752#: reference_raster.xml:11045 19753#, no-c-format 19754msgid "" 19755"Return true if raster rastA spatially touches raster rastB. This means that " 19756"rastA and rastB have at least one point in common but their interiors do not " 19757"intersect. If the band number is not provided (or set to NULL), only the " 19758"convex hull of the raster is considered in the test. If the band number is " 19759"provided, only those pixels with value (not NODATA) are considered in the " 19760"test." 19761msgstr "" 19762 19763#. Tag: para 19764#: reference_raster.xml:11056 19765#, no-c-format 19766msgid "" 19767"To test the spatial relationship of a raster and a geometry, use ST_Polygon " 19768"on the raster, e.g. ST_Touches(ST_Polygon(raster), geometry)." 19769msgstr "" 19770 19771#. Tag: programlisting 19772#: reference_raster.xml:11067 19773#, fuzzy, no-c-format 19774msgid "" 19775"SELECT r1.rid, r2.rid, ST_Touches(r1.rast, 1, r2.rast, 1) FROM dummy_rast r1 " 19776"CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 19777"\n" 19778" rid | rid | st_touches\n" 19779"-----+-----+------------\n" 19780" 2 | 1 | f\n" 19781" 2 | 2 | f" 19782msgstr "" 19783"SELECT r1.rid, r2.rid, ST_Touches(r1.rast, 1, r2.rast, 1) FROM dummy_rast r1 " 19784"CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 19785"\n" 19786" rid | rid | st_touches \n" 19787"-----+-----+------------\n" 19788" 2 | 1 | f\n" 19789" 2 | 2 | f" 19790 19791#. Tag: refname 19792#: reference_raster.xml:11079 19793#, no-c-format 19794msgid "ST_SameAlignment" 19795msgstr "ST_SameAlignment" 19796 19797#. Tag: refpurpose 19798#: reference_raster.xml:11081 19799#, no-c-format 19800msgid "" 19801"Returns true if rasters have same skew, scale, spatial ref, and offset " 19802"(pixels can be put on same grid without cutting into pixels) and false if " 19803"they don't with notice detailing issue." 19804msgstr "" 19805 19806#. Tag: funcsynopsis 19807#: reference_raster.xml:11085 19808#, no-c-format 19809msgid "" 19810"<funcprototype> <funcdef>boolean <function>ST_SameAlignment</function></" 19811"funcdef> <paramdef> <type>raster </type> <parameter>rastA</parameter> </" 19812"paramdef> <paramdef> <type>raster </type> <parameter>rastB</parameter> </" 19813"paramdef> </funcprototype> <funcprototype> <funcdef>boolean " 19814"<function>ST_SameAlignment</function></funcdef> <paramdef> <type>double " 19815"precision </type> <parameter>ulx1</parameter> </paramdef> <paramdef> " 19816"<type>double precision </type> <parameter>uly1</parameter> </paramdef> " 19817"<paramdef> <type>double precision </type> <parameter>scalex1</parameter> </" 19818"paramdef> <paramdef> <type>double precision </type> <parameter>scaley1</" 19819"parameter> </paramdef> <paramdef> <type>double precision </type> " 19820"<parameter>skewx1</parameter> </paramdef> <paramdef> <type>double precision " 19821"</type> <parameter>skewy1</parameter> </paramdef> <paramdef> <type>double " 19822"precision </type> <parameter>ulx2</parameter> </paramdef> <paramdef> " 19823"<type>double precision </type> <parameter>uly2</parameter> </paramdef> " 19824"<paramdef> <type>double precision </type> <parameter>scalex2</parameter> </" 19825"paramdef> <paramdef> <type>double precision </type> <parameter>scaley2</" 19826"parameter> </paramdef> <paramdef> <type>double precision </type> " 19827"<parameter>skewx2</parameter> </paramdef> <paramdef> <type>double precision " 19828"</type> <parameter>skewy2</parameter> </paramdef> </funcprototype> " 19829"<funcprototype> <funcdef>boolean <function>ST_SameAlignment</function></" 19830"funcdef> <paramdef> <type>raster set </type> <parameter>rastfield</" 19831"parameter> </paramdef> </funcprototype>" 19832msgstr "" 19833"<funcprototype> <funcdef>boolean <function>ST_SameAlignment</function></" 19834"funcdef> <paramdef> <type>raster </type> <parameter>rastA</parameter> </" 19835"paramdef> <paramdef> <type>raster </type> <parameter>rastB</parameter> </" 19836"paramdef> </funcprototype> <funcprototype> <funcdef>boolean " 19837"<function>ST_SameAlignment</function></funcdef> <paramdef> <type>double " 19838"precision </type> <parameter>ulx1</parameter> </paramdef> <paramdef> " 19839"<type>double precision </type> <parameter>uly1</parameter> </paramdef> " 19840"<paramdef> <type>double precision </type> <parameter>scalex1</parameter> </" 19841"paramdef> <paramdef> <type>double precision </type> <parameter>scaley1</" 19842"parameter> </paramdef> <paramdef> <type>double precision </type> " 19843"<parameter>skewx1</parameter> </paramdef> <paramdef> <type>double precision " 19844"</type> <parameter>skewy1</parameter> </paramdef> <paramdef> <type>double " 19845"precision </type> <parameter>ulx2</parameter> </paramdef> <paramdef> " 19846"<type>double precision </type> <parameter>uly2</parameter> </paramdef> " 19847"<paramdef> <type>double precision </type> <parameter>scalex2</parameter> </" 19848"paramdef> <paramdef> <type>double precision </type> <parameter>scaley2</" 19849"parameter> </paramdef> <paramdef> <type>double precision </type> " 19850"<parameter>skewx2</parameter> </paramdef> <paramdef> <type>double precision " 19851"</type> <parameter>skewy2</parameter> </paramdef> </funcprototype> " 19852"<funcprototype> <funcdef>boolean <function>ST_SameAlignment</function></" 19853"funcdef> <paramdef> <type>raster set </type> <parameter>rastfield</" 19854"parameter> </paramdef> </funcprototype>" 19855 19856#. Tag: para 19857#: reference_raster.xml:11164 19858#, no-c-format 19859msgid "" 19860"Non-Aggregate version (Variants 1 and 2): Returns true if the two rasters " 19861"(either provided directly or made using the values for upperleft, scale, " 19862"skew and srid) have the same scale, skew, srid and at least one of any of " 19863"the four corners of any pixel of one raster falls on any corner of the grid " 19864"of the other raster. Returns false if they don't and a NOTICE detailing the " 19865"alignment issue." 19866msgstr "" 19867 19868#. Tag: para 19869#: reference_raster.xml:11168 19870#, no-c-format 19871msgid "" 19872"Aggregate version (Variant 3): From a set of rasters, returns true if all " 19873"rasters in the set are aligned. The ST_SameAlignment() function is an " 19874"\"aggregate\" function in the terminology of PostgreSQL. That means that it " 19875"operates on rows of data, in the same way the SUM() and AVG() functions do." 19876msgstr "" 19877 19878#. Tag: para 19879#: reference_raster.xml:11173 19880#, no-c-format 19881msgid "Enhanced: 2.1.0 addition of Aggegrate variant" 19882msgstr "" 19883 19884#. Tag: title 19885#: reference_raster.xml:11177 19886#, no-c-format 19887msgid "Examples: Rasters" 19888msgstr "" 19889 19890#. Tag: programlisting 19891#: reference_raster.xml:11179 19892#, no-c-format 19893msgid "" 19894"SELECT ST_SameAlignment(\n" 19895" ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0),\n" 19896" ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0)\n" 19897") as sm;\n" 19898"\n" 19899"sm\n" 19900"----\n" 19901"t" 19902msgstr "" 19903"SELECT ST_SameAlignment(\n" 19904" ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0),\n" 19905" ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0)\n" 19906") as sm;\n" 19907"\n" 19908"sm\n" 19909"----\n" 19910"t" 19911 19912#. Tag: programlisting 19913#: reference_raster.xml:11180 19914#, no-c-format 19915msgid "" 19916"SELECT ST_SameAlignment(A.rast,b.rast)\n" 19917" FROM dummy_rast AS A CROSS JOIN dummy_rast AS B;\n" 19918"\n" 19919" NOTICE: The two rasters provided have different SRIDs\n" 19920"NOTICE: The two rasters provided have different SRIDs\n" 19921" st_samealignment\n" 19922"------------------\n" 19923" t\n" 19924" f\n" 19925" f\n" 19926" f" 19927msgstr "" 19928"SELECT ST_SameAlignment(A.rast,b.rast)\n" 19929" FROM dummy_rast AS A CROSS JOIN dummy_rast AS B;\n" 19930"\n" 19931" NOTA: I due raster forniti hanno SRID differenti\n" 19932"\n" 19933" st_samealignment\n" 19934"------------------\n" 19935" t\n" 19936" f\n" 19937" f\n" 19938" f" 19939 19940#. Tag: para 19941#: reference_raster.xml:11184 19942#, no-c-format 19943msgid "" 19944", <xref linkend=\"RT_ST_NotSameAlignmentReason\"/>, <xref linkend=" 19945"\"RT_ST_MakeEmptyRaster\"/>" 19946msgstr "" 19947 19948#. Tag: refname 19949#: reference_raster.xml:11194 19950#, no-c-format 19951msgid "ST_NotSameAlignmentReason" 19952msgstr "" 19953 19954#. Tag: refpurpose 19955#: reference_raster.xml:11195 19956#, no-c-format 19957msgid "" 19958"<refpurpose>Returns text stating if rasters are aligned and if not aligned, " 19959"a reason why.</refpurpose>" 19960msgstr "" 19961 19962#. Tag: funcprototype 19963#: reference_raster.xml:11200 19964#, no-c-format 19965msgid "" 19966"<funcdef>text <function>ST_NotSameAlignmentReason</function></funcdef> " 19967"<paramdef><type>raster </type><parameter>rastA</parameter></paramdef> " 19968"<paramdef><type>raster </type><parameter>rastB</parameter></paramdef>" 19969msgstr "" 19970 19971#. Tag: para 19972#: reference_raster.xml:11210 19973#, no-c-format 19974msgid "" 19975"<para>Returns text stating if rasters are aligned and if not aligned, a " 19976"reason why.</para>" 19977msgstr "" 19978 19979#. Tag: para 19980#: reference_raster.xml:11213 19981#, no-c-format 19982msgid "" 19983"If there are several reasons why the rasters are not aligned, only one " 19984"reason (the first test to fail) will be returned." 19985msgstr "" 19986 19987#. Tag: programlisting 19988#: reference_raster.xml:11223 19989#, no-c-format 19990msgid "" 19991"SELECT\n" 19992" ST_SameAlignment(\n" 19993" ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0),\n" 19994" ST_MakeEmptyRaster(1, 1, 0, 0, 1.1, 1.1, 0, 0)\n" 19995" ),\n" 19996" ST_NotSameAlignmentReason(\n" 19997" ST_MakeEmptyRaster(1, 1, 0, 0, 1, 1, 0, 0),\n" 19998" ST_MakeEmptyRaster(1, 1, 0, 0, 1.1, 1.1, 0, 0)\n" 19999" )\n" 20000";\n" 20001"\n" 20002" st_samealignment | st_notsamealignmentreason\n" 20003"------------------+-------------------------------------------------\n" 20004" f | The rasters have different scales on the X axis\n" 20005"(1 row)" 20006msgstr "" 20007 20008#. Tag: para 20009#: reference_raster.xml:11228 20010#, no-c-format 20011msgid ", <xref linkend=\"RT_ST_SameAlignment\"/>" 20012msgstr "" 20013 20014#. Tag: refname 20015#: reference_raster.xml:11237 20016#, no-c-format 20017msgid "ST_Within" 20018msgstr "ST_Within" 20019 20020#. Tag: refpurpose 20021#: reference_raster.xml:11238 20022#, no-c-format 20023msgid "" 20024"Return true if no points of raster rastA lie in the exterior of raster rastB " 20025"and at least one point of the interior of rastA lies in the interior of " 20026"rastB." 20027msgstr "" 20028 20029#. Tag: funcsynopsis 20030#: reference_raster.xml:11244 20031#, no-c-format 20032msgid "" 20033"<funcprototype> <funcdef>boolean <function>ST_Within</function></funcdef> " 20034"<paramdef> <type>raster </type> <parameter>rastA</parameter> </paramdef> " 20035"<paramdef> <type>integer </type> <parameter>nbandA</parameter> </paramdef> " 20036"<paramdef> <type>raster </type> <parameter>rastB</parameter> </paramdef> " 20037"<paramdef> <type>integer </type> <parameter>nbandB</parameter> </paramdef> </" 20038"funcprototype> <funcprototype> <funcdef>boolean <function>ST_Within</" 20039"function></funcdef> <paramdef> <type>raster </type> <parameter>rastA</" 20040"parameter> </paramdef> <paramdef> <type>raster </type> <parameter>rastB</" 20041"parameter> </paramdef> </funcprototype>" 20042msgstr "" 20043"<funcprototype> <funcdef>boolean <function>ST_Within</function></funcdef> " 20044"<paramdef> <type>raster </type> <parameter>rastA</parameter> </paramdef> " 20045"<paramdef> <type>integer </type> <parameter>nbandA</parameter> </paramdef> " 20046"<paramdef> <type>raster </type> <parameter>rastB</parameter> </paramdef> " 20047"<paramdef> <type>integer </type> <parameter>nbandB</parameter> </paramdef> </" 20048"funcprototype> <funcprototype> <funcdef>boolean <function>ST_Within</" 20049"function></funcdef> <paramdef> <type>raster </type> <parameter>rastA</" 20050"parameter> </paramdef> <paramdef> <type>raster </type> <parameter>rastB</" 20051"parameter> </paramdef> </funcprototype>" 20052 20053#. Tag: para 20054#: reference_raster.xml:11283 20055#, no-c-format 20056msgid "" 20057"Raster rastA is within rastB if and only if no points of rastA lie in the " 20058"exterior of rastB and at least one point of the interior of rastA lies in " 20059"the interior of rastB. If the band number is not provided (or set to NULL), " 20060"only the convex hull of the raster is considered in the test. If the band " 20061"number is provided, only those pixels with value (not NODATA) are considered " 20062"in the test." 20063msgstr "" 20064 20065#. Tag: para 20066#: reference_raster.xml:11294 20067#, no-c-format 20068msgid "" 20069"To test the spatial relationship of a raster and a geometry, use ST_Polygon " 20070"on the raster, e.g. ST_Within(ST_Polygon(raster), geometry) or " 20071"ST_Within(geometry, ST_Polygon(raster))." 20072msgstr "" 20073 20074#. Tag: para 20075#: reference_raster.xml:11300 20076#, no-c-format 20077msgid "" 20078"ST_Within() is the inverse of ST_Contains(). So, ST_Within(rastA, rastB) " 20079"implies ST_Contains(rastB, rastA)." 20080msgstr "" 20081 20082#. Tag: programlisting 20083#: reference_raster.xml:11311 20084#, fuzzy, no-c-format 20085msgid "" 20086"SELECT r1.rid, r2.rid, ST_Within(r1.rast, 1, r2.rast, 1) FROM dummy_rast r1 " 20087"CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 20088"\n" 20089" rid | rid | st_within\n" 20090"-----+-----+-----------\n" 20091" 2 | 1 | f\n" 20092" 2 | 2 | t" 20093msgstr "" 20094"SELECT r1.rid, r2.rid, ST_Within(r1.rast, 1, r2.rast, 1) FROM dummy_rast r1 " 20095"CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 20096"\n" 20097" rid | rid | st_within \n" 20098"-----+-----+-----------\n" 20099" 2 | 1 | f\n" 20100" 2 | 2 | t" 20101 20102#. Tag: para 20103#: reference_raster.xml:11315 20104#, no-c-format 20105msgid "" 20106", <xref linkend=\"RT_ST_Contains\"/>, <xref linkend=\"RT_ST_DWithin\"/>, " 20107"<xref linkend=\"RT_ST_DFullyWithin\"/>" 20108msgstr "" 20109", <xref linkend=\"RT_ST_Contains\"/>, <xref linkend=\"RT_ST_DWithin\"/>, " 20110"<xref linkend=\"RT_ST_DFullyWithin\"/>" 20111 20112#. Tag: refname 20113#: reference_raster.xml:11326 20114#, no-c-format 20115msgid "ST_DWithin" 20116msgstr "ST_DWithin" 20117 20118#. Tag: refpurpose 20119#: reference_raster.xml:11327 20120#, no-c-format 20121msgid "" 20122"Return true if rasters rastA and rastB are within the specified distance of " 20123"each other." 20124msgstr "" 20125"Return true if rasters rastA and rastB are within the specified distance of " 20126"each other." 20127 20128#. Tag: funcsynopsis 20129#: reference_raster.xml:11333 20130#, no-c-format 20131msgid "" 20132"<funcprototype> <funcdef>boolean <function>ST_DWithin</function></funcdef> " 20133"<paramdef> <type>raster </type> <parameter>rastA</parameter> </paramdef> " 20134"<paramdef> <type>integer </type> <parameter>nbandA</parameter> </paramdef> " 20135"<paramdef> <type>raster </type> <parameter>rastB</parameter> </paramdef> " 20136"<paramdef> <type>integer </type> <parameter>nbandB</parameter> </paramdef> " 20137"<paramdef> <type>double precision </type> <parameter>distance_of_srid</" 20138"parameter> </paramdef> </funcprototype> <funcprototype> <funcdef>boolean " 20139"<function>ST_DWithin</function></funcdef> <paramdef> <type>raster </type> " 20140"<parameter>rastA</parameter> </paramdef> <paramdef> <type>raster </type> " 20141"<parameter>rastB</parameter> </paramdef> <paramdef> <type>double precision </" 20142"type> <parameter>distance_of_srid</parameter> </paramdef> </funcprototype>" 20143msgstr "" 20144"<funcprototype> <funcdef>boolean <function>ST_DWithin</function></funcdef> " 20145"<paramdef> <type>raster </type> <parameter>rastA</parameter> </paramdef> " 20146"<paramdef> <type>integer </type> <parameter>nbandA</parameter> </paramdef> " 20147"<paramdef> <type>raster </type> <parameter>rastB</parameter> </paramdef> " 20148"<paramdef> <type>integer </type> <parameter>nbandB</parameter> </paramdef> " 20149"<paramdef> <type>double precision </type> <parameter>distance_of_srid</" 20150"parameter> </paramdef> </funcprototype> <funcprototype> <funcdef>boolean " 20151"<function>ST_DWithin</function></funcdef> <paramdef> <type>raster </type> " 20152"<parameter>rastA</parameter> </paramdef> <paramdef> <type>raster </type> " 20153"<parameter>rastB</parameter> </paramdef> <paramdef> <type>double precision </" 20154"type> <parameter>distance_of_srid</parameter> </paramdef> </funcprototype>" 20155 20156#. Tag: para 20157#: reference_raster.xml:11380 20158#, no-c-format 20159msgid "" 20160"Return true if rasters rastA and rastB are within the specified distance of " 20161"each other. If the band number is not provided (or set to NULL), only the " 20162"convex hull of the raster is considered in the test. If the band number is " 20163"provided, only those pixels with value (not NODATA) are considered in the " 20164"test." 20165msgstr "" 20166 20167#. Tag: para 20168#: reference_raster.xml:11384 reference_raster.xml:11477 20169#, no-c-format 20170msgid "" 20171"The distance is specified in units defined by the spatial reference system " 20172"of the rasters. For this function to make sense, the source rasters must " 20173"both be of the same coordinate projection, having the same SRID." 20174msgstr "" 20175 20176#. Tag: para 20177#: reference_raster.xml:11395 20178#, no-c-format 20179msgid "" 20180"To test the spatial relationship of a raster and a geometry, use ST_Polygon " 20181"on the raster, e.g. ST_DWithin(ST_Polygon(raster), geometry)." 20182msgstr "" 20183 20184#. Tag: programlisting 20185#: reference_raster.xml:11406 20186#, fuzzy, no-c-format 20187msgid "" 20188"SELECT r1.rid, r2.rid, ST_DWithin(r1.rast, 1, r2.rast, 1, 3.14) FROM " 20189"dummy_rast r1 CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 20190"\n" 20191" rid | rid | st_dwithin\n" 20192"-----+-----+------------\n" 20193" 2 | 1 | f\n" 20194" 2 | 2 | t" 20195msgstr "" 20196"SELECT r1.rid, r2.rid, ST_DWithin(r1.rast, 1, r2.rast, 1, 3.14) FROM " 20197"dummy_rast r1 CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 20198"\n" 20199" rid | rid | st_dwithin \n" 20200"-----+-----+------------\n" 20201" 2 | 1 | f\n" 20202" 2 | 2 | t" 20203 20204#. Tag: para 20205#: reference_raster.xml:11410 20206#, no-c-format 20207msgid ", <xref linkend=\"RT_ST_DFullyWithin\"/>" 20208msgstr ", <xref linkend=\"RT_ST_DFullyWithin\"/>" 20209 20210#. Tag: refname 20211#: reference_raster.xml:11419 20212#, no-c-format 20213msgid "ST_DFullyWithin" 20214msgstr "ST_DFullyWithin" 20215 20216#. Tag: refpurpose 20217#: reference_raster.xml:11420 20218#, no-c-format 20219msgid "" 20220"Return true if rasters rastA and rastB are fully within the specified " 20221"distance of each other." 20222msgstr "" 20223 20224#. Tag: funcsynopsis 20225#: reference_raster.xml:11426 20226#, no-c-format 20227msgid "" 20228"<funcprototype> <funcdef>boolean <function>ST_DFullyWithin</function></" 20229"funcdef> <paramdef> <type>raster </type> <parameter>rastA</parameter> </" 20230"paramdef> <paramdef> <type>integer </type> <parameter>nbandA</parameter> </" 20231"paramdef> <paramdef> <type>raster </type> <parameter>rastB</parameter> </" 20232"paramdef> <paramdef> <type>integer </type> <parameter>nbandB</parameter> </" 20233"paramdef> <paramdef> <type>double precision </type> " 20234"<parameter>distance_of_srid</parameter> </paramdef> </funcprototype> " 20235"<funcprototype> <funcdef>boolean <function>ST_DFullyWithin</function></" 20236"funcdef> <paramdef> <type>raster </type> <parameter>rastA</parameter> </" 20237"paramdef> <paramdef> <type>raster </type> <parameter>rastB</parameter> </" 20238"paramdef> <paramdef> <type>double precision </type> " 20239"<parameter>distance_of_srid</parameter> </paramdef> </funcprototype>" 20240msgstr "" 20241"<funcprototype> <funcdef>boolean <function>ST_DFullyWithin</function></" 20242"funcdef> <paramdef> <type>raster </type> <parameter>rastA</parameter> </" 20243"paramdef> <paramdef> <type>integer </type> <parameter>nbandA</parameter> </" 20244"paramdef> <paramdef> <type>raster </type> <parameter>rastB</parameter> </" 20245"paramdef> <paramdef> <type>integer </type> <parameter>nbandB</parameter> </" 20246"paramdef> <paramdef> <type>double precision </type> " 20247"<parameter>distance_of_srid</parameter> </paramdef> </funcprototype> " 20248"<funcprototype> <funcdef>boolean <function>ST_DFullyWithin</function></" 20249"funcdef> <paramdef> <type>raster </type> <parameter>rastA</parameter> </" 20250"paramdef> <paramdef> <type>raster </type> <parameter>rastB</parameter> </" 20251"paramdef> <paramdef> <type>double precision </type> " 20252"<parameter>distance_of_srid</parameter> </paramdef> </funcprototype>" 20253 20254#. Tag: para 20255#: reference_raster.xml:11473 20256#, no-c-format 20257msgid "" 20258"Return true if rasters rastA and rastB are fully within the specified " 20259"distance of each other. If the band number is not provided (or set to NULL), " 20260"only the convex hull of the raster is considered in the test. If the band " 20261"number is provided, only those pixels with value (not NODATA) are considered " 20262"in the test." 20263msgstr "" 20264 20265#. Tag: para 20266#: reference_raster.xml:11488 20267#, no-c-format 20268msgid "" 20269"To test the spatial relationship of a raster and a geometry, use ST_Polygon " 20270"on the raster, e.g. ST_DFullyWithin(ST_Polygon(raster), geometry)." 20271msgstr "" 20272 20273#. Tag: programlisting 20274#: reference_raster.xml:11499 20275#, fuzzy, no-c-format 20276msgid "" 20277"SELECT r1.rid, r2.rid, ST_DFullyWithin(r1.rast, 1, r2.rast, 1, 3.14) FROM " 20278"dummy_rast r1 CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 20279"\n" 20280" rid | rid | st_dfullywithin\n" 20281"-----+-----+-----------------\n" 20282" 2 | 1 | f\n" 20283" 2 | 2 | t" 20284msgstr "" 20285"SELECT r1.rid, r2.rid, ST_DFullyWithin(r1.rast, 1, r2.rast, 1, 3.14) FROM " 20286"dummy_rast r1 CROSS JOIN dummy_rast r2 WHERE r1.rid = 2;\n" 20287"\n" 20288" rid | rid | st_dfullywithin \n" 20289"-----+-----+-----------------\n" 20290" 2 | 1 | f\n" 20291" 2 | 2 | t" 20292 20293#. Tag: para 20294#: reference_raster.xml:11503 20295#, no-c-format 20296msgid ", <xref linkend=\"RT_ST_DWithin\"/>" 20297msgstr ", <xref linkend=\"RT_ST_DWithin\"/>" 20298 20299#. Tag: para 20300#: reference_raster.xml:11515 20301#, no-c-format 20302msgid "" 20303"This section documents various gotchas and tips related to PostGIS Raster." 20304msgstr "" 20305 20306#. Tag: title 20307#: reference_raster.xml:11518 20308#, no-c-format 20309msgid "Raster Tips" 20310msgstr "" 20311 20312#. Tag: title 20313#: reference_raster.xml:11521 20314#, no-c-format 20315msgid "Out-DB Rasters" 20316msgstr "" 20317 20318#. Tag: title 20319#: reference_raster.xml:11524 20320#, no-c-format 20321msgid "Directory containing many files" 20322msgstr "" 20323 20324#. Tag: para 20325#: reference_raster.xml:11525 20326#, no-c-format 20327msgid "" 20328"When GDAL opens a file, GDAL eagerly scans the directory of that file to " 20329"build a catalog of other files. If this directory contains many files (e.g. " 20330"thousands, millions), opening that file becomes extremely slow (especially " 20331"if that file happens to be on a network drive such as NFS)." 20332msgstr "" 20333 20334#. Tag: para 20335#: reference_raster.xml:11528 20336#, no-c-format 20337msgid "" 20338"To control this behavior, GDAL provides the following environment variable: " 20339"<ulink url=\"https://trac.osgeo.org/gdal/wiki/" 20340"ConfigOptions#GDAL_DISABLE_READDIR_ON_OPEN\">GDAL_DISABLE_READDIR_ON_OPEN</" 20341"ulink>. Set <varname>GDAL_DISABLE_READDIR_ON_OPEN</varname> to " 20342"<varname>TRUE</varname> to disable directory scanning." 20343msgstr "" 20344 20345#. Tag: para 20346#: reference_raster.xml:11532 20347#, no-c-format 20348msgid "" 20349"In Ubuntu (and assuming you are using PostgreSQL's packages for Ubuntu), " 20350"<varname>GDAL_DISABLE_READDIR_ON_OPEN</varname> can be set in <emphasis>/etc/" 20351"postgresql/POSTGRESQL_VERSION/CLUSTER_NAME/environment</emphasis> (where " 20352"POSTGRESQL_VERSION is the version of PostgreSQL, e.g. 9.6 and CLUSTER_NAME " 20353"is the name of the cluster, e.g. maindb). You can also set PostGIS " 20354"environment variables here as well." 20355msgstr "" 20356 20357#. Tag: programlisting 20358#: reference_raster.xml:11535 20359#, no-c-format 20360msgid "" 20361"# environment variables for postmaster process\n" 20362"# This file has the same syntax as postgresql.conf:\n" 20363"# VARIABLE = simple_value\n" 20364"# VARIABLE2 = 'any value!'\n" 20365"# I. e. you need to enclose any value which does not only consist of " 20366"letters,\n" 20367"# numbers, and '-', '_', '.' in single quotes. Shell commands are not\n" 20368"# evaluated.\n" 20369"POSTGIS_GDAL_ENABLED_DRIVERS = 'ENABLE_ALL'\n" 20370"\n" 20371"POSTGIS_ENABLE_OUTDB_RASTERS = 1\n" 20372"\n" 20373"<emphasis role=\"strong\">GDAL_DISABLE_READDIR_ON_OPEN = 'TRUE'</emphasis>" 20374msgstr "" 20375 20376#. Tag: title 20377#: reference_raster.xml:11541 20378#, no-c-format 20379msgid "Maximum Number of Open Files" 20380msgstr "" 20381 20382#. Tag: para 20383#: reference_raster.xml:11543 20384#, no-c-format 20385msgid "" 20386"The maximum number of open files permitted by Linux and PostgreSQL are " 20387"typically conservative (typically 1024 open files per process) given the " 20388"assumption that the system is consumed by human users. For Out-DB Rasters, a " 20389"single valid query can easily exceed this limit (e.g. a dataset of 10 year's " 20390"worth of rasters with one raster for each day containing minimum and maximum " 20391"temperatures and we want to know the absolute min and max value for a pixel " 20392"in that dataset)." 20393msgstr "" 20394 20395#. Tag: para 20396#: reference_raster.xml:11547 20397#, no-c-format 20398msgid "" 20399"The easiest change to make is the following PostgreSQL setting: <ulink url=" 20400"\"https://www.postgresql.org/docs/current/static/runtime-config-resource." 20401"html#GUC-MAX-FILES-PER-PROCESS\">max_files_per_process</ulink>. The default " 20402"is set to 1000, which is far too low for Out-DB Rasters. A safe starting " 20403"value could be 65536 but this really depends on your datasets and the " 20404"queries run against those datasets. This setting can only be made on server " 20405"start and probably only in the PostgreSQL configuration file (e.g. " 20406"<emphasis>/etc/postgresql/POSTGRESQL_VERSION/CLUSTER_NAME/postgresql.conf</" 20407"emphasis> in Ubuntu environments)." 20408msgstr "" 20409 20410#. Tag: programlisting 20411#: reference_raster.xml:11550 20412#, no-c-format 20413msgid "" 20414"...\n" 20415"# - Kernel Resource Usage -\n" 20416"\n" 20417"<emphasis role=\"strong\">max_files_per_process = 65536</emphasis> " 20418"# min 25\n" 20419" # (change requires restart)\n" 20420"..." 20421msgstr "" 20422 20423#. Tag: para 20424#: reference_raster.xml:11553 20425#, no-c-format 20426msgid "" 20427"The major change to make is the Linux kernel's open files limits. There are " 20428"two parts to this:" 20429msgstr "" 20430 20431#. Tag: para 20432#: reference_raster.xml:11557 20433#, no-c-format 20434msgid "<para>Maximum number of open files for the entire system</para>" 20435msgstr "" 20436 20437#. Tag: para 20438#: reference_raster.xml:11560 20439#, no-c-format 20440msgid "<para>Maximum number of open files per process</para>" 20441msgstr "" 20442 20443#. Tag: title 20444#: reference_raster.xml:11566 20445#, no-c-format 20446msgid "<title>Maximum number of open files for the entire system</title>" 20447msgstr "" 20448 20449#. Tag: para 20450#: reference_raster.xml:11568 20451#, no-c-format 20452msgid "" 20453"You can inspect the current maximum number of open files for the entire " 20454"system with the following example:" 20455msgstr "" 20456 20457#. Tag: programlisting 20458#: reference_raster.xml:11572 20459#, no-c-format 20460msgid "" 20461"$ sysctl -a | grep fs.file-max\n" 20462"fs.file-max = 131072" 20463msgstr "" 20464 20465#. Tag: para 20466#: reference_raster.xml:11574 20467#, no-c-format 20468msgid "" 20469"If the value returned is not large enough, add a file to <emphasis>/etc/" 20470"sysctl.d/</emphasis> as per the following example:" 20471msgstr "" 20472 20473#. Tag: programlisting 20474#: reference_raster.xml:11578 20475#, no-c-format 20476msgid "" 20477"$ echo \"fs.file-max = 6145324\" >> /etc/sysctl.d/fs.conf\n" 20478"\n" 20479"$ cat /etc/sysctl.d/fs.conf\n" 20480"fs.file-max = 6145324\n" 20481"\n" 20482"$ sysctl -p --system\n" 20483"* Applying /etc/sysctl.d/fs.conf ...\n" 20484"fs.file-max = 2097152\n" 20485"* Applying /etc/sysctl.conf ...\n" 20486"\n" 20487"$ sysctl -a | grep fs.file-max\n" 20488"fs.file-max = 6145324" 20489msgstr "" 20490 20491#. Tag: title 20492#: reference_raster.xml:11582 20493#, no-c-format 20494msgid "<title>Maximum number of open files per process</title>" 20495msgstr "" 20496 20497#. Tag: para 20498#: reference_raster.xml:11584 20499#, no-c-format 20500msgid "" 20501"We need to increase the maximum number of open files per process for the " 20502"PostgreSQL server processes." 20503msgstr "" 20504 20505#. Tag: para 20506#: reference_raster.xml:11588 20507#, no-c-format 20508msgid "" 20509"To see what the current PostgreSQL service processes are using for maximum " 20510"number of open files, do as per the following example (make sure to have " 20511"PostgreSQL running):" 20512msgstr "" 20513 20514#. Tag: programlisting 20515#: reference_raster.xml:11592 20516#, no-c-format 20517msgid "" 20518"$ ps aux | grep postgres\n" 20519"postgres 31713 0.0 0.4 179012 17564 pts/0 S Dec26 0:03 /home/" 20520"dustymugs/devel/postgresql/sandbox/10/usr/local/bin/postgres -D /home/" 20521"dustymugs/devel/postgresql/sandbox/10/pgdata\n" 20522"postgres 31716 0.0 0.8 179776 33632 ? Ss Dec26 0:01 postgres: " 20523"checkpointer process\n" 20524"postgres 31717 0.0 0.2 179144 9416 ? Ss Dec26 0:05 postgres: " 20525"writer process\n" 20526"postgres 31718 0.0 0.2 179012 8708 ? Ss Dec26 0:06 postgres: " 20527"wal writer process\n" 20528"postgres 31719 0.0 0.1 179568 7252 ? Ss Dec26 0:03 postgres: " 20529"autovacuum launcher process\n" 20530"postgres 31720 0.0 0.1 34228 4124 ? Ss Dec26 0:09 postgres: " 20531"stats collector process\n" 20532"postgres 31721 0.0 0.1 179308 6052 ? Ss Dec26 0:00 postgres: " 20533"bgworker: logical replication launcher\n" 20534"\n" 20535"$ cat /proc/31718/limits\n" 20536"Limit Soft Limit Hard Limit Units\n" 20537"Max cpu time unlimited unlimited seconds\n" 20538"Max file size unlimited unlimited bytes\n" 20539"Max data size unlimited unlimited bytes\n" 20540"Max stack size 8388608 unlimited bytes\n" 20541"Max core file size 0 unlimited bytes\n" 20542"Max resident set unlimited unlimited bytes\n" 20543"Max processes 15738 15738 " 20544"processes\n" 20545"<emphasis role=\"strong\">Max open files 1024 " 20546"4096 files</emphasis>\n" 20547"Max locked memory 65536 65536 bytes\n" 20548"Max address space unlimited unlimited bytes\n" 20549"Max file locks unlimited unlimited locks\n" 20550"Max pending signals 15738 15738 signals\n" 20551"Max msgqueue size 819200 819200 bytes\n" 20552"Max nice priority 0 0\n" 20553"Max realtime priority 0 0\n" 20554"Max realtime timeout unlimited unlimited us" 20555msgstr "" 20556 20557#. Tag: para 20558#: reference_raster.xml:11594 20559#, no-c-format 20560msgid "" 20561"In the example above, we inspected the open files limit for Process 31718. " 20562"It doesn't matter which PostgreSQL process, any of them will do. The " 20563"response we are interested in is <emphasis>Max open files</emphasis>." 20564msgstr "" 20565 20566#. Tag: para 20567#: reference_raster.xml:11598 20568#, no-c-format 20569msgid "" 20570"We want to increase <emphasis>Soft Limit</emphasis> and <emphasis>Hard " 20571"Limit</emphasis> of <emphasis>Max open files</emphasis> to be greater than " 20572"the value we specified for the PostgreSQL setting " 20573"<varname>max_files_per_process</varname>. In our example, we set " 20574"<varname>max_files_per_process</varname> to 65536." 20575msgstr "" 20576 20577#. Tag: para 20578#: reference_raster.xml:11602 20579#, no-c-format 20580msgid "" 20581"In Ubuntu (and assuming you are using PostgreSQL's packages for Ubuntu), the " 20582"easiest way to change the <emphasis>Soft Limit</emphasis> and <emphasis>Hard " 20583"Limit</emphasis> is to edit <emphasis role=\"strong\">/etc/init.d/" 20584"postgresql</emphasis> (SysV) or <emphasis role=\"strong\">/lib/systemd/" 20585"system/postgresql*.service</emphasis> (systemd)." 20586msgstr "" 20587 20588#. Tag: para 20589#: reference_raster.xml:11606 20590#, no-c-format 20591msgid "" 20592"Let's first address the SysV Ubuntu case where we add <emphasis role=\"strong" 20593"\">ulimit -H -n 262144</emphasis> and <emphasis role=\"strong\">ulimit -n " 20594"131072</emphasis> to <emphasis role=\"strong\">/etc/init.d/postgresql</" 20595"emphasis>." 20596msgstr "" 20597 20598#. Tag: programlisting 20599#: reference_raster.xml:11610 20600#, no-c-format 20601msgid "" 20602"...\n" 20603"case \"$1\" in\n" 20604" start|stop|restart|reload)\n" 20605" if [ \"$1\" = \"start\" ]; then\n" 20606" create_socket_directory\n" 20607" fi\n" 20608" if [ -z \"`pg_lsclusters -h`\" ]; then\n" 20609" log_warning_msg 'No PostgreSQL clusters exist; see \"man " 20610"pg_createcluster\"'\n" 20611" exit 0\n" 20612" fi\n" 20613"<emphasis role=\"strong\">\n" 20614" ulimit -H -n 262144\n" 20615" ulimit -n 131072\n" 20616"</emphasis>\n" 20617" for v in $versions; do\n" 20618" $1 $v || EXIT=$?\n" 20619" done\n" 20620" exit ${EXIT:-0}\n" 20621" ;;\n" 20622" status)\n" 20623"..." 20624msgstr "" 20625 20626#. Tag: para 20627#: reference_raster.xml:11612 20628#, no-c-format 20629msgid "" 20630"Now to address the systemd Ubuntu case. We will add <emphasis role=\"strong" 20631"\">LimitNOFILE=131072</emphasis> to every <emphasis role=\"strong\">/lib/" 20632"systemd/system/postgresql*.service</emphasis> file in the <emphasis role=" 20633"\"strong\">[Service]</emphasis> section." 20634msgstr "" 20635 20636#. Tag: programlisting 20637#: reference_raster.xml:11616 20638#, no-c-format 20639msgid "" 20640"...\n" 20641"[Service]\n" 20642"<emphasis role=\"strong\">\n" 20643"LimitNOFILE=131072\n" 20644"</emphasis>\n" 20645"...\n" 20646"\n" 20647"[Install]\n" 20648"WantedBy=multi-user.target\n" 20649"..." 20650msgstr "" 20651 20652#. Tag: para 20653#: reference_raster.xml:11618 20654#, no-c-format 20655msgid "" 20656"After making the necessary systemd changes, make sure to reload the daemon" 20657msgstr "" 20658 20659#. Tag: programlisting 20660#: reference_raster.xml:11622 20661#, no-c-format 20662msgid "systemctl daemon-reload" 20663msgstr "" 20664 20665#~ msgid "ST_MapAlgebra" 20666#~ msgstr "ST_MapAlgebra" 20667 20668#~ msgid "" 20669#~ "<funcdef>record <function>ST_BandMetaData</function></funcdef> " 20670#~ "<paramdef><type>raster </type><parameter>rast</parameter></paramdef> " 20671#~ "<paramdef choice=\"opt\"><type>integer </type><parameter>bandnum=1</" 20672#~ "parameter></paramdef>" 20673#~ msgstr "" 20674#~ "<funcdef>record <function>ST_BandMetaData</function></funcdef> " 20675#~ "<paramdef><type>raster </type><parameter>rast</parameter></paramdef> " 20676#~ "<paramdef choice=\"opt\"><type>integer </type><parameter>bandnum=1</" 20677#~ "parameter></paramdef>" 20678 20679#~ msgid "" 20680#~ "<funcdef>geometry <function>ST_PixelAsPoints</function></funcdef> " 20681#~ "<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 20682#~ "<paramdef choice=\"opt\"><type>integer </type> <parameter>band=1</" 20683#~ "parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 20684#~ "<parameter>exclude_nodata_value=TRUE</parameter></paramdef>" 20685#~ msgstr "" 20686#~ "<funcdef>geometry <function>ST_PixelAsPoints</function></funcdef> " 20687#~ "<paramdef><type>raster </type> <parameter>rast</parameter></paramdef> " 20688#~ "<paramdef choice=\"opt\"><type>integer </type> <parameter>band=1</" 20689#~ "parameter></paramdef> <paramdef choice=\"opt\"><type>boolean </type> " 20690#~ "<parameter>exclude_nodata_value=TRUE</parameter></paramdef>" 20691 20692#~ msgid "JPEG Output Examples" 20693#~ msgstr "Esempio di uscita JPEG" 20694