[PROJ] How to match a proj string to the db?

Even Rouault even.rouault at spatialys.com
Sun May 12 00:09:47 PDT 2019


Hi Nyall,

> If I have a proj string (say +proj=longlat +datum=WGS84 +no_defs
> +type=crs), how can I match this back to an authority/code from proj's
> db?

You just hit a bug. The issue is that instanciating from PROJ string for a 
GeographicCRS like the above creates a long,lat coordinate system, whereas 
EPSG:4326 is lat,long. I've just fixed this in master and 6.1 branches by 
setting a flag to indicate that CRS identification must be axis order 
tolerant.

> 
> proj_identify doesn't seem to be capable of this (maybe by design? The
> dox say: "This is implemented for GeodeticCRS, ProjectedCRS,
> VerticalCRS and CompoundCRS"). The dox for proj_identify also have a
> cryptic note "The candidate CRSs are either hard-coded, or looked in
> the database when authorityFactory is not null." What exactly does
> this mean? I can't see where authorityFactory is specified, or a hard
> coded list of candidates is specified either... Is this outdated
> documentation?

The later part is a copy&paste from the corresponding C++ which in clearer 
terms translate to "when the database is available". Also fixed.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the PROJ mailing list