Setting up a Esri ArcGIS WFS source as a layer in Qlik GeoAnalytics (QGA)

    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.

    Step-by-step guide

    Start by figuring out the correct parameters. In this case the source is administrative boundaries (Buurt) of the Dutch city Zwolle.

    1. Usually an base url is given like this (http://services1.arcgis.com/3YlK2vfHGZtonb1r/ArcGIS/rest/services/Zwolle_WijkBuurt_gdb/FeatureServer/0), follow and click on "Query" at the bottom
    2. Set parameters Where 1=1, Outfield BRTNR (this is the field we want to use as index) in, and set the output to geojson and clicked Query (Get)
    3. Try out the the geojson in geojson.io, realise that projection needs to be 4326 (WGS84), changed the url param : outSR=4326.

      Note!
      If you want to use the builtin basemap, the geojson layer should be in WGS84 -> EPSG:4326

    4. And voilá a valid geojson url! http://services1.arcgis.com/3YlK2vfHGZtonb1r/ArcGIS/rest/services/Zwolle_WijkBuurt_gdb/FeatureServer/0/query?where=1%3D1&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&resultType=none&distance=0.0&units=esriSRUnit_Meter&returnGeodetic=false&outFields=BRTNR&returnGeometry=true&returnCentroid=false&multipatchOption=xyFootprint&maxAllowableOffset=&geometryPrecision=&outSR=4326&returnIdsOnly=false&returnCountOnly=false&returnExtentOnly=false&returnDistinctValues=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&resultOffset=&resultRecordCount=&returnZ=false&returnM=false&quantizationParameters=&sqlFormat=none&f=pgeojson&token=
    5. Check that the geojson works by setting it up as a static geodata layer.
    6. Then make a area layer with the geojson as input, BRTNR as dimension.I checked the geojson and used BRTNR as the "Source key attribute".

      geodata_settings.png
      See the attached Sense app for more details. Note 1, this example requires Qlik GeoAnalytics. Note 2, this app features data from an external service which might be out of service.

     

    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.