SAS Communities Library

We’re smarter together. Learn from this collection of community knowledge and add your expertise.
BookmarkSubscribeRSS Feed

Geographical visualizations in SAS Visual Analytics

Started ‎12-20-2024 by
Modified ‎12-20-2024 by
Views 2,278

I always get a lot of questions about the possibilities of geographic maps in SAS. Especially a lot from municipalities, water boards and other government agencies.

 

In this blog I want to describe some of the possibilities through a number of use examples.

-Map background
-Data
-Creating a Geography data item
-Shape files
-Geo objects
-Properties
-Using icons instead of dots
-Routing, drivetime and geographic area
-Geocode with ESRI
-Geoenrichment with ESRI
-SAS ArcGISWebMapProvider

 

First, I want to distinguish between data and background maps. Data projected on a map can be in the form of points, polyline and polygon

 

Map background

 

What options do you have regarding map backgrounds? SAS supports Openstreetmap and ESRI by default. The report/dashboard author can choose which map background to use.  Sometimes it might be even better not to use a map background because the shapes are already clear enough and the map background just creates unnecessary noise.


After dragging one of the GEO objects available in Visual Analytics onto the canvas, you can scroll down to the map servers in the properties pane on the right. By clicking on the icon next to it you can see what options are available for your environment. Openstreetmap and ESRI map backgrounds have multiple background maps options to choose from. Openstreetmap map services are received from “http://opnsta.sas.com/” or “ http://opnstb.sas.com/ ‘ and ’http://opnstc.sas.com/” and ESRI map services are received from “https://services.arcgisonline.com/ArcGIS/rest/services ” . It is also possible to add your own ESRI environment for alternative background maps.

 

Background map.mp4
Video Player is loading.
Current Time 0:00
Duration 1:00
Loaded: 0%
Stream Type LIVE
Remaining Time 1:00
 
