[PROJ] + prefix in pipeline entries

Kristian Evers kristianevers at gmail.com
Thu Feb 8 02:12:53 PST 2024


Javier,



The cause of the +’s dates back to ancient times. When proj (the command
line application) was originally created everything in argv would have been
treated as a parameter for the command. To distinguish between regular
parameters such as -f or -l and projection parameters such as +proj, +a or
+ellps the plusses were used. Internally the +’s would have been stripped
if I remember correctly. So that’s the explanation for the +-syntax. Today
we would just wrap the proj-string in quotes, as you suggest, but I assume
that wasn’t an option back in the day.



At some point init-files were introduced and here it wasn’t necessary to
include the plusses because it was obvious that projection parameters were
given, although the +’s were/are allowed in init-files. I assume it just
made sense to not use the +-syntax in this context at the time.



Like you, I prefer the +-syntax as it makes it very obvious that we're are
dealing with proj-strings but I know some people feel differently about
that. One thing that is definitely clear is that mixing the two different
styles of notation confuses people. For this reason I have always used the
+-syntax in all documentation I have written. I encourage everyone else to
do the same.


/Kristian

On Thu, 8 Feb 2024 at 10:44, Javier Jimenez Shaw via PROJ <
proj at lists.osgeo.org> wrote:

> Hi
>
> I wanted to know if I can combine a pipeline where some entries do have a
> "+" prefix and other doesn't (yes, it is ugly, I know it)
> I found the method "pj_shrink" that, among other things, removes "+"
> preceded by a space. So I deduce that the answer was "yes".
>
> That rises the question (actually the question was there before, but today
> I found pj_shrink): why the "+" before every entry? Is it just to make it
> clearer and easier in the command line, not needing quotes for the entire
> expression? Is there anything else I do not see?
>
> I prefer (visually) the expression with "+"s. Somehow I find it nicer ;)
> But I have seen that old expressions don't have it, and I am curious to
> know the reason to change it.
>
> Thanks
> .___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/proj
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20240208/6cc592b2/attachment.htm>


More information about the PROJ mailing list