[OSGeo Africa] QGIS Field Calculator - attributes for 2 layers

Tim Sutton tim at kartoza.com
Fri Jul 8 03:37:18 PDT 2016


Hi

> On 08 Jul 2016, at 11:30 AM, Zoltan Szecsei <zoltans at geograph.co.za> wrote:
> 
> Hi again,
> 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.
> 
> So the next step is to suspect the index.intersects result.

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...

> 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'.
> What is the internal precision of the QgsPoint?

the x and y properties of QgsPoint are both doubles...it depends on your platform what that means but typically

http://qgis.org/api/2.6/classQgsPoint.html

According to wikipedia on a 64 bit machine it should be:

Sign bit <https://en.wikipedia.org/wiki/Sign_bit>: 1 bit
Exponent <https://en.wikipedia.org/wiki/Exponent> width: 11 bits
Significand <https://en.wikipedia.org/wiki/Significand> precision <https://en.wikipedia.org/wiki/Precision_(arithmetic)>: 53 bits (52 explicitly stored)



> My coord attributes are 'double Real 19,10'
> 
> In a script, when you select with a point, what is the snapping tolerance?

To use snapping you would need to use the QGIS snapping api - otherwise absolute geometry operations are being done.

> My project CRS is epsg 4326 - so it should be OK.

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...

> 
> FWIW, b.name is string 60 which is copied into a.name string 32  -  but the contents are shorter that 32 chars.

I think QGIS will just truncate it if the name is longer than 32 chars.

T

> 
> Any thoughts anyone?
> 
> Regards,
> Zoltan
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/africa/attachments/20160708/3579b114/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.osgeo.org/pipermail/africa/attachments/20160708/3579b114/attachment.sig>


More information about the Africa mailing list