<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi, Konstantinos,
<div class=""><br class="">
</div>
<div class="">I’d recommend asking your question on the postgis-specific mailing list:</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span><a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" class="">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></div>
<div class=""><br class="">
</div>
<div class="">You’re likely to get a better response there.</div>
<div class=""><br class="">
</div>
<div class="">This list is for discussion “about the Open Source Geospatial Foundation (OSGeo) in general”.</div>
<div class=""><br class="">
</div>
<div class="">— Andy</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Feb 9, 2017, at 1:59 AM, Karamanlis Konstantinos <<a href="mailto:konkaramanlis@gmail.com" class="">konkaramanlis@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class=""><br class="">
<div class="gmail_quote">
<div dir="ltr" class="">
<div class="">
<div class="">Hi to eveyrone,<br class="">
<br class="">
</div>
my name is Konstantinos and I am new both in the mailing list and postgis. My field is electrical engineering and currently I m working on modelling of power networks. A sugnificant part of my work deals with spatial data. I have a question concerning an issue
(explain it below) and would like to ask for your opinion. The processing is done in 2 database from which I extract the following part of grids:
<br class="">
<br class="">
<span id="cid:ii_iyx1xf8z2_15a1e212d032f917"><pepe.jpg></span><br class="">
<br class="">
</div>
<br class="">
<div class="">Both pictures illustrate the same object. The blue is considered to be the valid one, while the green contains missing data. Therefore my aim is to compare the geometries of the lines of both grids and find similarities. For example the lines
of the third image can be considers as identical and hence tha blue data can be copyed to the green. To mention that both databases have column with the geometries of the lines. I am running the following:<br class="">
<br class="">
<pre class="m_-2005620091781540490gmail-m_3961686253516418805gmail-prettyprint m_-2005620091781540490gmail-m_3961686253516418805gmail-prettyprinted m_-2005620091781540490gmail-m_3961686253516418805gmail-lang-sql"><font size="4" class=""><code class=""><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-kwd">create</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln"> </span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-kwd">index</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln"> geom_1_idx </span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-kwd">ON</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln"> table1 </span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-kwd">USING</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln"> GIST </span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pun">(</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln">geometry_1</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pun">);<br class=""></span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln"></span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-kwd">select</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln"> table1_id</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pun">,</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln"> table2_id </span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-kwd">from</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln"> table1 t1</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pun">,</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln"> table2 t2
</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-kwd">where</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln"> </span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pun">(</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-kwd">select</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln"> st_DWithin</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pun">(</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln">t1</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pun">.</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln">geometry_2 </span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pun">,</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln"> t2</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pun">.</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln">geometry_2</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pun">,</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln"> units_of_srid</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pun">)</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln"> </span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pun">=</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pln"> true</span><span class="m_-2005620091781540490gmail-m_3961686253516418805gmail-pun">)</span></code></font></pre>
<br class="">
</div>
<div class=""> I used spatial indexing according to your guidelines (<a href="http://revenant.ca/www/postgis/workshop/indexing.html" target="_blank" class="">http://revenant.ca/www/<wbr class="">postgis/workshop/indexing.html</a><wbr class="">). As far I have
understood by this code, I compare the bounding boxes of the lines and if the distance between the boxes is not higher than "units_of_srid", then the two geometries are considered identical.
<br class="">
<br class="">
</div>
<div class="">My first question is if it s right what I wrote. How can I improve this in order not to miss "identical" lines?<br class="">
<br class="">
</div>
<div class="">Thank you in advance and for your understanding.<br class="">
</div>
<div class="">Looking forward for your comments and corrections.<br class="">
<br class="">
</div>
<div class="">Kind regards,<br class="">
<br class="">
</div>
<div class="">Konstantinos <br class="">
</div>
<div class=""><br class="">
<br class="">
</div>
</div>
</div>
<br class="">
</div>
_______________________________________________<br class="">
Discuss mailing list<br class="">
<a href="mailto:Discuss@lists.osgeo.org" class="">Discuss@lists.osgeo.org</a><br class="">
https://lists.osgeo.org/mailman/listinfo/discuss</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>