/usr/share/doc/postgresql-9.5-pgrouting-doc/html/en/src/common/doc/functions/create_vert_table.html is in postgresql-9.5-pgrouting-doc 2.1.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pgr_createVerticesTable — pgRouting Manual (2.1.0)</title>
<link rel="stylesheet" href="../../../../_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../../../',
VERSION: '2.1.0 (b38118a master)',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../../_static/doctools.js"></script>
<script type="text/javascript" src="../../../../_static/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="shortcut icon" href="../../../../_static/favicon.ico"/>
<link rel="top" title="pgRouting Manual (2.1.0)" href="../../../../doc/index.html" />
<link rel="up" title="Topology Functions" href="index.html" />
<link rel="next" title="pgr_analyzeGraph" href="analyze_graph.html" />
<link rel="prev" title="pgr_createTopology" href="create_topology.html" />
</head>
<body role="document">
<div class="header" role="banner"><img class="rightlogo" src="../../../../_static/pgrouting.png" alt="Logo"/><h1 class="heading"><a href="../../../../index.html">
<span>pgRouting Manual (2.1.0)</span></a></h1>
<h2 class="heading"><span>pgr_createVerticesTable</span></h2>
</div>
<div class="topnav" role="navigation" aria-label="top navigation">
<p>
«  <a href="create_topology.html">pgr_createTopology</a>
  ::  
<a class="uplink" href="../../../../doc/index.html">Contents</a>
  ::  
