<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi,
<div><br>
</div>
<div>Two major problems I'm struggling with:</div>
<div><br>
</div>
<div><span style="font-size: 10pt;">1) computing the proj_factors with the C API.</span></div>
<div><br>
</div>
<div>My code seems very simple:</div>
<div><br>
</div>
<div>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">
my_proj = <span style="color: #326d74">proj_create</span>(<span style="color: #9b2393"><b>nullptr</b></span>, "<span style="font-size: 11px; color: rgb(0, 0, 0);">IGNF:LAMB93"</span>);</p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgb(50, 109, 116); background-color: rgb(255, 255, 255);">
<span style="color: #9b2393"><b>auto</b></span><span style="color: rgba(0, 0, 0, 0.85)"> geodetic_crs =
</span>proj_crs_get_geodetic_crs<span style="color: rgba(0, 0, 0, 0.85)">(</span><span style="color: #9b2393"><b>nullptr</b></span><span style="color: rgba(0, 0, 0, 0.85)">, </span><span style="caret-color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);">my_proj</span><span style="color: rgba(0, 0, 0, 0.85)">);</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">
<span style="color: #1c464a">PJ_FACTORS</span> facs = <span style="color: #326d74">
proj_factors</span>(geodetic_crs, coord);</p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; font-size: 12px; line-height: normal; font-family: Menlo; color: rgba(0, 0, 0, 0.85); background-color: rgb(255, 255, 255);">
<br>
</p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<font face="Menlo"><span style="color: rgba(0, 0, 0, 0.85); font-size: 12px;">the error message sent by </span><span style="color: rgb(50, 109, 116); font-size: 12px; caret-color: rgb(50, 109, 116);">proj_factors</span><span style="font-size: 12px; caret-color: rgb(50, 109, 116);">
is </span><span style="color: rgb(50, 109, 116); font-size: 12px; caret-color: rgb(50, 109, 116);">"</span><span style="font-size: 11px;">latitude or longitude exceeded limits"
</span><font size="2">but when I look into the code, it seems the </font><span style="caret-color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85);"><font size="2">geodetic_crs->fwd is not initialized.</font></span></font></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<span style="caret-color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85); font-family: Menlo; font-size: 12px;"><br>
</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<font face="Menlo"><span style="caret-color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85); font-size: 12px;">The problem disappears if I call proj_init_plus but then I can't use the useful </span></font><span style="color: rgb(50, 109, 116); font-family: Menlo; font-size: 12px;">proj_crs_get_horizontal_datum, </span><span style="color: rgb(50, 109, 116); font-family: Menlo; font-size: 12px;">proj_create_ellipsoidal_2D_cs</span><span style="font-family: Menlo; font-size: 12px;">
with the PJ object created.</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<span style="caret-color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85); font-family: Menlo; font-size: 12px;"><br>
</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<span style="caret-color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85); font-family: Menlo; font-size: 12px;">Anybody understanding what's wrong with my code?</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<span style="caret-color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85); font-family: Menlo; font-size: 12px;"><br>
</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<span style="caret-color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85); font-family: Menlo; font-size: 12px;"><br>
</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<font face="Menlo"><span style="caret-color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85); font-size: 12px;">2) if I initialize my PJ object with proj.db, it seems the geoid grid of IGNF:LAMB93 is not loaded, so I can't compute the ellipsoidal height from
the altitude and vice versa. I can do it with the old format of proj4 (by copying the file IGNF of PROJ4 in the PROJ_LIB directory and using "+init=</span></font><span style="font-family: Menlo; font-size: 11px;">IGNF:LAMB93"</span><font face="Menlo" style="font-size: 10pt;"><span style="caret-color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85); font-size: 12px;">)
but then the object is not recognized as an iso object and once again I can't use </span></font><span style="color: rgb(50, 109, 116); font-family: Menlo; font-size: 12px;">proj_crs_get_horizontal_datum, </span><span style="color: rgb(50, 109, 116); font-family: Menlo; font-size: 12px;">proj_create_ellipsoidal_2D_cs
etc...</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<span style="color: rgb(50, 109, 116); font-family: Menlo; font-size: 12px;"><br>
</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<font face="Menlo"><span style="font-size: 12px;">Is there anything I did wrong or is it an issue with PROJ7?</span></font></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<font face="Menlo"><span style="font-size: 12px;"><br>
</span></font></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<font face="Menlo"><span style="font-size: 12px;">I hope I've been clear enough, any help would be really appreciated,</span></font></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<span style="caret-color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85); font-family: Menlo; font-size: 12px;"><br>
</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<span style="caret-color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85); font-family: Menlo; font-size: 12px;">Thanks a lot for your answers,</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<span style="caret-color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85); font-family: Menlo; font-size: 12px;"><br>
</span></p>
<p style="margin-right: 0px; margin-left: 0px; font-stretch: normal; line-height: normal; background-color: rgb(255, 255, 255);">
<span style="caret-color: rgba(0, 0, 0, 0.85); color: rgba(0, 0, 0, 0.85); font-family: Menlo; font-size: 12px;">Nicolas Bellaiche</span></p>
</div>
</div>
</body>
</html>