[Qgis-developer] Python skipping features for unknown reason

Allar Haav allar.haav at gmail.com
Wed Jan 23 07:53:46 PST 2013


Alright, set up a GitHub account: 
https://github.com/haav/python/tree/master/PointAdjust
I have to stress that it is really work in progress though.
It works by putting in 2 feature ID-s (A and B) with needed coordinates. 
The point A position is fixed and will be exactly as entered, but for 
point B the resulting position may differ in order to maintain the 
similarity. Thus, the new position of point A is used for translation 
while point B coordinates are only used to get the rotation angle. So, 
let's say we have the original layer points A=(0;0) and B=(3;0) and the 
entered values for the plugin are A=(-3;2), B=(-1;4). Thus the rotation 
angle will be 45 degrees.
Ah, right, the "edit mode" has to be turned on to get any effect.

Allar


On 23/01/2013 15:14, Nathan Woodrow wrote:
>
> Allar,
>
> We will have to see some code to be of any help.  Why not consider 
> putting it up on GitHub if you haven't already
>
> -Nathan
>
> On 24 Jan 2013 01:09, "Allar Haav" <allar.haav at gmail.com 
> <mailto:allar.haav at gmail.com>> wrote:
>
>     Hi all,
>
>     I recently started learning Python and I'm currently finishing my
>     first plugin that I really needed for QGIS - it performs a simple
>     similarity transform on point layer. While the familiar qgsAffine
>     presupposes that I know exactly the translation and rotation
>     parameters, there often cases when I do not. What I might have is
>     just information (GPS measurements for example) that points A and
>     B should have coordinates x1,y1 and x2,y2. And that's it.
>     So far I've managed to get everything working, but I have run into
>     weird problems. When I perform the operations on really small
>     datasets, everything is working fine. But when I have a layer
>     with, say 600 points, QGIS starts acting weird. Sometimes it
>     performs ok, yet once in a while some points aren't affected by
>     the transformation, basically it starts skipping features. It
>     seems as if the memory buffer is overloaded (?). Any ideas on
>     that? The code in main transformation method is put between
>     beginEditCommand() and endEditCommand(), the points are moved
>     using moveVertex() function.
>
>     Regards,
>     Allar
>     _______________________________________________
>     Qgis-developer mailing list
>     Qgis-developer at lists.osgeo.org <mailto:Qgis-developer at lists.osgeo.org>
>     http://lists.osgeo.org/mailman/listinfo/qgis-developer
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20130123/074e6fda/attachment.html>


More information about the Qgis-developer mailing list