<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">Hi everybody,</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;"/>
<br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;"/>
<span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">A few months ago I have raised the issue of floating-point </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">inaccuracies with snapped digitising when OTF reprojection is </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">activated (see bug report #13745). This breaks many functionalities, </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">such as cutting features by clicking on a vertex; topological editing; </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">removing duplicate features; topology checking, and so on. I have also </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">proceeded to create a pull request with a proposed fix for the </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">snapping functionality (#2434), still waiting for feedback.</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;"/>
<br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;"/>
<span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">Now I have noticed that Martin Dobias has introduced a new tracing </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">framework, a couple of days ago. While it is surely a great </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">functionality, currently the tracer object is bound to the map canvas </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">and keeps its data in map coordinates. So here too, layer coordinates are </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">transformed to map coordinates, tracing is performed in map </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">coordinates, and the traced points are then converted back to layer </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">coordinates, leading to floating-point inaccuracies. To be precise: if </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">the active layer and the traced layer have the same CRS, but the </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">project has a different CRS, a feature created by tracing does not </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">exactly match the traced feature. This will again cause functions like </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">removing duplicates and topological features not to work.</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;"/>
<br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;"/>
<span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">How to handle this? As I see it, it will be a bit of work to fix this. </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">Firstly, the tracer class should perhaps be bound to layers instead of </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">canvases. Another possibility might be to just invalidate the tracer </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">when the active layer is changed. In any case, the tracer would need </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">to be changed to return layer coordinates instead of / in addition to </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">map coordinates.</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;"/>
<br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;"/>
<span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">But maybe anyone also has a general opinion about this whole issue of </span><span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">OTF reprojection and floating point inaccuracies?</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;"/>
<br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;"/>
<span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">Kind regards,</span><br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;"/>
<br style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;"/>
<span style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; line-height: normal;">Daan Goedkoop</span></div></div></body></html>