[Proj] proj.4 BNF

Gerald I. Evenden geraldi.evenden at gmail.com
Wed Oct 22 17:52:18 EDT 2008

On Wednesday 22 October 2008 5:32:02 pm support.mn at elisanet.fi wrote:
> My concern  is originated from those initialization files proj.4 has. Here
> is some examples:
> ----------------file 1-------------
> # Kalianpur 1962
> <4145> +proj=longlat +a=6377301.243 +b=6356100.230165384 +no_defs  <>
> # Kalianpur 1975
> <4146> +proj=longlat +a=6377299.151 +b=6356098.145120132
> +towgs84=295,736,257,0,0,0,0 +no_defs  <> # Hanoi 1972
> <4147> +proj=longlat +ellps=krass +towgs84=-17.51,-108.32,-62.39,0,0,0,0
> +no_defs  <> # Hartebeesthoek94
> <4148> +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs  <>
> # CH1903
> <4149> +proj=longlat +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0
> +no_defs  <> -------------------------------
> ----------------file 2-------------
> # W [HIVA67]
> <IGN63> +title=IGN 1963 (Hiva Oa, Tahuata, Mohotani) +proj=geocent
> +towgs84=410.7210,55.0490,80.7460,-2.5779,-2.3514,-0.6664,17.331100
> +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <>
> --------------------------------
> and how to parse those. "+" is used as separator and I am assuming that the
> reason is the "+title=something with white spaces in it". That should pass
> the scanner somehow.

I do not know how often I can repeat this: the "+" is part of the keyword.  IT 
IS NOT A SEPARATOR, delimiter or anything other than an optional prefix to 
the proj keyword.

As for the "title" stuff, I have absolutely no idea.  It is not part of the 
current proj4 system nor do I recall it ever having been used that way 
(although I admit it may have been my idea in the long defunct system).

However, the parsing of the control lines could have been done if everything 
after the +title= was treated as a comment until the first occurrence of a 

But in no situation should the + be considered a delimiter.



> > where id is your typical identifier definition.  Treating "+" as a
> > delimiter only confuses the issue.  In fact, treating it like white space
> > could cause a failure---"+proj=poly+ellps=intl" would fail because the
> > second + would be treated as part of the projection name and there is no
> > projection called "+ellps=intl",

That is why + as a delimiter DOES NOT WORK!!!!!!!

Sorry to be testy, but I am tiring of this issue.

The whole religious complexion of the modern world is due
to the absence from Jerusalem of a lunatic asylum.
-- Havelock Ellis (1859-1939) British psychologist

More information about the Proj mailing list