<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi Tim, Zoltan<br>
    <br>
    Just a quick one with the query below.<br>
    <br>
    Will it not be easier to move both tables into postgis db.<br>
    Add empty lat and long columns to B then using SQL update the table
    to pull the data from A to B<br>
    something like:<br>
    <br>
    UPDATE B<br>
    SET B.long = A.long<br>
            B.Lat = A.lat<br>
    <br>
    From A <br>
    JOIN B <br>
    ON ST_Intersects(A.geom, B.geom)<br>
    <br>
    Would that not be an easier method?<br>
    <br>
    Regards<br>
    David<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 08/07/2016 12:37, Tim Sutton wrote:<br>
    </div>
    <blockquote
      cite="mid:8487A194-876F-4DDF-8F6E-32E8EADDA044@kartoza.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      Hi
      <div class=""><br class="">
        <div>
          <blockquote type="cite" class="">
            <div class="">On 08 Jul 2016, at 11:30 AM, Zoltan Szecsei
              <<a moz-do-not-send="true"
                href="mailto:zoltans@geograph.co.za" class="">zoltans@geograph.co.za</a>>
              wrote:</div>
            <br class="Apple-interchange-newline">
            <div class="">
              <meta content="text/html; charset=utf-8"
                http-equiv="Content-Type" class="">
              <div bgcolor="#FFFFFF" text="#000000" class=""> Hi again,<br
                  class="">
                OK - it's not an index thing. More than one 'a' polygon
                has received the 'b' attribute from the wrong 'b'
                polygon even though the coordinate is inside the correct
                'b' polygon.<br class="">
                <br class="">
                So the next step is to suspect the index.intersects
                result.<br class="">
              </div>
            </div>
          </blockquote>
          <div><br class="">
          </div>
          <div>Could you share a small testable dataset that replicates
            it? I made a noddy test dataset here when playing with it
            last night which worked fine, but it only had 2 polygons in
            it...</div>
          <br class="">
          <blockquote type="cite" class="">
            <div class="">
              <div bgcolor="#FFFFFF" text="#000000" class=""> Note the
                coords are in LatLong  "small numeric values. I can see
                we are using a null-length box (ie: a point) to select
                from 'b'.<br class="">
                What is the internal precision of the QgsPoint?<br
                  class="">
              </div>
            </div>
          </blockquote>
          <div><br class="">
          </div>
          <div>the x and y properties of QgsPoint are both doubles...it
            depends on your platform what that means but typically</div>
          <div><br class="">
          </div>
          <div><a moz-do-not-send="true"
              href="http://qgis.org/api/2.6/classQgsPoint.html" class="">http://qgis.org/api/2.6/classQgsPoint.html</a></div>
          <div><br class="">
          </div>
          <div>According to wikipedia on a 64 bit machine it should be:</div>
          <div><br class="">
          </div>
          <div>
            <ul style="margin: 0.3em 0px 0px 1.6em; padding: 0px;
              list-style-image:
              url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0A%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20version%3D%221.1%22%20width%3D%225%22%20height%3D%2213%22%3E%0A%3Ccircle%20cx%3D%222.5%22%20cy%3D%229.5%22%20r%3D%222.5%22%20fill%3D%22%2300528c%22%2F%3E%0A%3C%2Fsvg%3E%0A);
              color: rgb(37, 37, 37); font-family: sans-serif;
              font-size: 14px;" class="">
              <li style="margin-bottom: 0.1em;" class=""><a
                  moz-do-not-send="true"
                  href="https://en.wikipedia.org/wiki/Sign_bit"
                  title="Sign bit" style="text-decoration: none; color:
                  rgb(11, 0, 128); background-image: none;
                  background-position: initial initial;
                  background-repeat: initial initial;" class="">Sign bit</a>:
                1 bit</li>
              <li style="margin-bottom: 0.1em;" class=""><a
                  moz-do-not-send="true"
                  href="https://en.wikipedia.org/wiki/Exponent"
                  class="mw-redirect" title="Exponent"
                  style="text-decoration: none; color: rgb(11, 0, 128);
                  background-image: none; background-position: initial
                  initial; background-repeat: initial initial;">Exponent</a> width:
                11 bits</li>
              <li style="margin-bottom: 0.1em;" class=""><a
                  moz-do-not-send="true"
                  href="https://en.wikipedia.org/wiki/Significand"
                  title="Significand" style="text-decoration: none;
                  color: rgb(11, 0, 128); background-image: none;
                  background-position: initial initial;
                  background-repeat: initial initial;" class="">Significand</a> <a
                  moz-do-not-send="true"
                  href="https://en.wikipedia.org/wiki/Precision_%28arithmetic%29"
                  class="mw-redirect" title="Precision (arithmetic)"
                  style="text-decoration: none; color: rgb(11, 0, 128);
                  background-image: none; background-position: initial
                  initial; background-repeat: initial initial;">precision</a>:
                53 bits (52 explicitly stored)</li>
            </ul>
            <div class=""><br class="">
            </div>
            <div class=""><br class="">
            </div>
          </div>
          <br class="">
          <blockquote type="cite" class="">
            <div class="">
              <div bgcolor="#FFFFFF" text="#000000" class=""> My coord
                attributes are 'double Real 19,10' <br class="">
                <br class="">
                In a script, when you select with a point, what is the
                snapping tolerance?<br class="">
              </div>
            </div>
          </blockquote>
          <div><br class="">
          </div>
          <div>To use snapping you would need to use the QGIS snapping
            api - otherwise absolute geometry operations are being done.</div>
          <br class="">
          <blockquote type="cite" class="">
            <div class="">
              <div bgcolor="#FFFFFF" text="#000000" class="">My project
                CRS is epsg 4326 - so it should be OK.<br class="">
              </div>
            </div>
          </blockquote>
          <div><br class="">
          </div>
          <div>Yup. If you wanted to be fancy, you could extract a layer
            of the tie points (FptnLat. FptnLong) so that you can
            actually visualise the points in relation to the polygons.
            Maybe you have some that don't actually intersect a poly...</div>
          <br class="">
          <blockquote type="cite" class="">
            <div class="">
              <div bgcolor="#FFFFFF" text="#000000" class=""> <br
                  class="">
                FWIW, b.name is string 60 which is copied into a.name
                string 32  -  but the contents are shorter that 32
                chars.<br class="">
              </div>
            </div>
          </blockquote>
          <div><br class="">
          </div>
          <div>I think QGIS will just truncate it if the name is longer
            than 32 chars.</div>
          <div><br class="">
          </div>
          <div>T</div>
          <br class="">
          <blockquote type="cite" class="">
            <div bgcolor="#FFFFFF" text="#000000" class=""> <br
                class="">
              Any thoughts anyone?<br class="">
              <br class="">
              Regards,<br class="">
              Zoltan<br class="">
              <br class="">
            </div>
          </blockquote>
        </div>
        <br class="">
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Africa mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Africa@lists.osgeo.org">Africa@lists.osgeo.org</a>
You can UNSUBSCRIBE at <a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/africa">http://lists.osgeo.org/mailman/listinfo/africa</a></pre>
    </blockquote>
    <br>
  </body>
</html>