ods html close;
ods html file="output.html";
/* Get British Columbia Census divisions from here:
https://www2.gov.bc.ca/gov/content/data/geographic-data-services/land-use/administrative-boundaries
*/
proc mapimport out=BC1
datafile="u:\canada\CD_2011.shp";
id cdname;
run;
/* Try mapping without changing coordinates */
title1 "British Columbia Choromap with Non-Projected Data";
proc sgmap mapdata=BC1 noautolegend;
choromap / mapid=cdname;
run;
/* Try mapping without changing coordinates with OpenStreetMap */
title1 "British Columbia Choromap with Non-Projected Data";
proc sgmap mapdata=BC1 noautolegend;
openstreetmap;
choromap / mapid=cdname;
run;
/* The from parameter below was put together from the .prj file.
To see a list of some of the .prj files and the values used
below, see http://cfconventions.org/wkt-proj-4.html.
When looking at the .prj file, here are the PROJ.4 values:
+proj = PROJCS
+dataum = DATUM
+ellps = Spheroid
+x_0 = False_Easting
+y_0 = False_Northing
+lon_0 = Central_Merdian
+lat_0 = Latitude_Of_Origin
+lat_1 = Standard_Parallel_1
+lat_2 = Standard_Parallel_2
+units = UNIT
+no_defs
Examples can be seen in sashelp.proj4def. */
proc gproject data=BC1 out=BC
from="+proj=aea +datum=NAD83 +ellps=GRS80
+x_0=1000000.0 +y_0=0.0
+lon_0=-126.0
+lat_0=45.0 +lat_1=50.0 +lat_2=58.5
+units=m +no_defs"
to="EPSG:4326"; /* always use EPSG:4236 for OSM and Esri */
id cdname;
run;
title1 "British Columbia Choromap with Projected Data";
proc sgmap mapdata=BC noautolegend;
openstreetmap;
choromap / mapid=cdname;
run;
quit;
ods html close;