-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calculate grid scale factor compatibly #1508
Calculate grid scale factor compatibly #1508
Conversation
Add a georeferencing page to the settings, where the user gives a preference for what to see and what to edit in the Georeferencing dialog. One option is provided: whether the dialog should show the scale factors and support setting the auxiliary scale factor.
👍 Regarding the georeferencing dialog, I'm fine with hiding the auxiliary scale factor field by default. However, wouldn't it be better to always show the auxiliary factor field when the current map has a value different from 1.0? After all, the user might be looking into the dialog to find an explanation for some observations, or for what he knew to be there as "Grid scale factor". |
One reason against that is that most existing maps will have an auxiliary scale factor different from 1.0, while at the same time the user will be doing well to not bother with it. Here's a typical case I expect.
That's because the mapper has until now left the scale factor at 1.0. The new Georeferencing keeps this as the combined scale factor value, in order to retain both the scale of objects on paper and their lat/long on the globe. It calculates the grid scale factor, typically not 1.0, and consequently the auxiliary scale factor also cannot equal 1.0. In such a case, showing the auxiliary scale factor would lead to unhelpful discontent. Showing the auxiliary scale factor could have a minimum threshold before it would appear. I was lazy and didn't want to choose a threshold arbitrarily. A weaker reason is that it's more comfortable for users if the form of the dialog doesn't vary when switching between maps. |
That would be good, provided the collapsed/expanded state were kept as a user preference rather than as a property of the map. I don't have a specific vision of how that should work in the Georeferencing dialog. If you would point me to what you have in mind, I'd be happy to implement it. Is there a case of another user preference in Mapper that is controlled apart from the settings dialog? |
Yes, this is what I meant.
We have some check boxes in the line symbol settings which also control the visibility of additional fields. The dependent widgets are kept in lists which are used when changing the state, e.g. for dashed lines: mapper/src/gui/symbols/line_symbol_settings.cpp Lines 686 to 715 in e1155d8
For the start, use a "Grid compensation..." checkbox, a flat, checkable "Grid compensation..." push button or a label with a hyperlink. Later, we can override the normal checkbox marks or prefix the button/label text with a small triangle (▶ / ▼), or plus/minus ( |
Thanks. I'll do that. |
Removes georeferencing from the settings dialog, while keeping the MapGeoreferencing_ControlScaleFactor setting, which will be visible in the Georeferencing dialog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thank you very much!
@dg0yt Thanks for all the guidance. It's refreshing to work with up-to-date coding standards. |
Thanks for taking the time and for the explanations for your side.
It will be closed automatically when I click merge. I just wanted to make sure there were no more changes pending. |
a new approach
This PR is a descendant of #1277 (Determine grid scale factor automatically) showing an approach that I like. It eliminates the matrix that compensates for shear in the projection. As a consequence, this version very compatible with previous releases of Mapper. It computes grid scale factor, while also permitting the user to make adjustments. It has a user setting to tailor the Georeferencing dialog to the user's knowledge.
the parallel
These enhancements to both user interface and code can be understood more easily, if certain parallels are kept in mind between parameters indicating orientation of the grid, and factors governing scale of the grid.
As the table shows, convergence is analogous to grid scale factor in that both can be computed from the CRS and reference point. Similarly, declination is analogous to auxiliary scale factor as both are user-supplied.
Note, the “grid scale factor” as it appeared previously in Mapper, really meant “combined scale factor” and the more accurate term is used in both the new implementation and user interface.
The user-specified scale factor is called “auxiliary scale factor”, rather than “elevation scale factor” so as not to limit what users might do with it.
Earlier versions of Mapper provided for editing the "grid scale factor" which was effectively the combined scale factor, compensating for both the grid and any other needed adjustments. With this change, the grid compensation is automatic, and the user no longer sets the combined scale factor. Now the user sets the auxiliary scale factor. That relieves the user of determining and dealing with the grid scale factor.
the enhancement to Georeferencing
The enhancement to the Georeferencing class is modest.
compatibility
The new Georeferencing class maintains compatibility by using 'grid_scale_factor' in .omap files to save and restore the combined scale factor. It introduces an 'auxiliary_scale_factor' attribute into .omap files. This new attribute, if encountered by an earlier version of Mapper, is ignored with no ill effect.
When the new Georeferencing class loading from a file, the auxiliary scale factor is calculated if absent. I suppose it should always be re-calculated, as is done for declination (#1493).
use cases
Considering that there is no button to click that sets the scale factor to the calculated value, how does the user benefit from the changes?
new map
The primary case that benefits from this PR is a new map, because the grid scale factor is computed, and the auxiliary scale factor is simply 1.0. It is automatic, without the user explicitly choosing "automatic".
changed CRS
Another interesting case is when the CRS (or reference point) of an existing map is changed. The grid scale factor is re-computed, but the auxiliary scale factor is kept. This is obviously a good result if the auxiliary scale factor has been set to account for elevation. Thus, the combined scale factor is again automatic.
existing map
If the grid scale factor was set using an earlier Mapper, the value will appear unchanged in the Georeferencing dialog as “Combined scale factor”. (An Auxiliary scale factor will also be displayed, having the value which is consistent with the combined scale factor and the calculated grid scale factor.)
If a user wishes to take advantage of calculated grid scale factor for such a map, he/she may set the auxiliary scale factor to 1.0, using the Georeferencing dialog.
The effect of setting auxiliary scale factor is not trivial, as indicated when a dialog pops up, asking “Do you want to stretch/shrink the map content accordingly?” If “stretch/shrink” is declined, then the global coordinates of all map objects will be affected. This new dialog is analogous to the “Rotate map” dialog which appears if the user changes the declination.
taming the Georeferencing dialog
It can be understood from the description of this enhancement, that the benefit will occur gradually, as new maps are created. Note that the new feature does not depend on a feature flag being turned on in the Georeferencing object, or in the way it is saved to file.
At the same time, we are not content with having made the Georeferencing dialog bigger. We would like to give the user an option to avoid yet more subtlety around scale factors.
Noticing that the new Georeferencing does not require any user interaction to achieve its benefits, and gives all users less need to attend to scale factor, this PR proposes to remove the scale factor from the dialog, and give the user a setting to make the scale factors visible and editable.