1x
    • Chapters
    • descriptions off, selected
    • captions off, selected
    • en (Main), selected
    (view in My Videos)

     

    The default background map can be set at your SAS profile, top right. Settings -> Geographic mapping.

     

    GEO settings on account.mp4
    Video Player is loading.
    Current Time 0:00
    Duration 0:31
    Loaded: 0%
    Stream Type LIVE
    Remaining Time 0:31
     
    1x
      • Chapters
      • descriptions off, selected
      • captions off, selected
      • en (Main), selected
      (view in My Videos)

       

      Data


      There are several ways to project data onto a geographic map. This can be done by Geographic Name or Code lookup, by creating a geographic data provider or by using the Latitude and longitude in data.


      Geographic Name or Code lookup

      Geographic Name or Code lookup uses standards like ISO codes of countries, names of countries and for America there are additional options like State name or abbreviations and ZIP codes.

       

      Geographic data providers

      Geographic data providers use shape file data stored in a data source or from an ESRI feature service. In the provider you specify where the data can be retrieved, what kind of Geometry type it is and optionally you can change the standard Coordinate space (Word Geodetic System (WGS84)).

      The big advantage of Geographic data providers is that you only have to use them once and can use them in many reports and dashboards. To be allowed to create or modify a Geographic data provider, you must belong to the 'Esri users' group.


      Latitude and longitude in data

      If the data source contains Latitude and Longitude in its columns, you can use it for one of the other data items by changing classification to Geography and selecting these columns. For example, to show an address onto a map for those coordinates.

       

      Creating a Geography data item

       

      In the data pane on the left side, a category or measure can be converted to a Geography data item. The report creator can then choose from the choices described above. The middle choice, Geo data provider, uses either shape data in a SAS data source loaded into memory (CAS) or by using an ESRI feature service. In the latter case, the shape data is fetched to SAS from, for example, a public service or ESRI's own internal environment while opening the report.

       

      Creating a GEO Data Provider on a CAS Table:

      Create GEO Data Provider on source table.mp4
      Video Player is loading.
      Current Time 0:00
      Duration 0:00
      Loaded: 0%
      Stream Type LIVE
      Remaining Time 0:00
       
      1x
        • Chapters
        • descriptions off, selected
        • captions off, selected
          (view in My Videos)

           

          Editing a GEO Data Provider to an ESRI Feature Service:

          Edit GEO Data Provider to ESRI FS.mp4
          Video Player is loading.
          Current Time 0:00
          Duration 0:00
          Loaded: 0%
          Stream Type LIVE
          Remaining Time 0:00
           
          1x
            • Chapters
            • descriptions off, selected
            • captions off, selected
            • default, selected
            (view in My Videos)

             

            Shape files

             

            There are all kinds of providers of Shape files. These are a series of files that make up the Polygons or Polylines. For example at https://www.pdok.nl/ or on Arcgis online. Many companies also create their own shape files of their own areas or objects.

            There are several ways to read these into SAS. It can be done through the CLI (command line interface), through a piece of script with proc mapimport or in SAS Studio with one of the custom steps available on our Github page. You can also directly create a GEO Data Provider through this step.

             

            https://github.com/sassoftware/sas-studio-custom-steps

             

            SAS Github custom Steps.mp4
            Video Player is loading.
            Current Time 0:00
            Duration 0:00
            Loaded: 0%
            Stream Type LIVE
            Remaining Time 0:00
             
            1x
              • Chapters
              • descriptions off, selected
              • captions off, selected
                (view in My Videos)

                 

                Geo objects


                In Visual Analytics there are a series of standard objects to create GEO visualizations. For coordinates, polygons, polylines or combinations of polygons/polylines with coordinates. These combined objects consist of 2 layers that you can make visible and not visible at the top right of the object. And to abundance itself a GEO PIE object.

                 

                GEO Objects.mp4
                Video Player is loading.
                Current Time 0:00
                Duration 0:00
                Loaded: 0%
                Stream Type LIVE
                Remaining Time 0:00
                 
                1x
                  • Chapters
                  • descriptions off, selected
                  • captions off, selected
                    (view in My Videos)

                     

                    Geo visualizations with more than 2 layers are of course also possible. All data comes from SAS via codes, Geo data providers or longitude & latitude.

                     

                    GEO more layers.mp4
                    Video Player is loading.
                    Current Time 0:00
                    Duration 0:00
                    Loaded: 0%
                    Stream Type LIVE
                    Remaining Time 0:00
                     
                    1x
                      • Chapters
                      • descriptions off, selected
                      • captions off, selected
                        (view in My Videos)

                         

                        Geo objects with more than 2 layers can be created with a custom graph. A new template of a GEO object can be created here.

                         

                        GEO custom chart.mp4
                        Video Player is loading.
                        Current Time 0:00
                        Duration 0:00
                        Loaded: 0%
                        Stream Type LIVE
                        Remaining Time 0:00
                         
                        1x
                          • Chapters
                          • descriptions off, selected
                          • captions off, selected
                            (view in My Videos)

                             

                            Other examples, also including animation

                             

                            Examples GEO objects.mp4
                            Video Player is loading.
                            Current Time 0:00
                            Duration 0:00
                            Loaded: 0%
                            Stream Type LIVE
                            Remaining Time 0:00
                             
                            1x
                              • Chapters
                              • descriptions off, selected
                              • captions off, selected
                                (view in My Videos)

                                 

                                Properties

                                 

                                In the properties pane on the right. Many properties can be adjusted. For example, title, background color, color gradient, disable zoom & pan, labels, map background and the legend.

                                 

                                By default, GEO objects zoom in according to the data being displayed. For example if we have the map of the Netherlands and I select a municipality via a filter the map will zoom in from all of the Netherlands to that municipality. There is an option to make sure that all polygons in the data remain visible and only the selected municipality gets a color. This is done with the 'Placeholder regions' option.

                                 

                                GEO Placeholder.mp4
                                Video Player is loading.
                                Current Time 0:00
                                Duration 0:00
                                Loaded: 0%
                                Stream Type LIVE
                                Remaining Time 0:00
                                 
                                1x
                                  • Chapters
                                  • descriptions off, selected
                                  • captions off, selected
                                    (view in My Videos)

                                     

                                    Using icons instead of dots

                                     

                                    Of course, you can distinguish between the different points with colors and sizes. It is also possible to change these points into icons. This is done with display rules. Icons from the standard library can be used, also it is possible to use your own image.

                                     

                                    Icons.mp4
                                    Video Player is loading.
                                    Current Time 0:00
                                    Duration 0:00
                                    Loaded: 0%
                                    Stream Type LIVE
                                    Remaining Time 0:00
                                     
                                    1x
                                      • Chapters
                                      • descriptions off, selected
                                      • captions off, selected
                                        (view in My Videos)

                                         

                                        Routing, drivetime and geographic area

                                         

                                        In the user's settings, the Arcgis online account can also be linked to SAS. This makes additional functionality available such as asftand / driving time analyses.

                                         

                                        Routing.mp4
                                        Video Player is loading.
                                        Current Time 0:00
                                        Duration 0:00
                                        Loaded: 0%
                                        Stream Type LIVE
                                        Remaining Time 0:00
                                         
                                        1x
                                          • Chapters
                                          • descriptions off, selected
                                          • captions off, selected
                                            (view in My Videos)

                                             

                                            Geocode with ESRI

                                             

                                            If you want to project data onto a map and you have no coordinates in the data, geocoding with ESRI is a convenient and fast way. For this the user account must be linked to an Arcgis online account. This feature will cost ESRI credits depending on the amount of lines to get latitude and longitude.

                                             

                                            GeoCode.mp4
                                            Video Player is loading.
                                            Current Time 0:00
                                            Duration 0:00
                                            Loaded: 0%
                                            Stream Type LIVE
                                            Remaining Time 0:00
                                             
                                            1x
                                              • Chapters
                                              • descriptions off, selected
                                              • captions off, selected
                                                (view in My Videos)

                                                 

                                                Geoenrichment with ESRI

                                                 

                                                In addition to geocoding, ESRI also lets you enrich the data from their data library. This works in a similar way to Geocode. This feature also costs ESRI credits.

                                                 

                                                SAS ArcGISWebMapProvider

                                                 

                                                The SAS ArcGISWebMapProvider uses an ESRI Webmap. The webmap is created in Arcgis desktop, for example, and can consist of multiple layers with data about, for example, parks and train tracks. On top of those layers, 1 layer can be projected from SAS. This allows you to combine data from SAS and ESRI in 1 visualization in SAS Visual Analytics. A detailed description and manual can be found at https://github.com/sassoftware/sas-visualanalytics-geowebmap.

                                                 

                                                SAS ArcGISWebMapProvider1.mp4
                                                Video Player is loading.
                                                Current Time 0:00
                                                Duration 0:00
                                                Loaded: 0%
                                                Stream Type LIVE
                                                Remaining Time 0:00
                                                 
                                                1x
                                                  • Chapters
                                                  • descriptions off, selected
                                                  • captions off, selected
                                                    (view in My Videos)

                                                     

                                                    SAS ArcGISWebMapProvider - 3D

                                                     

                                                    SAS ArcGISWebMapProvider2.mp4
                                                    Video Player is loading.
                                                    Current Time 0:00
                                                    Duration 0:00
                                                    Loaded: 0%
                                                    Stream Type LIVE
                                                    Remaining Time 0:00
                                                     
                                                    1x
                                                      • Chapters
                                                      • descriptions off, selected
                                                      • captions off, selected
                                                        (view in My Videos)

                                                         

                                                        Ik hoop dat dit een goed beeld geeft van de mogelijkheden van geographical visualisaties in SAS met OpenstraatMap en de nog uitgebreidere mogelijkheden

                                                        met ESRI.

                                                        Comments

                                                        Impressive.
                                                        I also like the touch of Dutch (last sentence). 😉

                                                        Koen

                                                        And the "layout of the circuit" - thing ... That is "Circuit Zandvoort" in the Netherlands for those wondering.

                                                        Koen

                                                        Version history
                                                        Last update:
                                                        ‎12-20-2024 10:16 AM
                                                        Updated by:
                                                        Contributors

                                                        sas-innovate-white.png

                                                        Our biggest data and AI event of the year.

                                                        Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

                                                        Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

                                                         

                                                        Register now!

                                                        SAS AI and Machine Learning Courses

                                                        The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

                                                        Get started

                                                        Article Labels
                                                        Article Tags