<div dir="ltr"><div>that's a good point about needing to dif the label settings. I may have misunderstood your use case a little. <br></div><div><br></div><div>it's worth distinguishing between the need to see a diff of data changes, and a diff of rendering changes, i.e. changes to the qgis file itself vs a change to a file or db it's pulling data from. <br></div><div><br></div><div>I thought based on
<i>"Here is one example of a label move when no data has changed (see bottom-right)" </i>from the S/O question that you were mainly concerned with data changes. <br></div><div><br></div><div>it sounds like you may be also or more concerned with changes to the QGIS file. <br></div><div><br></div><div>it's possible that you'd be better off with a combination of Data versioning and applying version control to the QGIS file rather than trying to accomplish these two things simultaneously by diffing the image exports themselves. <br></div><div><br></div><div>As far as data, whenever a row of data is changed, you can generally set up an automated way to record the username who made the change and the current timestamp. You can then review all changes made within a given time. <br></div><div><br></div><div>As far as the qgis file, if you unzip the qgz with 7zip you'll get a qgs file which is just text xml, which can be diffed for changes. You may need to install this plugin to prevent reordering of xml elements. <a href="https://plugins.qgis.org/plugins/trackable_project_files/">https://plugins.qgis.org/plugins/trackable_project_files/</a></div><div><br></div><div>i think there's a lot of potential for git version control integration into QGIS but there's a substantial amount of work to be done on exactly how/when to trigger a commit so a good plugin is on my very long term todo list and probably a very long way off. <br></div><div><i>
</i></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 19, 2021 at 1:57 PM Tom Christian <<a href="mailto:thomaschristian@gmail.com" target="_blank">thomaschristian@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hugh, Nicolas, thanks for your input.<div><br></div><div><b>Hugh</b>: I'm interested in trying your suggestion to change the labelling engine but from your description, the cropped image, and a little searching I cannot figure out where this setting might be found. Can you please elaborate?</div><div><br></div><div>I've considered something similar to your "hacky" fix - I was going to force "strict" label positioning during comparison but still permit "preferred" label positioning during final export, however the problem in both cases is that then my visual diff will miss any changes made to map label configuration. If one of the map maintainers changes the way labels work in the final product I don't want to override that during change detection and lose the ability to review that change.<br><div><br></div><div><b>Nicolas</b>: label coordinates is not a good solution for my use-case. Forcing labels to a certain location might produce a satisfactory output at a given scale and viewport, but it will not accommodate changes to scale and viewport very well as in some scenarios the chosen label position will not be in view even though part of the line is in view. I have several layouts covering different parts of the same trail network so I need to use QGIS's ability to place labels in a context-sensitive way.</div></div><div><br></div><div>Tom</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 19 Nov 2021 at 07:26, Nicolas Cadieux <<a href="mailto:njacadieux.gitlab@gmail.com" target="_blank">njacadieux.gitlab@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Hi,<div><br><div>Just wondering if you are having the same problem when using a x and y field for the label coordinates to move the labels? In my experience, If you don’t want a label to move, you lock is down with new x and y label fields. I believe you can now save those coordinates in the project file so you now longer need real fields in the table.<br><br><div dir="ltr">Nicolas Cadieux<div><a href="https://gitlab.com/njacadieux" target="_blank">https://gitlab.com/njacadieux</a></div></div><div dir="ltr"><br><blockquote type="cite">Le 19 nov. 2021 à 09:57, Hugh Kelley <<a href="mailto:hghklly@gmail.com" target="_blank">hghklly@gmail.com</a>> a écrit :<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div>Hi Tom, <br></div><div><br></div><div>I don't have a great solution for you but I'm following with some interest as I routinely struggle with fine tuning labels . <br></div><div><br></div><div>A couple things I can offer: <br></div><div><br></div><div>this feature request for the ability to lock labels once they're generated [0]. There are a number of issues, mostly closed, complaining about unexpected label movement that are consistent with what you're talking about. <br></div><div><br></div><div>overall, reading the github content, I don't think there's currently a solution because the labeling engine is not quite deterministic. I don't imagine that's a small fix. I think in ESRI world, the way they handle this is by allowing the user to convert labels to an image overlaid on the map, which has its own set of major disadvantages. <br></div><div><br></div><div>For what it's worth, there are two labelling engines in QGIS currently. You may have better luck with one or the other. I have switched entirely to the newer engine but it may be less consistent so you might try switching. You can switch in the settings label properties' automated placement settings. (Yellow gear icon in the image below)<br></div><div><br></div><div>In terms of "hacky" fixes for your problem. Could it be helpful to have a version of the outputs without labels at all, check the diff for those and then review the labeled exports as necessary based on the non-labelled diff? All it would take would be a common naming convention. Git picks up a change in "no-labeled_export_4.png" which means you check "labled_export_4.png" for problems. I think that would reduce false positives caused by moving labels. Not a super elegant solution obviously.<br></div><div><br></div><div>best of luck, maybe this email will bring the thread back to the top of someone's inbox on a friday morning when they're in the mood to work on something that's not work. (as is the case for me currently.) <br></div><div><br></div><div><br></div><div>[0] <a href="https://github.com/qgis/QGIS/issues/28386" target="_blank">https://github.com/qgis/QGIS/issues/28386</a></div><div><br></div><div><div><image.png></div><br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 18, 2021 at 3:24 PM Tom Christian <<a href="mailto:thomaschristian@gmail.com" target="_blank">thomaschristian@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I'd like to know if there's anything I can change (e.g. a well-buried advanced setting or environment variable) to remove pseudo-randomness within QGIS's label positioning.<div><br></div><div>I have a QGIS project version-controlled within Git and a process to export layout PNGs from the base (before) commit and the head (after) commit when a change is made. These images are compared and any variation flagged to a reviewer so that they can verify each change is intended and expected before merging to the main (release) branch.</div><div><br></div><div>I have line label positioning configured as "Preferred Placement Hint" rather than "Strict" positioning as the result is significantly better when I allow QGIS to make placement decisions on my behalf. However, in this configuration there is some pseudo-randomness where QGIS sometimes makes minor changes to label positions even though neither the data, the layout, nor the export configuration have changed. This leads to false-positives during change analysis.</div><div><br></div><div>Here is a GIF showing 5 sequential exports in which two line labels move slightly. Each of the 5 frames shows for 0.5 seconds: <a href="https://www.dropbox.com/s/x3y4vfr20s9inqw/print-map-label-movements.gif?dl=0" target="_blank">https://www.dropbox.com/s/x3y4vfr20s9inqw/print-map-label-movements.gif?dl=0</a>. One change is at "West Connector" near the centre of the image and the other is at "The Dip" near the centre of the inset map.</div><div><br></div><div>I previously posted this question on gis.stackexchange but so far no traction, so any input would be very much appreciated (<a href="https://gis.stackexchange.com/questions/416430/qgis-inconsistent-label-positions-in-png-pdf-layout-exports" target="_blank">https://gis.stackexchange.com/questions/416430/qgis-inconsistent-label-positions-in-png-pdf-layout-exports</a>).</div><div><br></div><div>Thanks</div></div>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Hugh Kelley <br><div><br></div></div></div></div></div></div></div></div>
<span>_______________________________________________</span><br><span>Qgis-user mailing list</span><br><span><a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a></span><br><span>List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></span><br><span>Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></span><br></div></blockquote></div></div></div></blockquote></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr">Hugh Kelley <br><div><br></div></div></div></div></div></div></div></div>