Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!

Esri AcrGIS integration with Qlik GeoAnalytics

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Nabeel_Asif
Employee
Employee

Esri AcrGIS integration with Qlik GeoAnalytics

Last Update:

Jul 27, 2017 2:29:33 AM

Updated By:

Nabeel_Asif

Created date:

Jul 27, 2017 2:29:33 AM

Esri AcrGIS Online integration with Qlik GeoAnalytics




Introduction

Qlik GeoAnalytics gives us the power to perform spatial analysis within Qlik Sense and QlikView apps. While many Qlik customers have existing GIS tools, their spatial assets are quite often sitting in silos. Combining spatial data with other data through Qlik's associative engine greatly enhances the business value that can be derived from such assets.


Some BI tools can make use of local files such as KML or Esri shape files as data sources, but this introduces security and maintenance headaches. With Qlik GeoAnalytics we have the capability to consume spatial content via hosted services. This document gives a step by step guide on how we can load data from secure content in ArcGIS to Qlik Sense. 


The process described here is similar for for ArcGIS Online and on-premise, but I have only tried it out with ArcGIS Online.

The integration can be broken down into these steps:

  1. Implement App Login in ArcGIS
  2. Setup Qlik to get a security token
  3. Build a query for the secure content
  4. Load the data using Qlik GeoAnalytics


If the content is public, the process is simpler and you can skip the first two steps and ignore all the talk about tokens.


To try out these steps you will need an ArcGIS Online developer account which you can get here.

Implement App Login in ArcGIS

ArcGIS provides a way for applications to use secure content by using App Login. Once you register for a developer account, you'll see the option to create a new Application. Do that and you will be able to get the stuff we need to generate tokens in Qlik.

Create App 01.png

Create App 02.png

You'll need the Client ID and Client Secret to automate the process of getting new tokens in Qlik.


Setup Qlik to get a security token

We can use the Qlik REST connector to obtain a token in the load script. There is a good explanation of the process on the ArcGIS side here.


For ArcGIS online we need to make a request to: https://www.arcgis.com/sharing/rest/oauth2/token/


For an on-premise server the url will look like this: https://<host>:<port>/<subdirectory>/sharing/rest/oauth2/token


Create a new REST connection in Qlik Sense with the following parameters and the Client ID and Client Secret you obtained earlier.


Token REST Connection.png


This will generate a load script to obtain the 'access_token'. Store the token into a variable in the load script. This can be done with the code below.

// Store the token in a variable that can be used as a request parameter
LET vToken = Peek('access_token', 0, 'root');


Tokens expire after a given period, but with this setup we can get the load script to obtain a new token before loading data from ArcGIS.


Load Script 01.png

Run the load to confirm that you're able to obtain a token. Copy the token text as we'll need that to build a query. One way of doing this is to export it from a table object in Qlik Sense.


Build a query for the secure content

You'll need some private content on ArcGIS Online to test out this bit. Create a new layer by uploading some spatial content such as a zipped shape file.

Create Layer 01.png

Make sure the security is set as private.


Create Layer 02.png


Once the layer is created you will be able to get a Service URL.


Create Layer 03.png


You can validate that the layer is private by trying out this URL in your browser. You should see a 'Token Required' message.


Create Query 01.png


You can add the token we obtained earlier to the URL manually using the syntax: <Service URL>?token=<token>


This lets you get to the Service Directory. From here click on the layer name, scroll all the way to the bottom and click on Query.


You now need to build a query for this layer. I've highlighted the most common parameters you might need to set for the query. Once you're done click on the Query (GET) button.


Create Query 02.png


If everything goes well you should see the JSON output of the query in your browser. Copy the URL from your browser's address bar as we will use this for loading the layer in Qlik GeoAnalytics.


Load the data using Qlik GeoAnalytics

We can now use the URL we obtained for the query to load the layer into Qlik Sense. If you are loading a polygon layer I would recommend using the Simplify operation in the GeoAnalytics connector and excluding the original geometry field in the load. If you are loading a point layer you can use the Load operation.


Load Data 01.png


Load Data 02.png


Once GeoAnalytics has generated the script you can change the hard coded token with the variable using dollar sign expansion i.e. $(vToken).


Load Data 03.png


You should now be able to load the secure ArcGIS content into your Qlik Sense app.

Comments
Matsa
Creator
Creator

Hi @Nabeel_Asif , thank you for the response,even with Load still I have problem.the GeoJson link  works in GeoData layer.(so I think It is ok)

Here are the steps which I followed:

  • I used 'Select Data'
  • I tried with Server URL 'Auto' and 'Custom'
  • Test Connection was ok
  • I used these setting:

clipboard_image_1.png

* I tried also with link of Json  and File Type=ErsiJson

 and this is the error message :

clipboard_image_0.png

 

In your opinion what could be a problem?

Thank you in advance.

Regards.

Matsa

0 Likes
Nabeel_Asif
Employee
Employee

@Matsa , I can't really tell. You could check if the geojson has any NULL geometries as they are a common cause of errors. You can raise a ticket with Qlik Support for help.

Matsa
Creator
Creator

Thanks @Nabeel_Asif  for the response.

Regards

 

0 Likes
mattruch
Contributor
Contributor

Hi @Nabeel_Asif ,

Is it possible to go the other way - that is, consume a Qlik endpoint in an ArcGIS Dashboard?

Thank you!

0 Likes
bchastai
Contributor III
Contributor III

This token method works with ArcGIS services, however only if there are less than 1000 features (or whatever the limit is set at for the specific service in question). If you are the administrator of the GIS service, you can bump up the feature limit so that Qlik can consume it all at once, but if the service is managed by another organization, you don't have that option.

GeoAnalytics needs some way of handling pagination, similar to the Qlik REST connector.

There might be some way to write the Data Load script w/ Loops to handle this case, but I'm not sure...

@Patric_Nordstrom 

0 Likes
Version history
Last update:
‎2017-07-27 02:29 AM
Updated by: