{"id":544,"date":"2020-10-21T13:48:37","date_gmt":"2020-10-21T11:48:37","guid":{"rendered":"https:\/\/sigeo.cerege.fr\/?p=544"},"modified":"2020-10-21T14:25:42","modified_gmt":"2020-10-21T12:25:42","slug":"using-proj-transformation","status":"publish","type":"post","link":"https:\/\/sigeo.cerege.fr\/?p=544","title":{"rendered":"Using Proj transformation"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">PROJ is a generic coordinate transformation software that transforms geospatial coordinates from one coordinate reference system (CRS) to another. It is currently used in many GIS softwares, but can also be used through an API or by command-line tools. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Below some usefull command lines:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Simple conversion from a known coordinate system (CS) to another known CS :<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">here from UTM33N-WGS84 to WGS84<\/p>\n\n\n\n<code>echo 357000 4676000 | cs2cs +init=epsg:32633 +to +init=epsg:4326<\/code>\n<p>Should return<\/p>\n<p><code>13d16'2.189\"E 42d13'23.141\"N 0.000<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">More documentation https:\/\/proj.org\/usage\/quickstart.html<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">to add some formatting to output, specify the format with &#8220;-f&#8221; as a printf format string. For example &#8220;-f %.8f&#8221; will return the coordinate in decimal degrees with 8 decimals<\/p>\n\n\n\n<code>13.26727481 42.22309481 0.00000000<\/code>\n\n\n\n<p class=\"wp-block-paragraph\">to input several coordinates at a time, either use a file and pipe with cat<\/p>\n\n\n\n<code>cat coords_utm.txt | cs2cs +init=epsg:32633 +to +init=epsg:4326 -f %.8f<\/code>\nShould return the list of converted coordinates <br>\n13.26727481 42.22309481 0.00000000<br>\n13.54977927 42.05589846 0.00000000\n\n\n\n<p class=\"wp-block-paragraph\">and to output into a file, redirect with > symbol <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>cat coords_utm.txt | cs2cs +init=epsg:32633 +to +init=epsg:4326 -f %.8f > coords_dd_wgs84.txt<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">to input manually several coordinates, use EOF or whatever specific characters you like :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cs2cs EPSG:4326 EPSG:32631 &lt;&lt;EOF\n45N 2E\nEOF<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PROJ is a generic coordinate transformation software that transforms geospatial coordinates from one coordinate reference system (CRS) to another. It is currently used in many GIS softwares, but can also be used through an API or by command-line tools. Below some usefull command lines: Simple conversion from a known coordinate system (CS) to another known &hellip; <a href=\"https:\/\/sigeo.cerege.fr\/?p=544\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Using Proj transformation&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,1],"tags":[],"class_list":["post-544","post","type-post","status-publish","format-standard","hentry","category-geo-traitements","category-sigeo"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/sigeo.cerege.fr\/index.php?rest_route=\/wp\/v2\/posts\/544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sigeo.cerege.fr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sigeo.cerege.fr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sigeo.cerege.fr\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/sigeo.cerege.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=544"}],"version-history":[{"count":4,"href":"https:\/\/sigeo.cerege.fr\/index.php?rest_route=\/wp\/v2\/posts\/544\/revisions"}],"predecessor-version":[{"id":550,"href":"https:\/\/sigeo.cerege.fr\/index.php?rest_route=\/wp\/v2\/posts\/544\/revisions\/550"}],"wp:attachment":[{"href":"https:\/\/sigeo.cerege.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sigeo.cerege.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sigeo.cerege.fr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}