Hi Marian,
Just a wild guess:
your QGIS project might have a different coordinate system than the
layer you are editing in. This might explain different coordinates.
But - not having access to your project, I can't examine that.
The other thing to check:
feature = layer.getFeatures.next()
Is this really returning the feature you just edited? Note that there is
a QGIS plugin called "Plain Geometry editor". It allows you to click on
a feature in the canvas and return their coordinates. In newer QGIS
versions there is also the vertex editor panel with a node list showing
an active features geometry. But not sure if this existed in version
2.10 - which is already quite old.
Greetings,
Andreas
On 2017-10-30 21:05, Tudorache, Marian wrote:
> Hello,
>
> I am encountering an issue with QGIS 2.10 which I never had before.
>
> When add an arc to the canvas the saved coordinates do not match those from
> status bar Coordinate field.
>
> Example:
>
> Step1: Click the first point at -2766147, 5189893. The value is from
> Coordinate field of the status bar.
>
> Step2: Click right at the second point having coordinates -1342991, 6725875.
> The value is from Coordinate field of the status bar.
>
> Step3: Click right to draw the line: The line is drawn.
>
> Step4: Save the layer.
>
> Step5: From the console I extract the points.
>
> layer = iface.activeLayer()
>
> feature = layer.getFeatures.next()
>
> print feature.geometry().asPolyline()
>
> The console display:
>
> (-1.52996e+06,6.82968e+06), (636778,6.98782e+06).
>
> These coordinate are totally different from those captured in Coordinate
> field of the status bar.
>
> How do you explain this?
>
> When I hover the mouse over the first and last point of the arc the
> Coordinate field of the status bar shows the same number for the step 1 and
> step 2.
>
> Which coordinates are correct?
>
> Thanks,
>
> Marian
>
> -------------------------
>
> This electronic message, as well as any transmitted files included in the
> electronic message, may contain privileged or confidential information and is
> intended solely for the use of the individual(s) or entity to which it is
> addressed. If you have received this electronic message in error please
> notify the sender immediately and delete the electronic message. Any
> unauthorized copying, disclosure or distribution of the electronic message is
> strictly forbidden. NAV CANADA accepts no liability for any damage caused by
> any virus and/or other malicious code transmitted by this electronic
> communication.
>
> Le présent message électronique et tout fichier qui peut y être joint peuvent
> contenir des renseignements privilégiés ou confidentiels destinés à l'usage
> exclusif des personnes ou des organismes à qui ils s'adressent. Si vous avez
> reçu ce message électronique par erreur, veuillez en informer l'expéditeur
> immédiatement et supprimez le. Toute reproduction, divulgation ou
> distribution du présent message électronique est strictement interdite. NAV
> CANADA n'assume aucune responsabilité en cas de dommage causé par tout virus
> ou autre programme malveillant transmis par ce message électronique.
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user