Location service

Introduction

A location service automatically translates a supplied name to geographic coordinates. There are multiple location services available to useQlikView, both local and remote. Qlik provides access to some by default.

Using a Location Server

The default location service is a server-based service with a large database of locations and geographic features: countries, states, cities, other administrative regions, with postal codes, etc. Both official codes and full names can be used to query the service, and there are names in multiple languages for many geographic features.

The default point service is available at:

i:///pointgeom/default

The default area service is available at:

i:///areageom/default

The format that a name should be specified as is:

name[[[,admin2code],admin1code],countrycode][:type]

Which contains the following arguments:

  • name - the name of the geographic feature that is being queried.
  • type - the type of name, with optional wildcard character (*) to match against several types. The table below contains the available types.
  • admin2code - the administrative region to search for the name within.
  • admin1code - the first-order division (e.g. state), to search for the name within.
  • countrycode - the two- or three-letter ISO country code to search for the name within.

The type can also be specified directly after name instead of at the end of the query. Type names are ordered hierarchically, and a wildcard (*) can be used after the type to check against multiple types.

Available types in GeoAnalytics for QlikView

Type group

Name Description Useful types
A* Administrative area Countries, states, regions, etc.

APCLI - country, 2-letter ISO country code, 3-letter ISO country code, or name

AADM1 - state, name or code, where applicable

AADM2 - second-order division

AADM3 - third-order division

AADM4 - fourth-order division

AADM5 - fifth-order division

P* Populated place Cities, towns, etc.

PPPLC - capital

PPPLG - seat of government

PPPLA - seat of first-order division

XCISO2 2 character ISO country code    
XCISO3 3 character ISO country code    
XPC Postal code Full or aggregated postal areas  
XIATA IATA Airport code    
XICAO ICAO Airport code    
XFAAC FAAC Airport code    
L* Land use Continents, parks, regions, etc. LCONT - continent
H* Hydrographic feature Lakes, rivers, canals, etc.  

There is a priority associated with each entry. When a name matches multiple entries the name with the highest priority is chosen. When there are several matching items with the same highest priority, this is indicated with a reply status of ambiguous.

The following input will find the city Hamburg in Germany:

Hamburg,DE

And this input will find Hamburg in Sweden:

Hamburg,SE

If you want the first-order administrative area in Germany named Hamburg, you also need to specify a type:

Hamburg,DE:AADM1

You can also specify multiple areas when needed. For example, in the USA there are many cities named Hamburg. To get the one in Arkansas, you will need to specify in your query:

Hamburg,AR,US

Using Geometry Files

A GeoJSON file can also be used as a geometry service, where names are looked up from an attribute in the file. Note that key attribute names are case-sensitive.

Any GeoJSON file with point data can be used as a point geometry service, by specifying the URL and name of the attribute that should be matched with the data.

Any GeoJSON file with polygonal data can be used as an area geometry service, by specifying the URL and name of the attribute that should be matched with the data.

The following geometry files are provided by Qlik for use with GeoAnalytics for QlikView:

URL Contains Key attributes
i://location/areas/countries.geojson Countries of the world

ISO_A2 - 2-letter ISO country code

ISO_A3 - 3-letter ISO country code

ISO_N3 - 2-digit ISO country code

NAME - country name

i://location/areas/states.geojson States of the world, including USA, Canada, Brazil and Australia

CODE - 2-letter state code, followed by 2-letter ISO country code, separated by comma, e.g. "TX,US"

NAME - state name

i://location/areas/se_kommuner.geojson Swedish kommuner

KNKOD - 4-digit code (kommunkod)

KNNAMN - name

Did this information help you?

Thanks for letting us know. Is there anything you'd like to tell us about this topic?

Can you tell us why it did not help you and how we can improve it?