I am reading SPS files (see format definition here) from which I gather CRS information.
Unfortunately, there is no ESPG reference available nor is there any standard naming scheme for Ellipsoids so it is easy to get confused and even a well-known CRS may be better off built manually.

The ellipsoidAcronym() method is not capable of recognizing an existing Ellipsoid if I define my Projection with +a and +rf instead of using the +ellps. Similarly, the findMatchingProj() is failing.
In the following example, using def_wo_name, the Projection is not recognized (it is actually EPSG:30732) and I end up creating a useless custom CRS and cluttering my local database.

def_wo_name = '+proj=utm +zone=32 +a=6378249.145 +rf=293.4663 +towgs84=-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547 +units=m +no_defs'
#def_w_name = '+proj=utm +zone=32 +ellps=clrk80 +towgs84=-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547 +units=m +no_defs'
match = crs.findMatchingProj()
crs = QgsCoordinateReferenceSystem.fromProj4(def_wo_name)

The above code output is just the proj4 string, an empty string (no Ellipsoid match) and 0 (no Projection match)

Is there any method that would allow a better (actual) matching or do I have to check my +a and +rf against all Ellipsoids in my database and match manually ?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.