3

I am trying to define a custom CRS in QGIS 3.4 to work on some data in Central Asia. I want to use the Albers Equal Area Conic but change the parameters so that the transformation works best for my study area.

I first tried to go via "Settings" --> "Custom CRS". I defined the name and the +projstring as +proj=aea +lat_1=21 +lat_2=49 +lat_0=37 +lon_0=87 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs. But when I click "Ok", nothing happens.

I don't get an error message or any feedback, there's just no response. (I tried QGIS 3.10 as well, but the same problem occurred.) This looks like a bug to me or is there something I missed?

If this cannot be reproduced, I could also go the Python way, but I'm not so familiar with that. I've read through some documentation and found the following pieces of code but I'm not sure if they are in the right order or if something is missing:

my_crs = QgsCoordinateReferenceSystem()
my_crs.createFromProj4("+proj=aea +lat_1=21 +lat_2=49 +lat_0=37 +lon_0=87 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs")
my_crs.saveAsUserCrs("Albers_Central_Asia")
2
  • works for me in QGIS 3.4.6
    – nmtoken
    Nov 12 '19 at 8:11
  • Could you give me the detailed workflow for this, please? You first click the green "plus", then add name and proj-string and click "ok"? Because that way it does not work for me... Nov 12 '19 at 8:26
6
  1. add new profile. : Settings -> User Profiles -> New profile

  2. use new profile and try creating custom projections.

2
  • Wow, thanks a lot! I hadn't even thought about that! Sometimes it can be so simple. Nov 21 '19 at 7:46
  • @color mint This worked for me, but why? Why do we have to do this? Why doesn't the "default" profile work?
    – Kristen G.
    Feb 10 at 14:42
3

Settings > Custom Projections > Green Plus

Add name and parameters > OK

Custom Projection in QGIS 3.4.6

Creates a custom projection (in my case called USER:100030)

custom projection USER:100030

8
  • Thanks for the details! This is exactly how I've been doing it. So it seems to be a bug... Do you perchance also know how to write this in Python? Nov 12 '19 at 8:41
  • I installed QGIS under Linux and was able to create the CRS using your workflow. I still don't know what the problem was, though. Nov 12 '19 at 10:17
  • My example is Linux based too. I've tried since on Windows with 3.6.3 version and it works just the same
    – nmtoken
    Nov 13 '19 at 14:03
  • Strange... However, now I'm stuck on trying to export the custom crs to Windows. I've tried to save a raster with this crs and open it on Windows, but there it appears to have no projection. Does this work for you? Or is there another way to export a projection? Nov 13 '19 at 14:09
  • 1
    You can do a direct edit of the .../share/proj/other.extra file to add custom projections
    – nmtoken
    Nov 13 '19 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.