Sample 61531: Add markers at city locations on an OpenStreetMap (OSM) map
The sample code on the Full Code tab uses the SGMAP procedure with the OPENSTREETMAP and SCATTER statements to place markers on a map at city locations.
You must be using the fifth maintenance release of SAS® 9.4 (TS1M5) on 64-bit Windows or 64-bit Linux operating systems in order to run this sample.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample uses the SGMAP procedure with the OPENSTREETMAP and SCATTER statements to place markers on a map at city locations.
You must be using the fifth maintenance release of SAS 9.4 (TS1M5) on 64-bit Windows or 64-bit Linux operating systems in order to run this sample.
The extent of the map area is based on the values for the plotted data.
/* Create a data set containing the
latitude and longitude
for three cities in Germany */
data cities;
length city $20;
input y x city $20.;
datalines;
49.8988 10.902 Bamberg
49.4521 11.0767 Nuremberg
49.5897 11.012 Erlangen
;
run;
/* Use the OPENSTREETMAP statement for the
background map
Use the SCATTER statement to place the
points on the map */
title 'Place markers at German city locations on an OpenStreetMap map';
proc sgmap plotdata=cities;
openstreetmap;
scatter x=x y=y / markerattrs=(color=red size=10px symbol=circlefilled);
run;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> SGMAP
|
Date Modified: | 2018-06-01 14:53:11 |
Date Created: | 2017-12-07 14:18:33 |
Operating System and Release Information
SAS System | Base SAS | Linux for x64 | 9.4 TS1M5 | |
Microsoft® Windows® for x64 | 9.4 TS1M5 | |
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M5 | |
Microsoft Windows 8 Pro x64 | 9.4 TS1M5 | |
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M5 | |
Microsoft Windows 8.1 Pro x64 | 9.4 TS1M5 | |
Microsoft Windows Server 2008 for x64 | 9.4 TS1M5 | |