A QGIS plugin to calculate various cartographic projection properties.
"Redux" of https://plugins.qgis.org/plugins/ProjFactors-gh-pages/
Click the icon in the plugins toolbar, wait a while, inspect the resulting raster layer's bands.
Basically all it does is:
- Generate a point for each canvas pixel
- Transform them to WGS84
- Calculate the project CRS' projection factors for each
- Generate a raster band per projection factor
- Build a GeoTIFF with all the raster bands
- Create a VRT to add band names (workaround for PyQGIS not allowing to set raster band names)
This plugin has been developed off and on again over several years. From the first steps in PyQGIS until today. Expect some weird stuff if you look at the code. :0)
There does not seem to be a way to find out if we could safely import pyproj (i.e. if that would load a pyproj that is using the same proj as QGIS does. I assume that even the same version number between
- QGIS' proj:
[v for v in QgsCommandLineUtils.allVersions().split("\n") if v.startswith("PROJ version")][0][13:]
(yeah, great way to find that version, I know) - and pyproj's proj (no idea how to determine it without importing pyproj first... Version of pyproj itself != proj ...)
would not be a safe indicator.
So, you can choose to use pyproj yourself, for a ~4x speed gain:
In your QGIS3.ini
, set
[ProjectionFactorsRedux]
useProj=false
- The proj and QGIS developers for being awesome
- Nyall Dawson for exposing proj's
proj_factors
in PyQGIS as QgsProjectionFactors - Javier Jimenez Shaw for great feedback and ideas
- Marcel for the initial idea