Hi, (sorry earlier version was encrypted)

for a (2.18) plugin which would only work on a crs in meters I did a check:

if layer.crs().mapUnits() != QGis.UnitType.Meters:
  return
        
Which worked in Linux. Then somebody reported an issue:

https://github.com/rduivenvoorde/featuregridcreator/issues/8

Where it appears that there seems to be a different behaviour in Linux
vs Windows:

On Linux these:
QGis.Meters
QGis.UnitType.Meters
both work
But on Windows
QGis.UnitType.Meters
throws an 'no attribute' exception??

Off course to fix it for me, I can just go use 'QGIs.Meters', but I
think that it would be better if the UnitType one worked?

Anybody an idea about this? Or how to make this work?

Am I correct that for QGIS3 I should use:
qgis.core.QgsUnitTypes.DistanceMeters ?

Regards,

Richard Duivenvoorde


_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to