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

Even Rouault even.rouault at spatialys.com
Tue Mar 9 11:53:20 PST 2021


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)
>
>>> p.s. How do I get that definition in PROJ 5? In PROJ 4, I could use 
>>> pj_get_def. (See also https://stackoverflow.com/questions/66533885.)
>>
>> Use proj_as_proj_string(). That can work on both CRS and coordinate 
>> operation (when there's a single coordinate operation actually 
>> contained in proj_create_crs_to_crs() )
>
> Why is *that* not documented as the replacement for pj_get_def?

To let you engage you pro-actively with the community and submit a pull 
request to document it :-)

-- 
http://www.spatialys.com



More information about the PROJ mailing list