<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert UTM to Lat Long for ED50 Zone 31N in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Convert-UTM-to-Lat-Long-for-ED50-Zone-31N/m-p/594311#M170723</link>
    <description>&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
    <pubDate>Sun, 06 Oct 2019 08:08:01 GMT</pubDate>
    <dc:creator>farshidowrang</dc:creator>
    <dc:date>2019-10-06T08:08:01Z</dc:date>
    <item>
      <title>Convert UTM to Lat Long for ED50 Zone 31N</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-UTM-to-Lat-Long-for-ED50-Zone-31N/m-p/586439#M167411</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to convert UTM-X and UTM-Y to Latitude and Longitude in meter for Datum&amp;nbsp; ED50 and Zone 31N:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;UTM-X =&amp;nbsp;513932.02&lt;/P&gt;&lt;P&gt;UTMY =&amp;nbsp;6266840.53&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the answer should be&amp;nbsp;&lt;/P&gt;&lt;P&gt;LAT =&amp;nbsp;56.54444957&amp;nbsp;&lt;/P&gt;&lt;P&gt;LONG= 3.2265688702&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used the formula here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Convert-LAT-LONG-to-UTM-and-back/ta-p/221779" target="_self"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Convert-LAT-LONG-to-UTM-and-back/ta-p/221779&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, in this formula&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;datum=WGS84&lt;/P&gt;&lt;P&gt;zone = 18N&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can change zone but when I change datum to ED50 I get&amp;nbsp;trouble with proj4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is proj4?&lt;/P&gt;&lt;P&gt;How can I change it to be fitted for ED50???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;I would be very grateful if you could help me with this&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 14:47:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-UTM-to-Lat-Long-for-ED50-Zone-31N/m-p/586439#M167411</guid>
      <dc:creator>farshidowrang</dc:creator>
      <dc:date>2019-09-05T14:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Convert UTM to Lat Long for ED50 Zone 31N</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-UTM-to-Lat-Long-for-ED50-Zone-31N/m-p/586451#M167412</link>
      <description>&lt;P&gt;Please provide the exact code that you used and the data set used as data step code. Paste both into a code box opened using the forum's {I} or "running man" icons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not even going to guess how someone actually&amp;nbsp;modified example code, as in the link provided, and then reports an issue.&lt;/P&gt;
