<div dir="ltr"><div>Hi Alain</div><div><br></div><div>EPSG:4326 is expecting lat-long. So the proper way is</div><div><span style="font-variant-ligatures:no-common-ligatures"><span style="font-variant-ligatures:no-common-ligatures">echo "70 10 0" | cs2cs </span>EPSG:4326 EPSG:5041</span></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures">The axis swap is because internally all the projections are expecting easing-northing coordinates, so they should be swapped from the northing-easing that is the input.</span></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures">An easy way to see the axis order is looking at the WKT2 representation of a CRS.<br></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 14 Apr 2023 at 08:29, Alain Orsoni <<a href="mailto:Alain.Orsoni@ign.fr">Alain.Orsoni@ign.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><div dir="auto" style="overflow-wrap: break-word;">Hello,<div><br></div><div>Basic question but necessary for me :</div><div><br></div><div>We use PROJ Version 8.2.1</div><div>Exemple : I convert from Longitude=10 Latitude=70 from 4326 to UPS stereo North Pole (5041)</div><div><br></div><div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">projinfo -s EPSG:4326 -t EPSG:5041 -o PROJ</span></div></div><div>Gives output :</div><div><br></div><div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">+proj=pipeline</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> +step +proj=axisswap +order=2,1</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> +step +proj=unitconvert +xy_in=deg +xy_out=rad</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> +step +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000</span></div><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures"> +ellps=WGS84</span></div></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures">But</span></div><div><span style="font-variant-ligatures:no-common-ligatures"><div style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span style="font-variant-ligatures:no-common-ligatures">echo "10 70 0" | cs2cs </span>EPSG:4326 EPSG:5041</div></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div>Gives output : <span style="font-family:Menlo;font-size:11px">11976062.58</span><span style="font-family:Menlo;font-size:11px;white-space:pre-wrap"> </span><span style="font-family:Menlo;font-size:11px">-1630989.83 0.00</span></div><div>The good result given by <a href="http://EPSG.IO" target="_blank">EPSG.IO</a> is : <span style="font-family:Menlo;font-size:11px">2389386.90</span><span style="font-family:Menlo;font-size:11px;white-space:pre-wrap"> </span><span style="font-family:Menlo;font-size:11px">-208322.83 0.00</span></div><div>I get the good result with : <span style="font-family:Menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">echo « 70 10 0" | cs2cs </span><span style="font-family:Menlo;font-size:11px">EPSG:4326 EPSG:5041</span></div><div><br></div><div>So it seems that the syntax. <span style="font-family:Menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">cs2cs </span><span style="font-family:Menlo;font-size:11px">EPSG:4326 EPSG:5041</span> doesn’t apply the step axisswap </div><div><br></div><div>Can someone confirm this behavior ?</div><div><br></div><div>Second question : </div><div>In C++ API the proj_create_crs_to_crs() associated to proj_normalize_for_visualization() allows to avoid this problem.</div><div>But we use also PROJ in shell scripts. It seems to me that some geodetic_crs expect lat-lon entry and some other Lon-lat.</div><div>Is there a way in the SQL database (proj.db) to find this information?</div><div><br></div><div>Thanks for any answer.</div><div><br></div><div>Alain</div><div><br></div><div><br></div><div><br></div></div></div>_______________________________________________<br>
PROJ mailing list<br>
<a href="mailto:PROJ@lists.osgeo.org" target="_blank">PROJ@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/proj" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/proj</a><br>
</blockquote></div>