Connecting Insights for ArcGIS to HANA
In earlier blog posts, I discussed how to configure ArcGIS Desktop and Pro to connect to an SAP HANA instance. Just this past December, Esri announced Insights for ArcGIS. It is a web-based, data analytics workbench where you can explore spatial and non-spatial data.
Insights can reference data in databases, in ArcGIS (your content, your organization’s content, Esri supplied demographics and so forth), and in spreadsheets. The connectivity from Insights to HANA incorporates specific optimizations to maximize performance. This means Insights can, with ease, fetch and manipulate large data sets returned from HANA.
While setting up demo environments with Insights and HANA, I found that although there is plenty of information on configuration, it either assumes deep knowledge of administering an ArcGIS instance or the needed information is spread across a number of places. I’m writing this blog to pull this information together in one place with screenshots, links and what I learned to hopefully save you time.
What you need to get started
You should first read the information here on how to install and configure Insights for ArcGIS.
The version of 64 bit SAP Client for Windows (or Linux) you’ll need depends on which OS Insights for ArcGIS is running on. See my earlier blog post on how to download the appropriate SAP Client. Don’t forget to download the version of the SAP Client that corresponds to the version of HANA you are connecting to. In this blog, I’ll assume Insights is installed on a Windows VM or machine. Check here to verify you are running a compatible version of HANA.
Insights requires the ngdbc.jar file which is part of the SAP Client for Windows install – 64 bit. Assuming you’ve installed it on your C:\ drive, the JAR file can be found here: C:\Program Files\sap\hdbclient
If you don’t need to install the SAP Client, you can extract the JAR file from the install itself and bypass the actual installation of the SAP Client. To do this, download the appropriate SAP Client SAR file and unpack it using the SAPCAR.exe utility. Assuming you have a copy of the SAPCAR.exe file in your current working directory where the SAR file is, you’d execute the following in the command prompt window:
C:\Temp> SAPCAR.exe -xvf <name_of_SAR_file.SAR>
See my blog post here for more detail. By default, SAPCAR will create a SAP_HANA_CLIENT directory in your current working directory and extract the contents of the SAR file there. The ngdbc.jar file is in the JDBC.TGZ archive in the client subdirectory (.\SAP_HANA_CLIENT\client). Use your favorite ZIP file utility to open the JDBC.TGZ archive and extract hgdbc.jar.
Before proceeding, you must create a zip file containing the JAR file. For example, ngdbc.zip. Create the zip file and place it in an easy to remember location. Windows will usually not let you create the zip file in the C:\Program Files directory. The ArcGIS Server Admin Directory utility does not accept JAR files for upload.
Configuring SAP HANA connectivity for Insights for ArcGIS
To upload the zip file, you use the ArcGIS Server Admin Directory utility. It is invoked via a web browser by surfing to the following URL:
where server-name is the name of the server or instance running ArcGIS Server.
The following webpage will display:
Once you enter the appropriate credentials or token and login, the following webpage will appear:
To upload the JAR file, click on uploads, then on upload. The following webpage will display:
Browse to the zip file you created containing the ngdbc.jar file, enter a brief description (e.g. “SAP HANA Express”) and click Upload. The following page will display:
You might want to make a note of the Item ID for use when registering the data source. To register the data source, click on Home in the breadcrumb trail on the webpage. This will return you to the homepage.
Click on the following resource link: data
Once you’ve clicked on data, click on relationalDataStoreTypes, then click on register. The following webpage should display:
Click on the – select uploaded item – pulldown. The just uploaded item should appear. If there’s more than one item listed, use the Item ID you noted earlier to select the right one. For the relational datastore, click on the – select type – pulldown and select SAP HANA. Click on Register Item to register HANA as the datasource. HANA is now available as a datasource in Insights. The above webpage calls the API call Register Relational Data Store Type which is documented here (the other APIs used by the above webpages are also documented there).
After uploading and registering the JAR file, you must not only restart ArcGIS Server (forced as part of the upload/register) but also restart the ArcGIS Datastore.
Connecting to an SAP HANA instance in Insights
Now that you have successfully uploaded and registered the ngdbc.zip file with ArcGIS Server, Insight users can now connect and interact with data in HANA. For details on how to connect to a new datasource in Insights, see here.
To access data in HANA from Insights for ArcGIS, the associated table(s) in HANA must meet certain requirements. Insights will access tables in HANA as follows:
- If there is more than one spatial column, Insights will pick the first one by default, but the user can change it by clicking on the down arrow next to the selected data pane.
- There must be a unique primary key. Insights gives the user the option of selecting a primary key field
- The primary key column and the spatial column(s) must be NOT NULL
- Insights will look at the data’s SRID and map it to the corresponding Esri SRID. Any HANA SRID that is EPSG based should automatically be mapped. You can query HANA system catalogs to find out which SRIDs are EPSG based.
SELECT * FROM ST_SPATIAL_REFERENCE_SYSTEMS WHERE organization = 'EPSG';
- All values in the spatial column must be of a homogeneous datatype (all points for example). Since Insights can read tables with multiple spatial columns, each spatial column can have a different homogeneous datatype (column B is all polygons, column A is all points). See here for supported HANA spatial datatypes.
Wrapping it up
Now that you can access your HANA data from Insights, you’re ready to start exploring and gain new insight by combining data from HANA, ArcGIS and demographic data like Tapestry. Enjoy!