&lt;P&gt;It may also help to describe the trouble when changing the datum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROJ4 is the set of calculations to do the Lat Long conversion to Mercator coordinates.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 15:32:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-UTM-to-Lat-Long-for-ED50-Zone-31N/m-p/586451#M167412</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-05T15:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Convert UTM to Lat Long for ED50 Zone 31N</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-UTM-to-Lat-Long-for-ED50-Zone-31N/m-p/586454#M167413</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your fast reponse. Here is my codes. They are working however, I want them for ED50 and not WGS84:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro latLong2UTM(DSN,lat=LAT,long=LONG,zone=18N);&lt;BR /&gt;data _null_;&lt;BR /&gt;no = compress("&amp;amp;zone", , "as");&lt;BR /&gt;if findc("&amp;amp;zone", "sS") = 0 then&lt;BR /&gt;call symputx("to", cats("+proj=utm +datum=WGS84 +units=m +no_defs +zone=", no));&lt;BR /&gt;else call symputx("to", cats("+proj=utm +datum=WGS84 +units=m +no_defs +south +zone=", no));&lt;BR /&gt;run;&lt;BR /&gt;proc gproject latlon degrees&lt;BR /&gt;project = proj4&lt;BR /&gt;from = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"&lt;BR /&gt;to = "&amp;amp;to"&lt;BR /&gt;data = &amp;amp;DSN(rename=(&amp;amp;lat=LAT &amp;amp;long=LONG))&lt;BR /&gt;out = &amp;amp;DSN;&lt;BR /&gt;id;&lt;BR /&gt;run;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;%macro UTM2latLong(DSN,y=Y,x=X,zone=18N);&lt;BR /&gt;data _null_;&lt;BR /&gt;no = compress("&amp;amp;zone", , "as");&lt;BR /&gt;if findc("&amp;amp;zone", "sS") = 0 then&lt;BR /&gt;call symputx("from", cats("+proj=utm +datum=WGS84 +units=m +no_defs +zone=", no));&lt;BR /&gt;else call symputx("from", cats("+proj=utm +datum=WGS84 +units=m +no_defs +south +zone=", no));&lt;BR /&gt;run;&lt;BR /&gt;data _UTM2latLong;&lt;BR /&gt;set &amp;amp;DSN;&lt;BR /&gt;_oldX = &amp;amp;x;&lt;BR /&gt;_oldY = &amp;amp;y;&lt;BR /&gt;rename &amp;amp;x=X &amp;amp;y=Y;&lt;BR /&gt;run;&lt;BR /&gt;proc gproject&lt;BR /&gt;project = proj4&lt;BR /&gt;to = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"&lt;BR /&gt;from = "&amp;amp;from"&lt;BR /&gt;data = _UTM2latLong&lt;BR /&gt;out = _UTM2latLong;&lt;BR /&gt;id;&lt;BR /&gt;run;&lt;BR /&gt;data &amp;amp;DSN(drop=x y rename=(_oldX=&amp;amp;x _oldY=&amp;amp;y));&lt;BR /&gt;set _UTM2latLong;&lt;BR /&gt;lat = y;&lt;BR /&gt;long = x;&lt;BR /&gt;run;&lt;BR /&gt;proc sql; drop table _UTM2latLong; quit;&lt;BR /&gt;%mend;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;infile datalines delimiter=',';&lt;BR /&gt;input lat long ;&lt;BR /&gt;datalines;&lt;BR /&gt;56.547480166,3.218883593&lt;BR /&gt;56.547518793,3.2189358171&lt;BR /&gt;56.547515029,3.2189742138&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;title "Original coordinates";&lt;BR /&gt;proc print data=test noobs; run;&lt;BR /&gt;%LatLong2UTM(test);&lt;BR /&gt;&lt;BR /&gt;title "LatLong2UTM";&lt;BR /&gt;proc print data=test noobs; run;&lt;BR /&gt;&lt;BR /&gt;data test2(drop=lat long);&lt;BR /&gt;set test;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;title "Original UTMs";&lt;BR /&gt;proc print data=test2 noobs; run;&lt;BR /&gt;&lt;BR /&gt;%UTM2LatLong(test2);&lt;BR /&gt;&lt;BR /&gt;title "UTM2LatLong";&lt;BR /&gt;proc print data=test2 noobs; run;&lt;BR /&gt;**************************************** */&lt;/P&gt;&lt;P&gt;data &amp;amp;DSN(drop=x y rename=(_oldX=&amp;amp;x _oldY=&amp;amp;y));&lt;BR /&gt;set _UTM2latLong;&lt;BR /&gt;lat = y;&lt;BR /&gt;long = x;&lt;BR /&gt;run;&lt;BR /&gt;proc sql; drop table _UTM2latLong; quit;&lt;BR /&gt;%mend;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 16:10:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-UTM-to-Lat-Long-for-ED50-Zone-31N/m-p/586454#M167413</guid>
      <dc:creator>farshidowrang</dc:creator>
      <dc:date>2019-09-05T16:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Convert UTM to Lat Long for ED50 Zone 31N</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-UTM-to-Lat-Long-for-ED50-Zone-31N/m-p/586491#M167425</link>
      <description>&lt;P&gt;Looking in the SASHELP.PROJ4DEF data set it looks like the Name that you want is the EPSG:4154. The description says that is for ED50(ED77)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or possibly the TO&amp;nbsp;string value of "+proj=longlat +ellps=intl +towgs84=-117,-132,-164,0,0,0,0 +no_defs"&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 17:34:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-UTM-to-Lat-Long-for-ED50-Zone-31N/m-p/586491#M167425</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-05T17:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Convert UTM to Lat Long for ED50 Zone 31N</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-UTM-to-Lat-Long-for-ED50-Zone-31N/m-p/586502#M167427</link>
      <description>&lt;P&gt;Proj4 is an open source coordinate projection software.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looks like the proj4 from-string for ED50 UTM zone 31N should be&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;+proj=utm +zone=31 +ellps=intl +units=m +no_defs &lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;Look here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://spatialreference.org/ref/?search=ED50" target="_self"&gt;https://spatialreference.org/ref/?search=ED50&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2019 18:16:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-UTM-to-Lat-Long-for-ED50-Zone-31N/m-p/586502#M167427</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-09-05T18:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert UTM to Lat Long for ED50 Zone 31N</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-UTM-to-Lat-Long-for-ED50-Zone-31N/m-p/586713#M167493</link>
      <description>&lt;P&gt;Dear sir,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Farshid&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2019 11:45:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-UTM-to-Lat-Long-for-ED50-Zone-31N/m-p/586713#M167493</guid>
      <dc:creator>farshidowrang</dc:creator>
      <dc:date>2019-09-06T11:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Convert UTM to Lat Long for ED50 Zone 31N</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Convert-UTM-to-Lat-Long-for-ED50-Zone-31N/m-p/594311#M170723</link>
      <description>&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2019 08:08:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Convert-UTM-to-Lat-Long-for-ED50-Zone-31N/m-p/594311#M170723</guid>
      <dc:creator>farshidowrang</dc:creator>
      <dc:date>2019-10-06T08:08:01Z</dc:date>
    </item>
  </channel>
</rss>

