Feature request #9366
Allow scale values < 1 in composer map items
|Pull Request or Patch supplied:||No||Resolution:|
this is my first post, sorry if it is too big,
I am geologist/ petrologist and use QGIS not only for mapping big and large features as geological complexes, but also I use it to map thin sections (thin slabs of rock normally 3x4.5cm size). I find getting all work done in gis for this tiny scale objects very productive, as I can interpolate data obtained in very small scale to huge area seamlessly. Qgis main canvas with scale bar and scale widget gets it very right (ability to set scale bellow 1:1, i.e. 100:1, scale bar down to mm units). However with these thin section and other layered microscopy pictures + vector data I run into total nightmare in QGIS composer.
Scale can't be set bellow 2:1, anything bellow gets nullified -> 0, and if you click anywhere to stop the cursor blinking or simply to do next action (for example export to pdf, image etc.), whole world collapses into "singularity" (map gets 0 scale applied, that means it's left margin are same as right, and up is same as low boundary) "... It is worth mentioning that somehow it does round up numbers to integer in ScaleLineEdit field after applying scale to view, but for interval from 0.5-0.9(9) it always sets visible magnification to exactly 1 (so 2:1 manually is unobtainable). If value <0.5 are inputed, then after scaling the view, field does not get deactivated, also it makes number rounded down to '0' and cursor keeps blinking (prepared to jump to singularity). If 0 scale was just applied, (for example just clicking anywhere else or while it is 0 and not blinking, clicking "Update preview") there is one clear way to crash/loop qgis - trying to set scale changing 0 into anything but not 0 (negative numbers hangs too). To get out of "singularity" there is few ways: a) change in Map item properties -> extent fields; b) delete map and create new. However Composer will get weird if there was scale bar used while getting to "singularity" -> a) if You delete map, scale lefts on sheet with one end on it and other going to "singularity" (I guess to 0,0 of CRS) and is unable to be selected and deleted; b) if recovering from "singularity" with changing map extent, scale bar recovers too, but it leaves some artifacts, and Qgis Printing Composer window starts to behave weird: while sliding, slide bars goes to wrong directions (it tries to leave the screen going to left).
My suggestion would be to get rid of that rounding "feature" and make it possible to enter double numbers and keep it, so that scale would never go to 0 (I think I saw that 0 even in the code). This is printing composer, and even if people less crazy than me are working in scales from 1:50 to 1:1 it does really big difference if it is 1:1 or 1:1.5. I think It would brake scale bar having numerical form (I am not sure, but I guess that is why it gets rounded at all: just to be inserted to '1:'[scale]...) I would understand if most of people would want to keep it as is, and for now I can get things nearly done while even not touching scale field, for example with changing map extent or using atlas generator (that's now the most robust way of dealing with problem). Could that part be reworked? (I could try of doing it)
#5 Updated by Petras Jokubauskas over 3 years ago
It is possible to crash Qgis using Print composer in state as it is now, so at first it is bug report.
However it is also feature/bug fix suggestion which "temporally" would fix the bug: changing rounding scale to some decimal points (i.i up to 4 would be sane for me). I compiled and tested with such change, it looks it does not crash anything (numerical scale bar behaves same as before below 1:1 it just shows 1:0 - looks scale bar part of code rounds scale on its own), but as I said that would be temporal bug fix + feature for people working in cm, mm and μm scale spatial objects. Bug wouldn't be fixed for somebody who works in nm scale, but this probably are very unlikely, due to limits of georeferencing very high magnitude microscope imagery, and limits of vector resolution. To get rid of bug 100% there should be some code preventing getting to 0 scale (that also would prevent scale bar weirdness), or add/change code a little bit to check if scale is 0 and help getting to >0 scale correctly (but that needs some code with preventing scale bar "going bad" while in 0 scale). If there would be interest or at least no negative feedback - I am not scared of coding and contributing.
*Thoughts for food: there are more and more people who do spatial analysis of microscopy spatial data on ArcGIS... where people use custom simple Cartesian CRS, and I saw even new abbreviation created: "MIS" (microscopy information system). However my approach of analyzing microscopy data are more closer to GIS, because data are analyzed in real CRS, and features of micro objects have exact position in thin section and relative position in map. I see lot of potential for this approach not only in field of geology, but also i.e. archeology.
**Should I assign myself to this issue?