Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Apr 2, 2021 4:20:45 AM
Apr 21, 2017 4:55:05 AM
QGA can consume geodata from many different sources including Esri ArcGIS online, here's what's needed to show the data as a feature layer in QGA.
Start by figuring out the correct parameters. In this case the source is administrative boundaries (Buurt) of the Dutch city Zwolle.
Authentication in ArcGIS
Special note regarding Authentication in ArcGIS (Thanks to ssamuels for the solution)
The authentication when working with secured map services from ESRI can be solved by setting up a REST connection in the loadscript to retrieve a new access token from the REST API of ArcGIS Online. This is done by sending a GenerateToken request to the URL "https://www.arcgis.com/sharing/generateToken?parameters". The REST call must be a POST request over https and takes the following parameters:
username - Username of the user who wishes to get a token.
password - Password of user who wishes to get a token.
referer - The base URL of the web application that will invoke the services
expiration - The token expiration time in minutes (default value for this parameter is 60 minutes)
f - The response format. The value for this parameter must be "json".
The resulting access token is stored in the data model and can be used as a text variable to append to the location service url in the GeoAnalytics extension.
Hi Patrick,
Great post! I followed your instructions and succeeded in adding the GeoJSON url from ArcGIS Online as area layer in Qlik Sense.
After constructing the GeoJSON url I noticed there is a token parameter and value at the end. Does this mean this will also work for secured feature layers?
Thanks,
Steven
Hi Patrick,
I was wandering whether such magic base urls (like http://services1.arcgis.com or http://mapservices.prorail.nl) exist for other countries too?
If so, how to find them?
Thanks,
Denis
Hi Osama,
To do a layer like the Esri server must be setup to deliver data as GeoJSON service.
Please contact your Esri system adminstrator to do that.
Thanks,
Patric
Hi Steven,
Any parameter can be embedded in the url.
We also support header authentication like this:
https://username:password@www.example.com/index.htmlpassword@www.example.com/index.html
Note! username and password will not be sent as the part of the url, they be extracted from the call and embedded in the https header.
Thanks,
Patric
Hi Denis,
Good question, they are not easy to find, I don't know of any global directory.
Good places to search are often national open data initiative, like https://opendata.swiss/ or https://data.gov.uk or https://data.gov.sg they tend to have listings of the public servers that are available.
Thanks,
Patric
Hi Patrick,
When I create a geojson URL to connect to a secured feature layer in ArcGIS Online, the url becomes invalid after two weeks. The reason is the expiration of the token that is included in the url. Header authentication is not supported by the REST API of ArcGIS Online, so that's not an option. Do you have a solution for this?
Thanks,
Steven
Hi Patric, you added my ProRail example to this document!
You're welcome 😉
Hi Steven, sorry not at the moment, hopefully we will have more advanced authentication later on.
Ops, sorry Frank, do you want me to remove it?
No, don't worry, it's an honour 😉