first: Thank you so much for your library. I used it several times in my projects and even already ported some parts of it into Dart.
Currently I want to create a WGS84 LatLon converter from/into Lambert-93 and several other specific Lambert projections.
When I read some sources like the French Wikipedia on that (https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert) I came to a problem with the definitions.
In your code, one needs following parameters (next to rotation ellipsoid definition, which I remove here for simplicity):
The coordinates are shifted so that the projected coordinates at phi0/lam0 are X0/Y0. The example examples/example-LambertConformalConic.cpp shows how to handle this. This example is for the Pennsylvania South coordinate system. However the French projection is similar. Compare
I missed that example. So, the two key points are:
You do the Forward() operation twice: One for the point transformation using the given X0/Y0 points and then the actual operation, correct? What's interesting about this, is that you use the lon0 twice in the parameters. Could you explain this point please?
k1 equals 1. Is that always the case with these kinds of definitions?
Last edit: Mark Lorenz 2022-09-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Better to say I do the Forward() operation 1+n times. 1 as part of construction and n for the n points to be projected. Because of the simple way lon0 enters into this projection, I elected not to incorporate it as part of the construction. Instead you specify it on each call to Forward and Reverse.
Usually k1 = 1 if there are two distinct standard parallels. I hesitate to say "always".
Last edit: Charles Karney 2022-09-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Forward and Reverse operation return my original latLon data. So, the calculation seems to be consistent in both directions. However, when I compare with
There are a number of things going on with this projection
SPHEROID is not WGS84 but Clarke 1880
PRIMEM is not Greenwich but Paris
UNIT is not degrees by grad
TOWGS84 is non-zero
Presumably the central_medidian is relative to Paris? GeographicLib
doesn't know how to map a point on WGS84 to this spheroid+datum. I
can't help you with this; PROJ would be the tool I would look into
using.
Once you've mapped you point of interest to a latitude+longitude on this
datum, then you can use GeographicLib::LambertConformalConic to
project the point. (Be sure to special the Clarke 1880 ellipsoid in the
constructor.)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Charles,
first: Thank you so much for your library. I used it several times in my projects and even already ported some parts of it into Dart.
Currently I want to create a WGS84 LatLon converter from/into Lambert-93 and several other specific Lambert projections.
When I read some sources like the French Wikipedia on that (https://fr.wikipedia.org/wiki/Projection_conique_conforme_de_Lambert) I came to a problem with the definitions.
In your code, one needs following parameters (next to rotation ellipsoid definition, which I remove here for simplicity):
However, reading the source given above, the definition of, for instance Lambert-93, are always given like this:
That means: We have
But we are lacking of the scale
k1
but get aφ0
instead. On top, there is aX0/Y0
which is not also not clear to me.So, do you know how to handle this data with your code?
Is it possible to use your code to achieve my goal creating a Lambert-93 converter? For example, do I need to convert
φ0
intok1
in any way?Do you know what the
X/Y
coordinates are for?Again, thanks a lot, sir for your great and impressive work!
Greets, Mark
Last edit: Mark Lorenz 2022-09-06
The coordinates are shifted so that the projected coordinates at phi0/lam0 are X0/Y0. The example
examples/example-LambertConformalConic.cpp
shows how to handle this. This example is for the Pennsylvania South coordinate system. However the French projection is similar. Comparehttps://www.spatialreference.org/ref/epsg/3364/html/
https://www.spatialreference.org/ref/epsg/2154/html/
Wow, that was quick! Thanks a lot!
I missed that example. So, the two key points are:
Last edit: Mark Lorenz 2022-09-06
Last edit: Charles Karney 2022-09-06
Understood. Thank you so much, sir!
Hi,
thanks. For all projects using 2 standard parallels, my code works greatly now!
I have another question. I was checking
EPGS 27564
(only one standard parallel)https://www.spatialreference.org/ref/epsg/27564/html/
There we have given a
latitudeOfOrigin
and ascaleFactor
(and acentralMeridian == 0.0
). So I require the first constructor, right?So I tried the same algorithm as you did in your PA example (pseudo code):
Forward
andReverse
operation return my original latLon data. So, the calculation seems to be consistent in both directions. However, when I compare withhttps://epsg.io/transform#s_srs=4326&t_srs=27564&x=0.3770639&y=43.2972250
I get other values for
Forward
:(same for any other format using only one standard parallel. I am not getting the same result)
So, I guess, I am wrong with simply using your transformation code directly for the one parallel case, right?
Could you please tell me, what I need to change here? Is it correct to work with the
centralMeridian == 0
forlon0
andlatitudeOfOrigin
forstdLat1
?Thanks again in advance!
Greets, Mark
Last edit: Mark Lorenz 2022-09-07
There are a number of things going on with this projection
Presumably the central_medidian is relative to Paris? GeographicLib
doesn't know how to map a point on WGS84 to this spheroid+datum. I
can't help you with this; PROJ would be the tool I would look into
using.
Once you've mapped you point of interest to a latitude+longitude on this
datum, then you can use GeographicLib::LambertConformalConic to
project the point. (Be sure to special the Clarke 1880 ellipsoid in the
constructor.)
Ok, thank you again!