1# SOME DESCRIPTIVE TITLE. 2# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 3# 4#, fuzzy 5msgid "" 6msgstr "" 7"Project-Id-Version: PACKAGE VERSION\n" 8"Report-Msgid-Bugs-To: https://bugs.kde.org\n" 9"POT-Creation-Date: 2020-12-15 04:51+0000\n" 10"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 11"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 12"Language-Team: LANGUAGE <kde-i18n-doc@kde.org>\n" 13"MIME-Version: 1.0\n" 14"Content-Type: text/plain; charset=UTF-8\n" 15"Content-Transfer-Encoding: 8bit\n" 16 17#. Tag: para 18#: reference_cluster.xml:5 19#, no-c-format 20msgid "These functions implement clustering algorithms for sets of geometries." 21msgstr "" 22 23#. Tag: title 24#: reference_cluster.xml:8 25#, no-c-format 26msgid "Clustering Functions" 27msgstr "" 28 29#. Tag: refname 30#: reference_cluster.xml:12 31#, no-c-format 32msgid "ST_ClusterDBSCAN" 33msgstr "" 34 35#. Tag: refpurpose 36#: reference_cluster.xml:14 37#, no-c-format 38msgid "" 39"Window function that returns a cluster id for each input geometry using the " 40"DBSCAN algorithm." 41msgstr "" 42 43#. Tag: funcprototype 44#: reference_cluster.xml:19 45#, no-c-format 46msgid "" 47"<funcdef>integer <function>ST_ClusterDBSCAN</function></funcdef> " 48"<paramdef><type>geometry winset </type> <parameter>geom</parameter></" 49"paramdef> <paramdef><type>float8 </type> <parameter>eps</parameter></" 50"paramdef> <paramdef><type>integer </type> <parameter>minpoints</parameter></" 51"paramdef>" 52msgstr "" 53 54#. Tag: title 55#: reference_cluster.xml:35 reference_cluster.xml:137 reference_cluster.xml:182 56#: reference_cluster.xml:265 57#, no-c-format 58msgid "Description" 59msgstr "" 60 61#. Tag: para 62#: reference_cluster.xml:37 63#, no-c-format 64msgid "" 65"Returns cluster number for each input geometry, based on a 2D implementation " 66"of the <ulink url=\"https://en.wikipedia.org/wiki/DBSCAN\">Density-based " 67"spatial clustering of applications with noise (DBSCAN)</ulink> algorithm. " 68"Unlike <xref linkend=\"ST_ClusterKMeans\"/>, it does not require the number " 69"of clusters to be specified, but instead uses the desired <link linkend=" 70"\"ST_Distance\">distance</link> (<varname>eps</varname>) and density " 71"(<varname>minpoints</varname>) parameters to construct each cluster." 72msgstr "" 73 74#. Tag: para 75#: reference_cluster.xml:44 76#, no-c-format 77msgid "An input geometry will be added to a cluster if it is either:" 78msgstr "" 79 80#. Tag: para 81#: reference_cluster.xml:48 82#, no-c-format 83msgid "" 84"A \"core\" geometry, that is within <varname>eps</varname> <link linkend=" 85"\"ST_Distance\">distance</link> of at least <varname>minpoints</varname> " 86"input geometries (including itself) or" 87msgstr "" 88 89#. Tag: para 90#: reference_cluster.xml:53 91#, no-c-format 92msgid "" 93"A \"border\" geometry, that is within <varname>eps</varname> <link linkend=" 94"\"ST_Distance\">distance</link> of a core geometry." 95msgstr "" 96 97#. Tag: para 98#: reference_cluster.xml:60 99#, no-c-format 100msgid "" 101"Note that border geometries may be within <varname>eps</varname> distance of " 102"core geometries in more than one cluster; in this case, either assignment " 103"would be correct, and the border geometry will be arbitrarily asssigned to " 104"one of the available clusters. In these cases, it is possible for a correct " 105"cluster to be generated with fewer than <varname>minpoints</varname> " 106"geometries. When assignment of a border geometry is ambiguous, repeated " 107"calls to ST_ClusterDBSCAN will produce identical results if an ORDER BY " 108"clause is included in the window definition, but cluster assignments may " 109"differ from other implementations of the same algorithm." 110msgstr "" 111 112#. Tag: para 113#: reference_cluster.xml:68 114#, no-c-format 115msgid "" 116"Input geometries that do not meet the criteria to join any other cluster " 117"will be assigned a cluster number of NULL." 118msgstr "" 119 120#. Tag: para 121#: reference_cluster.xml:72 reference_cluster.xml:191 122#, no-c-format 123msgid "Availability: 2.3.0" 124msgstr "" 125 126#. Tag: title 127#: reference_cluster.xml:76 reference_cluster.xml:145 reference_cluster.xml:195 128#: reference_cluster.xml:273 129#, no-c-format 130msgid "Examples" 131msgstr "" 132 133#. Tag: para 134#: reference_cluster.xml:77 135#, no-c-format 136msgid "" 137"Assigning a cluster number to each polygon within 50 meters of each other. " 138"Require at least 2 polygons per cluster" 139msgstr "" 140 141#. Tag: para 142#: reference_cluster.xml:89 143#, no-c-format 144msgid "within 50 meters at least 2 per cluster. singletons have NULL for cid" 145msgstr "" 146 147#. Tag: programlisting 148#: reference_cluster.xml:92 149#, no-c-format 150msgid "" 151"SELECT name, ST_ClusterDBSCAN(geom, eps := 50, minpoints := 2) over () AS " 152"cid\n" 153"FROM boston_polys\n" 154"WHERE name > '' AND building > ''\n" 155" AND ST_DWithin(geom,\n" 156" ST_Transform(\n" 157" ST_GeomFromText('POINT(-71.04054 42.35141)', 4326), 26986),\n" 158" 500);" 159msgstr "" 160 161#. Tag: screen 162#: reference_cluster.xml:95 163#, no-c-format 164msgid "" 165"<![CDATA[ name | bucket\n" 166"-------------------------------------+--------\n" 167" Manulife Tower | 0\n" 168" Park Lane Seaport I | 0\n" 169" Park Lane Seaport II | 0\n" 170" Renaissance Boston Waterfront Hotel | 0\n" 171" Seaport Boston Hotel | 0\n" 172" Seaport Hotel & World Trade Center | 0\n" 173" Waterside Place | 0\n" 174" World Trade Center East | 0\n" 175" 100 Northern Avenue | 1\n" 176" 100 Pier 4 | 1\n" 177" The Institute of Contemporary Art | 1\n" 178" 101 Seaport | 2\n" 179" District Hall | 2\n" 180" One Marina Park Drive | 2\n" 181" Twenty Two Liberty | 2\n" 182" Vertex | 2\n" 183" Vertex | 2\n" 184" Watermark Seaport | 2\n" 185" Blue Hills Bank Pavilion | NULL\n" 186" World Trade Center West | NULL\n" 187"(20 rows)]]>" 188msgstr "" 189 190#. Tag: para 191#: reference_cluster.xml:103 192#, no-c-format 193msgid "" 194"Combining parcels with the same cluster number into a single geometry. This " 195"uses named argument calling" 196msgstr "" 197 198#. Tag: programlisting 199#: reference_cluster.xml:106 200#, no-c-format 201msgid "" 202"SELECT cid, ST_Collect(geom) AS cluster_geom, array_agg(parcel_id) AS " 203"ids_in_cluster FROM (\n" 204" SELECT parcel_id, ST_ClusterDBSCAN(geom, eps := 0.5, minpoints := 5) " 205"over () AS cid, geom\n" 206" FROM parcels) sq\n" 207"GROUP BY cid;" 208msgstr "" 209 210#. Tag: title 211#: reference_cluster.xml:110 reference_cluster.xml:149 212#: reference_cluster.xml:238 reference_cluster.xml:277 213#, no-c-format 214msgid "See Also" 215msgstr "" 216 217#. Tag: para 218#: reference_cluster.xml:111 219#, no-c-format 220msgid "" 221", <xref linkend=\"ST_ClusterKMeans\"/>, <xref linkend=" 222"\"ST_ClusterIntersecting\"/>, <xref linkend=\"ST_ClusterWithin\"/>" 223msgstr "" 224 225#. Tag: refname 226#: reference_cluster.xml:122 227#, no-c-format 228msgid "ST_ClusterIntersecting" 229msgstr "" 230 231#. Tag: refpurpose 232#: reference_cluster.xml:124 233#, no-c-format 234msgid "" 235"Aggregate function that clusters the input geometries into connected sets." 236msgstr "" 237 238#. Tag: funcprototype 239#: reference_cluster.xml:129 240#, no-c-format 241msgid "" 242"<funcdef>geometry[] <function>ST_ClusterIntersecting</function></funcdef> " 243"<paramdef><type>geometry set</type> <parameter>g</parameter></paramdef>" 244msgstr "" 245 246#. Tag: para 247#: reference_cluster.xml:139 248#, no-c-format 249msgid "" 250"ST_ClusterIntersecting is an aggregate function that returns an array of " 251"GeometryCollections, where each GeometryCollection represents an " 252"interconnected set of geometries." 253msgstr "" 254 255#. Tag: para 256#: reference_cluster.xml:141 reference_cluster.xml:269 257#, no-c-format 258msgid "Availability: 2.2.0" 259msgstr "" 260 261#. Tag: programlisting 262#: reference_cluster.xml:146 263#, no-c-format 264msgid "" 265"WITH testdata AS\n" 266" (SELECT unnest(ARRAY['LINESTRING (0 0, 1 1)'::geometry,\n" 267" 'LINESTRING (5 5, 4 4)'::geometry,\n" 268" 'LINESTRING (6 6, 7 7)'::geometry,\n" 269" 'LINESTRING (0 0, -1 -1)'::geometry,\n" 270" 'POLYGON ((0 0, 4 0, 4 4, 0 4, 0 0))'::geometry]) AS " 271"geom)\n" 272"\n" 273"SELECT ST_AsText(unnest(ST_ClusterIntersecting(geom))) FROM testdata;\n" 274"\n" 275"--result\n" 276"\n" 277"st_astext\n" 278"---------\n" 279"GEOMETRYCOLLECTION(LINESTRING(0 0,1 1),LINESTRING(5 5,4 4),LINESTRING(0 0,-1 " 280"-1),POLYGON((0 0,4 0,4 4,0 4,0 0)))\n" 281"GEOMETRYCOLLECTION(LINESTRING(6 6,7 7))" 282msgstr "" 283 284#. Tag: para 285#: reference_cluster.xml:150 286#, no-c-format 287msgid "" 288", <xref linkend=\"ST_ClusterKMeans\"/>, <xref linkend=\"ST_ClusterWithin\"/>" 289msgstr "" 290 291#. Tag: refname 292#: reference_cluster.xml:162 293#, no-c-format 294msgid "ST_ClusterKMeans" 295msgstr "" 296 297#. Tag: refpurpose 298#: reference_cluster.xml:164 299#, no-c-format 300msgid "" 301"Window function that returns a cluster id for each input geometry using the " 302"K-means algorithm." 303msgstr "" 304 305#. Tag: funcprototype 306#: reference_cluster.xml:169 307#, no-c-format 308msgid "" 309"<funcdef>integer <function>ST_ClusterKMeans</function></funcdef> " 310"<paramdef><type>geometry winset </type> <parameter>geom</parameter></" 311"paramdef> <paramdef><type>integer </type> <parameter>number_of_clusters</" 312"parameter></paramdef>" 313msgstr "" 314 315#. Tag: para 316#: reference_cluster.xml:184 317#, no-c-format 318msgid "" 319"Returns 2D distance based <ulink url=\"https://en.wikipedia.org/wiki/K-" 320"means_clustering\">K-means</ulink> cluster number for each input geometry. " 321"The distance used for clustering is the distance between the centroids for " 322"2D geometries, and distance between bounding box centers for 3D geometries. " 323"For POINT inputs, M coordinate will be treated as weight of input and has to " 324"be larger than 0." 325msgstr "" 326 327#. Tag: para 328#: reference_cluster.xml:190 329#, no-c-format 330msgid "Enhanced: 3.1.0 Support for 3D geometries and weights" 331msgstr "" 332 333#. Tag: para 334#: reference_cluster.xml:196 335#, no-c-format 336msgid "Generate dummy set of parcels for examples" 337msgstr "" 338 339#. Tag: programlisting 340#: reference_cluster.xml:197 341#, no-c-format 342msgid "" 343"CREATE TABLE parcels AS\n" 344"SELECT lpad((row_number() over())::text,3,'0') As parcel_id, geom,\n" 345"('{residential, commercial}'::text[])[1 + mod(row_number()OVER(),2)] As " 346"type\n" 347"FROM\n" 348" ST_Subdivide(ST_Buffer('SRID=3857;LINESTRING(40 100, 98 100, 100 150, 60 " 349"90)'::geometry,\n" 350" 40, 'endcap=square'),12) As geom;" 351msgstr "" 352 353#. Tag: para 354#: reference_cluster.xml:209 355#, no-c-format 356msgid "Original Parcels" 357msgstr "" 358 359#. Tag: para 360#: reference_cluster.xml:219 361#, no-c-format 362msgid "Parcels color-coded by cluster number (cid)" 363msgstr "" 364 365#. Tag: programlisting 366#: reference_cluster.xml:222 367#, no-c-format 368msgid "" 369"SELECT ST_ClusterKMeans(geom, 5) OVER() AS cid, parcel_id, geom\n" 370"FROM parcels;\n" 371"-- result\n" 372" cid | parcel_id | geom\n" 373"-----+-----------+---------------\n" 374" 0 | 001 | 0103000000...\n" 375" 0 | 002 | 0103000000...\n" 376" 1 | 003 | 0103000000...\n" 377" 0 | 004 | 0103000000...\n" 378" 1 | 005 | 0103000000...\n" 379" 2 | 006 | 0103000000...\n" 380" 2 | 007 | 0103000000...\n" 381"(7 rows)" 382msgstr "" 383 384#. Tag: programlisting 385#: reference_cluster.xml:229 386#, no-c-format 387msgid "" 388"-- Partitioning parcel clusters by type\n" 389"SELECT ST_ClusterKMeans(geom,3) over (PARTITION BY type) AS cid, parcel_id, " 390"type\n" 391"FROM parcels;\n" 392"-- result\n" 393" cid | parcel_id | type\n" 394"-----+-----------+-------------\n" 395" 1 | 005 | commercial\n" 396" 1 | 003 | commercial\n" 397" 2 | 007 | commercial\n" 398" 0 | 001 | commercial\n" 399" 1 | 004 | residential\n" 400" 0 | 002 | residential\n" 401" 2 | 006 | residential\n" 402"(7 rows)" 403msgstr "" 404 405#. Tag: programlisting 406#: reference_cluster.xml:232 407#, no-c-format 408msgid "" 409"-- Clustering points around antimeridian can be done in 3D XYZ CRS, " 410"EPSG:4978:\n" 411"\n" 412"SELECT ST_ClusterKMeans(ST_Transform(ST_Force3D(geom), 4978), 3) over () AS " 413"cid, parcel_id, type\n" 414"FROM parcels;\n" 415"-- result\n" 416"┌─────┬───────────┬─────────────┐\n" 417"│ cid │ parcel_id │ type │\n" 418"├─────┼───────────┼─────────────┤\n" 419"│ 1 │ 001 │ commercial │\n" 420"│ 2 │ 002 │ residential │\n" 421"│ 0 │ 003 │ commercial │\n" 422"│ 1 │ 004 │ residential │\n" 423"│ 0 │ 005 │ commercial │\n" 424"│ 2 │ 006 │ residential │\n" 425"│ 0 │ 007 │ commercial │\n" 426"└─────┴───────────┴─────────────┘\n" 427"(7 rows)" 428msgstr "" 429 430#. Tag: para 431#: reference_cluster.xml:239 432#, no-c-format 433msgid "" 434", <xref linkend=\"ST_ClusterIntersecting\"/>, <xref linkend=" 435"\"ST_ClusterWithin\"/>, <xref linkend=\"ST_Subdivide\"/>" 436msgstr "" 437 438#. Tag: refname 439#: reference_cluster.xml:249 440#, no-c-format 441msgid "ST_ClusterWithin" 442msgstr "" 443 444#. Tag: refpurpose 445#: reference_cluster.xml:251 446#, no-c-format 447msgid "" 448"Aggregate function that clusters the input geometries by separation distance." 449msgstr "" 450 451#. Tag: funcprototype 452#: reference_cluster.xml:256 453#, no-c-format 454msgid "" 455"<funcdef>geometry[] <function>ST_ClusterWithin</function></funcdef> " 456"<paramdef><type>geometry set </type> <parameter>g</parameter></paramdef> " 457"<paramdef><type>float8 </type> <parameter>distance</parameter></paramdef>" 458msgstr "" 459 460#. Tag: para 461#: reference_cluster.xml:267 462#, no-c-format 463msgid "" 464"ST_ClusterWithin is an aggregate function that returns an array of " 465"GeometryCollections, where each GeometryCollection represents a set of " 466"geometries separated by no more than the specified distance. (Distances are " 467"Cartesian distances in the units of the SRID.)" 468msgstr "" 469 470#. Tag: programlisting 471#: reference_cluster.xml:274 472#, no-c-format 473msgid "" 474"WITH testdata AS\n" 475" (SELECT unnest(ARRAY['LINESTRING (0 0, 1 1)'::geometry,\n" 476" 'LINESTRING (5 5, 4 4)'::geometry,\n" 477" 'LINESTRING (6 6, 7 7)'::geometry,\n" 478" 'LINESTRING (0 0, -1 -1)'::geometry,\n" 479" 'POLYGON ((0 0, 4 0, 4 4, 0 4, 0 0))'::geometry]) AS " 480"geom)\n" 481"\n" 482"SELECT ST_AsText(unnest(ST_ClusterWithin(geom, 1.4))) FROM testdata;\n" 483"\n" 484"--result\n" 485"\n" 486"st_astext\n" 487"---------\n" 488"GEOMETRYCOLLECTION(LINESTRING(0 0,1 1),LINESTRING(5 5,4 4),LINESTRING(0 0,-1 " 489"-1),POLYGON((0 0,4 0,4 4,0 4,0 0)))\n" 490"GEOMETRYCOLLECTION(LINESTRING(6 6,7 7))" 491msgstr "" 492 493#. Tag: para 494#: reference_cluster.xml:278 495#, no-c-format 496msgid "" 497", <xref linkend=\"ST_ClusterKMeans\"/>, <xref linkend=" 498"\"ST_ClusterIntersecting\"/>" 499msgstr "" 500