Hello to all,
I need to convert latitude and longitude expressed in degrees into UTM zone.
I use the code used in this form:
data have;
id=1; lat=45.5; long=73.5;
run;
proc gproject latlon degrees westlong
project=proj4 to="EPSG:32618" /* WGS 84 / UTM zone 18N */
data=have out=want;
id id;
run;
proc print data=want noobs; run;
but if I have some latitude and longitudes that do not fall as indicated in the instruction:
project=proj4 to="EPSG:32618"
how can i do to convert correctly? there's a way? Thank you all
Not sure what you are asking- could you explain more?
Are you asking about how to screen your data before you run gproject on it?
data have;
input id lat long;
datalines;
1 45.5 73.5
2 55.5 63.5
3 65.5 53.5
4 75.5 43.5
5 85.5 33.5
;
run;
proc gproject latlon degrees westlong
project=proj4 to="EPSG:32618"
data=have out=want;
id id;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.