<a href="analyze_graph.html">pgr_analyzeGraph</a>  »
</p>
</div>
<div class="content">
<div class="section" id="pgr-createverticestable">
<span id="pgr-create-vert-table"></span><h1>pgr_createVerticesTable<a class="headerlink" href="#pgr-createverticestable" title="Permalink to this headline">¶</a></h1>
<div class="section" id="name">
<span id="index-0"></span><h2>Name<a class="headerlink" href="#name" title="Permalink to this headline">¶</a></h2>
<p><code class="docutils literal"><span class="pre">pgr_createVerticesTable</span></code> — Reconstructs the vertices table based on the source and target information.</p>
</div>
<div class="section" id="synopsis">
<h2>Synopsis<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2>
<p>The function returns:</p>
<blockquote>
<div><ul class="simple">
<li><code class="docutils literal"><span class="pre">OK</span></code> after the vertices table has been reconstructed.</li>
<li><code class="docutils literal"><span class="pre">FAIL</span></code> when the vertices table was not reconstructed due to an error.</li>
</ul>
</div></blockquote>
<div class="highlight-sql"><div class="highlight"><pre><span class="nb">varchar</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="nb">text</span> <span class="n">edge_table</span><span class="p">,</span> <span class="nb">text</span> <span class="n">the_geom</span><span class="p">:</span><span class="o">=</span><span class="s1">'the_geom'</span>
<span class="nb">text</span> <span class="k">source</span><span class="p">:</span><span class="o">=</span><span class="s1">'source'</span><span class="p">,</span><span class="nb">text</span> <span class="n">target</span><span class="p">:</span><span class="o">=</span><span class="s1">'target'</span><span class="p">,</span><span class="nb">text</span> <span class="n">rows_where</span><span class="p">:</span><span class="o">=</span><span class="s1">'true'</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p class="rubric">Parameters</p>
<p>The reconstruction of the vertices table function accepts the following parameters:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">edge_table:</th><td class="field-body"><code class="docutils literal"><span class="pre">text</span></code> Network table name. (may contain the schema name as well)</td>
</tr>
<tr class="field-even field"><th class="field-name">the_geom:</th><td class="field-body"><code class="docutils literal"><span class="pre">text</span></code> Geometry column name of the network table. Default value is <code class="docutils literal"><span class="pre">the_geom</span></code>.</td>
</tr>
<tr class="field-odd field"><th class="field-name">source:</th><td class="field-body"><code class="docutils literal"><span class="pre">text</span></code> Source column name of the network table. Default value is <code class="docutils literal"><span class="pre">source</span></code>.</td>
</tr>
<tr class="field-even field"><th class="field-name">target:</th><td class="field-body"><code class="docutils literal"><span class="pre">text</span></code> Target column name of the network table. Default value is <code class="docutils literal"><span class="pre">target</span></code>.</td>
</tr>
<tr class="field-odd field"><th class="field-name">rows_where:</th><td class="field-body"><code class="docutils literal"><span class="pre">text</span></code> Condition to SELECT a subset or rows. Default value is <code class="docutils literal"><span class="pre">true</span></code> to indicate all rows.</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p>The <code class="docutils literal"><span class="pre">edge_table</span></code> will be affected</p>
<blockquote class="last">
<div><ul>
<li><p class="first">An index will be created, if it doesn’t exists, to speed up the process to the following columns:</p>
<blockquote>
<div><ul class="simple">
<li><code class="docutils literal"><span class="pre">the_geom</span></code></li>
<li><code class="docutils literal"><span class="pre">source</span></code></li>
<li><code class="docutils literal"><span class="pre">target</span></code></li>
</ul>
</div></blockquote>
</li>
</ul>
</div></blockquote>
</div>
<p>The function returns:</p>
<blockquote>
<div><ul class="simple">
<li><code class="docutils literal"><span class="pre">OK</span></code> after the vertices table has been reconstructed.<ul>
<li>Creates a vertices table: <edge_table>_vertices_pgr.</li>
<li>Fills <code class="docutils literal"><span class="pre">id</span></code> and <code class="docutils literal"><span class="pre">the_geom</span></code> columns of the vertices table based on the source and target columns of the edge table.</li>
</ul>
</li>
<li><code class="docutils literal"><span class="pre">FAIL</span></code> when the vertices table was not reconstructed due to an error.<ul>
<li>A required column of the Network table is not found or is not of the appropriate type.</li>
<li>The condition is not well formed.</li>
<li>The names of source, target are the same.</li>
<li>The SRID of the geometry could not be determined.</li>
</ul>
</li>
</ul>
</div></blockquote>
<p class="rubric">The Vertices Table</p>
<p>The vertices table is a requierment of the <a class="reference internal" href="analyze_graph.html#pgr-analyze-graph"><span>pgr_analyzeGraph</span></a> and the <a class="reference internal" href="analyze_oneway.html#pgr-analyze-oneway"><span>pgr_analyzeOneway</span></a> functions.</p>
<p>The structure of the vertices table is:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">id:</th><td class="field-body"><code class="docutils literal"><span class="pre">bigint</span></code> Identifier of the vertex.</td>
</tr>
<tr class="field-even field"><th class="field-name">cnt:</th><td class="field-body"><code class="docutils literal"><span class="pre">integer</span></code> Number of vertices in the edge_table that reference this vertex. See <a class="reference internal" href="analyze_graph.html#pgr-analyze-graph"><span>pgr_analyzeGraph</span></a>.</td>
</tr>
<tr class="field-odd field"><th class="field-name">chk:</th><td class="field-body"><code class="docutils literal"><span class="pre">integer</span></code> Indicator that the vertex might have a problem. See <a class="reference internal" href="analyze_graph.html#pgr-analyze-graph"><span>pgr_analyzeGraph</span></a>.</td>
</tr>
<tr class="field-even field"><th class="field-name">ein:</th><td class="field-body"><code class="docutils literal"><span class="pre">integer</span></code> Number of vertices in the edge_table that reference this vertex as incoming. See <a class="reference internal" href="analyze_oneway.html#pgr-analyze-oneway"><span>pgr_analyzeOneway</span></a>.</td>
</tr>
<tr class="field-odd field"><th class="field-name">eout:</th><td class="field-body"><code class="docutils literal"><span class="pre">integer</span></code> Number of vertices in the edge_table that reference this vertex as outgoing. See <a class="reference internal" href="analyze_oneway.html#pgr-analyze-oneway"><span>pgr_analyzeOneway</span></a>.</td>
</tr>
<tr class="field-even field"><th class="field-name">the_geom:</th><td class="field-body"><code class="docutils literal"><span class="pre">geometry</span></code> Point geometry of the vertex.</td>
</tr>
</tbody>
</table>
<p class="rubric">History</p>
<ul class="simple">
<li>Renamed in version 2.0.0</li>
</ul>
</div>
<div class="section" id="usage-when-the-edge-table-s-columns-match-the-default-values">
<h2>Usage when the edge table’s columns MATCH the default values:<a class="headerlink" href="#usage-when-the-edge-table-s-columns-match-the-default-values" title="Permalink to this headline">¶</a></h2>
<p class="rubric">The simplest way to use pgr_createVerticesTable is:</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'edge_table'</span><span class="p">);</span>
</pre></div>
</div>
<p class="rubric">When the arguments are given in the order described in the parameters:</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'edge_table'</span><span class="p">,</span><span class="s1">'the_geom'</span><span class="p">,</span><span class="s1">'source'</span><span class="p">,</span><span class="s1">'target'</span><span class="p">);</span>
</pre></div>
</div>
<p>We get the same result as the simplest way to use the function.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<div class="last line-block">
<div class="line">An error would occur when the arguments are not given in the appropriate order: In this example, the column source column <code class="docutils literal"><span class="pre">source</span></code> of the table <code class="docutils literal"><span class="pre">mytable</span></code> is passed to the function as the geometry column, and the geometry column <code class="docutils literal"><span class="pre">the_geom</span></code> is passed to the function as the source column.</div>
<div class="line"><code class="docutils literal"><span class="pre">SELECT</span> <span class="pre">pgr_createVerticesTable('edge_table','source','the_geom','target');</span></code></div>
</div>
</div>
<p class="rubric">When using the named notation</p>
<p>The order of the parameters do not matter:</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'edge_table'</span><span class="p">,</span><span class="n">the_geom</span><span class="p">:</span><span class="o">=</span><span class="s1">'the_geom'</span><span class="p">,</span><span class="k">source</span><span class="p">:</span><span class="o">=</span><span class="s1">'source'</span><span class="p">,</span><span class="n">target</span><span class="p">:</span><span class="o">=</span><span class="s1">'target'</span><span class="p">);</span>
</pre></div>
</div>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'edge_table'</span><span class="p">,</span><span class="k">source</span><span class="p">:</span><span class="o">=</span><span class="s1">'source'</span><span class="p">,</span><span class="n">target</span><span class="p">:</span><span class="o">=</span><span class="s1">'target'</span><span class="p">,</span><span class="n">the_geom</span><span class="p">:</span><span class="o">=</span><span class="s1">'the_geom'</span><span class="p">);</span>
</pre></div>
</div>
<p>Parameters defined with a default value can be omited, as long as the value matches the default:</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'edge_table'</span><span class="p">,</span><span class="k">source</span><span class="p">:</span><span class="o">=</span><span class="s1">'source'</span><span class="p">);</span>
</pre></div>
</div>
<p class="rubric">Selecting rows using rows_where parameter</p>
<p>Selecting rows based on the id.</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'edge_table'</span><span class="p">,</span><span class="n">rows_where</span><span class="p">:</span><span class="o">=</span><span class="s1">'id < 10'</span><span class="p">);</span>
</pre></div>
</div>
<p>Selecting the rows where the geometry is near the geometry of row with <code class="docutils literal"><span class="pre">id</span></code> =5 .</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'edge_table'</span><span class="p">,</span><span class="n">rows_where</span><span class="p">:</span><span class="o">=</span><span class="s1">'the_geom && (select st_buffer(the_geom,0.5) FROM edge_table WHERE id=5)'</span><span class="p">);</span>
</pre></div>
</div>
<p>Selecting the rows where the geometry is near the geometry of the row with <code class="docutils literal"><span class="pre">gid</span></code> =100 of the table <code class="docutils literal"><span class="pre">othertable</span></code>.</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">DROP</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">EXISTS</span> <span class="n">otherTable</span><span class="p">;</span>
<span class="k">CREATE</span> <span class="k">TABLE</span> <span class="n">otherTable</span> <span class="k">AS</span> <span class="p">(</span><span class="k">SELECT</span> <span class="mi">100</span> <span class="k">AS</span> <span class="n">gid</span><span class="p">,</span> <span class="n">st_point</span><span class="p">(</span><span class="mi">2</span><span class="p">.</span><span class="mi">5</span><span class="p">,</span><span class="mi">2</span><span class="p">.</span><span class="mi">5</span><span class="p">)</span> <span class="k">AS</span> <span class="n">other_geom</span><span class="p">)</span> <span class="p">;</span>
<span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'edge_table'</span><span class="p">,</span><span class="n">rows_where</span><span class="p">:</span><span class="o">=</span><span class="s1">'the_geom && (select st_buffer(othergeom,0.5) FROM otherTable WHERE gid=100)'</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="usage-when-the-edge-table-s-columns-do-not-match-the-default-values">
<h2>Usage when the edge table’s columns DO NOT MATCH the default values:<a class="headerlink" href="#usage-when-the-edge-table-s-columns-do-not-match-the-default-values" title="Permalink to this headline">¶</a></h2>
<p>For the following table</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">DROP</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">EXISTS</span> <span class="n">mytable</span><span class="p">;</span>
<span class="k">CREATE</span> <span class="k">TABLE</span> <span class="n">mytable</span> <span class="k">AS</span> <span class="p">(</span><span class="k">SELECT</span> <span class="n">id</span> <span class="k">AS</span> <span class="n">gid</span><span class="p">,</span> <span class="n">the_geom</span> <span class="k">AS</span> <span class="n">mygeom</span><span class="p">,</span><span class="k">source</span> <span class="k">AS</span> <span class="n">src</span> <span class="p">,</span><span class="n">target</span> <span class="k">AS</span> <span class="n">tgt</span> <span class="k">FROM</span> <span class="n">edge_table</span><span class="p">)</span> <span class="p">;</span>
</pre></div>
</div>
<p class="rubric">Using positional notation:</p>
<p>The arguments need to be given in the order described in the parameters:</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'mytable'</span><span class="p">,</span><span class="s1">'mygeom'</span><span class="p">,</span><span class="s1">'src'</span><span class="p">,</span><span class="s1">'tgt'</span><span class="p">);</span>
</pre></div>
</div>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<div class="last line-block">
<div class="line">An error would occur when the arguments are not given in the appropriate order: In this example, the column <code class="docutils literal"><span class="pre">src</span></code> of the table <code class="docutils literal"><span class="pre">mytable</span></code> is passed to the function as the geometry column, and the geometry column <code class="docutils literal"><span class="pre">mygeom</span></code> is passed to the function as the source column.</div>
<div class="line"><code class="docutils literal"><span class="pre">SELECT</span> <span class="pre">pgr_createVerticesTable('mytable','src','mygeom','tgt');</span></code></div>
</div>
</div>
<p class="rubric">When using the named notation</p>
<p>The order of the parameters do not matter:</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'mytable'</span><span class="p">,</span><span class="n">the_geom</span><span class="p">:</span><span class="o">=</span><span class="s1">'mygeom'</span><span class="p">,</span><span class="k">source</span><span class="p">:</span><span class="o">=</span><span class="s1">'src'</span><span class="p">,</span><span class="n">target</span><span class="p">:</span><span class="o">=</span><span class="s1">'tgt'</span><span class="p">);</span>
</pre></div>
</div>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'mytable'</span><span class="p">,</span><span class="k">source</span><span class="p">:</span><span class="o">=</span><span class="s1">'src'</span><span class="p">,</span><span class="n">target</span><span class="p">:</span><span class="o">=</span><span class="s1">'tgt'</span><span class="p">,</span><span class="n">the_geom</span><span class="p">:</span><span class="o">=</span><span class="s1">'mygeom'</span><span class="p">);</span>
</pre></div>
</div>
<p>In this scenario omitting a parameter would create an error because the default values for the column names do not match the column names of the table.</p>
<p class="rubric">Selecting rows using rows_where parameter</p>
<p>Selecting rows based on the gid.</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'mytable'</span><span class="p">,</span><span class="s1">'mygeom'</span><span class="p">,</span><span class="s1">'src'</span><span class="p">,</span><span class="s1">'tgt'</span><span class="p">,</span><span class="n">rows_where</span><span class="p">:</span><span class="o">=</span><span class="s1">'gid < 10'</span><span class="p">);</span>
</pre></div>
</div>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'mytable'</span><span class="p">,</span><span class="k">source</span><span class="p">:</span><span class="o">=</span><span class="s1">'src'</span><span class="p">,</span><span class="n">target</span><span class="p">:</span><span class="o">=</span><span class="s1">'tgt'</span><span class="p">,</span><span class="n">the_geom</span><span class="p">:</span><span class="o">=</span><span class="s1">'mygeom'</span><span class="p">,</span><span class="n">rows_where</span><span class="p">:</span><span class="o">=</span><span class="s1">'gid < 10'</span><span class="p">);</span>
</pre></div>
</div>
<p>Selecting the rows where the geometry is near the geometry of row with <code class="docutils literal"><span class="pre">gid</span></code> =5 .</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'mytable'</span><span class="p">,</span><span class="s1">'mygeom'</span><span class="p">,</span><span class="s1">'src'</span><span class="p">,</span><span class="s1">'tgt'</span><span class="p">,</span>
<span class="n">rows_where</span><span class="p">:</span><span class="o">=</span><span class="s1">'the_geom && (SELECT st_buffer(mygeom,0.5) FROM mytable WHERE gid=5)'</span><span class="p">);</span>
</pre></div>
</div>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'mytable'</span><span class="p">,</span><span class="k">source</span><span class="p">:</span><span class="o">=</span><span class="s1">'src'</span><span class="p">,</span><span class="n">target</span><span class="p">:</span><span class="o">=</span><span class="s1">'tgt'</span><span class="p">,</span><span class="n">the_geom</span><span class="p">:</span><span class="o">=</span><span class="s1">'mygeom'</span><span class="p">,</span>
<span class="n">rows_where</span><span class="p">:</span><span class="o">=</span><span class="s1">'mygeom && (SELECT st_buffer(mygeom,0.5) FROM mytable WHERE id=5)'</span><span class="p">);</span>
</pre></div>
</div>
<p>Selecting the rows where the geometry is near the geometry of the row with <code class="docutils literal"><span class="pre">gid</span></code> =100 of the table <code class="docutils literal"><span class="pre">othertable</span></code>.</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">DROP</span> <span class="k">TABLE</span> <span class="n">IF</span> <span class="k">EXISTS</span> <span class="n">otherTable</span><span class="p">;</span>
<span class="k">CREATE</span> <span class="k">TABLE</span> <span class="n">otherTable</span> <span class="k">AS</span> <span class="p">(</span><span class="k">SELECT</span> <span class="mi">100</span> <span class="k">AS</span> <span class="n">gid</span><span class="p">,</span> <span class="n">st_point</span><span class="p">(</span><span class="mi">2</span><span class="p">.</span><span class="mi">5</span><span class="p">,</span><span class="mi">2</span><span class="p">.</span><span class="mi">5</span><span class="p">)</span> <span class="k">AS</span> <span class="n">other_geom</span><span class="p">)</span> <span class="p">;</span>
<span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'mytable'</span><span class="p">,</span><span class="s1">'mygeom'</span><span class="p">,</span><span class="s1">'src'</span><span class="p">,</span><span class="s1">'tgt'</span><span class="p">,</span>
<span class="n">rows_where</span><span class="p">:</span><span class="o">=</span><span class="s1">'the_geom && (SELECT st_buffer(othergeom,0.5) FROM otherTable WHERE gid=100)'</span><span class="p">);</span>
</pre></div>
</div>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'mytable'</span><span class="p">,</span><span class="k">source</span><span class="p">:</span><span class="o">=</span><span class="s1">'src'</span><span class="p">,</span><span class="n">target</span><span class="p">:</span><span class="o">=</span><span class="s1">'tgt'</span><span class="p">,</span><span class="n">the_geom</span><span class="p">:</span><span class="o">=</span><span class="s1">'mygeom'</span><span class="p">,</span>
<span class="n">rows_where</span><span class="p">:</span><span class="o">=</span><span class="s1">'the_geom && (SELECT st_buffer(othergeom,0.5) FROM otherTable WHERE gid=100)'</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<div class="highlight-sql"><div class="highlight"><pre> <span class="k">SELECT</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'edge_table'</span><span class="p">);</span>
<span class="n">NOTICE</span><span class="p">:</span> <span class="n">PROCESSING</span><span class="p">:</span>
<span class="n">NOTICE</span><span class="p">:</span> <span class="n">pgr_createVerticesTable</span><span class="p">(</span><span class="s1">'edge_table'</span><span class="p">,</span><span class="s1">'the_geom'</span><span class="p">,</span><span class="s1">'source'</span><span class="p">,</span><span class="s1">'target'</span><span class="p">,</span><span class="s1">'true'</span><span class="p">)</span>
<span class="n">NOTICE</span><span class="p">:</span> <span class="n">Performing</span> <span class="n">checks</span><span class="p">,</span> <span class="n">pelase</span> <span class="n">wait</span> <span class="p">.....</span>
<span class="n">NOTICE</span><span class="p">:</span> <span class="n">Populating</span> <span class="k">public</span><span class="p">.</span><span class="n">edge_table_vertices_pgr</span><span class="p">,</span> <span class="n">please</span> <span class="n">wait</span><span class="p">...</span>
<span class="n">NOTICE</span><span class="p">:</span> <span class="c1">-----> VERTICES TABLE CREATED WITH 17 VERTICES</span>
<span class="n">NOTICE</span><span class="p">:</span> <span class="k">FOR</span> <span class="mi">18</span> <span class="n">EDGES</span>
<span class="n">NOTICE</span><span class="p">:</span> <span class="n">Edges</span> <span class="k">with</span> <span class="k">NULL</span> <span class="n">geometry</span><span class="p">,</span><span class="k">source</span> <span class="k">or</span> <span class="n">target</span><span class="p">:</span> <span class="mi">0</span>
<span class="n">NOTICE</span><span class="p">:</span> <span class="n">Edges</span> <span class="n">processed</span><span class="p">:</span> <span class="mi">18</span>
<span class="n">NOTICE</span><span class="p">:</span> <span class="n">Vertices</span> <span class="k">table</span> <span class="k">for</span> <span class="k">table</span> <span class="k">public</span><span class="p">.</span><span class="n">edge_table</span> <span class="k">is</span><span class="p">:</span> <span class="k">public</span><span class="p">.</span><span class="n">edge_table_vertices_pgr</span>
<span class="n">NOTICE</span><span class="p">:</span> <span class="c1">----------------------------------------------</span>
<span class="n">pgr_createVerticesTable</span>
<span class="c1">--------------------</span>
<span class="n">OK</span>
<span class="p">(</span><span class="mi">1</span> <span class="k">row</span><span class="p">)</span>
</pre></div>
</div>
<p>The example uses the <a class="reference internal" href="../../../../doc/src/developer/sampledata.html#sampledata"><span>Sample Data</span></a> network.</p>
</div>
<div class="section" id="see-also">
<h2>See Also<a class="headerlink" href="#see-also" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><a class="reference internal" href="../../../../doc/src/tutorial/topology.html#topology"><span>Routing Topology</span></a> for an overview of a topology for routing algorithms.</li>
<li><a class="reference internal" href="create_topology.html#pgr-create-topology"><span>pgr_createTopology</span></a> to create a topology based on the geometry.</li>
<li><a class="reference internal" href="analyze_graph.html#pgr-analyze-graph"><span>pgr_analyzeGraph</span></a> to analyze the edges and vertices of the edge table.</li>
<li><a class="reference internal" href="analyze_oneway.html#pgr-analyze-oneway"><span>pgr_analyzeOneway</span></a> to analyze directionality of the edges.</li>
</ul>
</div>
</div>
</div>
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
<p>
«  <a href="create_topology.html">pgr_createTopology</a>
  ::  
<a class="uplink" href="../../../../doc/index.html">Contents</a>
  ::  
<a href="analyze_graph.html">pgr_analyzeGraph</a>  »
</p>
</div>
<div class="footer" role="contentinfo">
© Copyright pgRouting Contributors - Version 2.1.0 (b38118a master).
Last updated on Feb 05, 2016.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.5.
</div>
</body>
</html>
|