[PROJ] Creating projection *not* from full init string?

Matthew Woehlke mwoehlke.floss at gmail.com
Tue Mar 9 12:39:23 PST 2021


On 09/03/2021 14.53, Even Rouault wrote:
> Le 09/03/2021 à 20:43, Matthew Woehlke a écrit :
>> On 09/03/2021 13.33, Even Rouault wrote:
>>> Le 09/03/2021 à 19:18, Matthew Woehlke a écrit :
>>>> In PROJ 4, 4326 is "+proj=longlat +datum=WGS84 +no_defs 
>>>> +ellps=WGS84". If I use that with proj_create, I get something 
>>>> usable. What's the difference?
>>>
>>> PROJ >= 6 now makes a difference between a CRS and a coordinate 
>>> operation. A PROJ string without +type=crs is assumed to be a 
>>> coordinate operation, and with +type=crs to be a CRS.
>>>
>>> The old PROJ.4 definitions without +type=crs depending on the context 
>>> could be used as a CRS definition or a coordinate operation. PROJ >= 
>>> 6 now requires to be explicit to avoid that confusion. You can't use 
>>> a CRS like "EPSG:4326" with proj_trans(). That doesn't make sense. A 
>>> CRS doesn't define a coordinate operation by itself.
>>
>> I sort-of get that, but I don't think you actually answered the 
>> question. What does "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84" 
>> mean than I *can* use it with proj_trans?
> > There is no +type=crs in it, so this is interpreted as a PROJ coordinate
> operation, and not a CRS. But EPSG:4326 *is* a CRS (it expands to 
> "+proj=longlat +datum=WGS84 +no_defs +type=crs" now as can be seen with 
> the "projinfo EPSG:4326" output)

What I'm hearing is "this is a meaningless, pedant-only distinction to 
prevent being able to do useful things". That, or you aren't 
understanding the question.

4326 is "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84" plus a silly 
"I am a CRS, make me less useful" flag. If I don't set that flag, I can 
use that projection in proj_trans, so apparently that means something.
*What* does it mean? Why, other than some perverse desire to make my 
life more difficult, can I not use an EPSG in the same manner?

Is there a way (without string parsing) to "remove" this silly flag so I 
can use EPSG projections without having to couple my input and output?

I'd be quite happy to have a proj_trans(proj_from, proj_to, coord)... 
What I want to avoid is having to create O(N²) projections when I need 
to deal with N coordinate systems. (Among other reasons, it makes it 
non-trivially harder to cache projections.)

-- 
Matthew


More information about the PROJ mailing list