Dataset
Data sources that can be used with operations in the Qlik GeoOperations extension.
CSV
Text files with table data, optionally with geometries. Instead of geometries also names of locations may be specified. All fields will be loaded as strings.
Parameter | Type | Use | Description |
---|---|---|---|
url | string | The URL of the file containing the data. URLs with file-protocol are normally not allowed. In a local customer installation it may be allowed. When login is required for accessing the URL, user and password can be specified in the URL like this: http://username:password@hostname/ (note that passing login information like this is not possible in IE9). | |
keyField | string | default: | The name of the field that contains identities for each geometry. If you leave the field empty a key field will be generated. |
geometryField | string | default: | Name of the geometry field if any. As an alternative to a geometry a column with names of well known names of points or areas may be specified, "Geometry Type" below. If point data is in two fields then specify name of latitude field comma name of longitude field. |
geometryType | string | default:POINT |
Type of geometry in the Geometry Field. Allowed values are
|
suffix | string |
For advanced user. The specified string is appended to all IDs.
This is a convenient way to specify more information to server based location services such as country code or type.
The alternative is to append the extra data when loading the table into Qlik.
With the following suffix all items are specified to be cities in Sweden:
,SE:city
See the Geometry Service Specification for more information on syntax to use.
| |
header | string | default: | The names of the columns separated by comma. If blank, the first row is supposed to contain the header. |
fieldSeparator | string | default:TAB | Character that separates fields. In addition to ordinary characters the key words TAB, NEWLINE, COMMA and SEMICOLON are allowed. |
recordSeparator | string | default:NEWLINE | Character that separates lines. In addition to ordinary characters the key words TAB, NEWLINE, COMMA and SEMICOLON are allowed. |
encoding | string | default:UTF-8 | Character set for the file. Same values allowed as in Java. |
stringQuotes | string | default: | Character that may be used for quoting strings. Field and record separators inside the quotes will not be parsed as such. The quotes will be removed in the imported data. In addition to ordinary characters the key words QUOTE("), DOUBLEQUOTE(") and SINGLEQUOTE(') are allowed. |
crs | string | default:Auto | CRS of the data to load. The data will be projected from this CRS to WGS84 (EPSG:4326) before being loaded into the app. If set to Auto then EPSG:4326 (WGS84) is used. |
GEOFILE
Loads different kinds of geographical file formats like GeoJSON and Shape.
This example loads a GeoJson file via the Simplify operation:
Load * Extension
GeoOperations.ScriptEval('
SELECT nuts.NUTS_ID as NUTS_ID, Simplified_nuts_Geometry FROM Simplify()
DATASOURCE nuts GEOFILE url="https://datahub.io/core/geo-nuts-administrative-boundaries/r/nuts_rg_60m_2013_lvl_1.geojson"');
Parameter | Type | Use | Description |
---|---|---|---|
url | string | The URL of the file containing the data. URLs with file-protocol are not allowed. When login is required for accessing the URL, user and password can be specified in the URL like this: http://username:password@hostname/ (note that passing login information like this is not possible in IE9). | |
keyField | string | default: | The name of the field that contains identities for each geometry. If you leave the field empty a key field will be generated. |
type | string | default:Auto |
The type of file. Allowed values are:
|
encoding | string | default: | For some formats (like ESRI Shape) the character encoding is not defined in the format. This gives a way to provide this information. For most formats this property is ignored. Uses the Java character encodings available. |
expectedGeomType | string | default:Auto |
Only a single geometric type is loaded at a time. If there are multiple types in the data, use this property to set which type is loaded.
For formats that does not support multiple types, this parameter is ignored.
|
crs | string | default:Auto | Coordinate reference System (CRS) of the data to load. The data will be projected from this CRS to WGS84 (EPSG:4326) before being loaded into the app. If set to Auto or if empty it will try to parse it from the file. If no CRS is found in the file, then EPSG:4326 (WGS84) is used. Note that setting this to a CRS overrides the information in the file and should only be done for files lacking such information or where it is known that it is wrong. Files with data with several CRSs are not supported. |
INTABLE
A table that is passed as input to the Extension function can be declared to specify how it should be interpreted.
If it is not declared, key field and geometry field can in many cases be automatically detected based on contents.
It is however recommended to declare tables so that the iterpretation does not change after a reload with new data.
If the table contains names instead of geometries or latitude and longitude columns, it must be declared.
If the table is not declared it will count as the first table for default datasets in operations. If it is declared, it will be counted in the order it is declared.
Normally the Sense geometry format is used but WKT format (https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry) is also supported.
This makes it possible to read geographic data from a database using one of the usual database connectors and thet convert the geometries to Sense geometries using the Load operation.
Note that when geometries are read from the database a function that returns the column in WKT format should be applied. The standard SQL function is called ST_AsText() but some databases have their own function.
Only one of the parameters that specify the location field may be used at a time, except latitudeField and longitudeField which always should be defined in pairs.
Example with latitude and longitude fields:
MyCities:
LOAD *
inline "
cid;lat;long
1;57.7;12
2;45.42;-75.70
" (delimiter is ';');
Load * Extension
GeoOperations.ScriptEval('
TravelAreas(costValue="10",costUnit="minutes")
DATASOURCE cities INTABLE keyField="cid", latitudeField="lat", longitudeField="long"', MyCities);
Example where the data contains named locations and because of that needs to declare the namedAreaField parameter:
MyCountries:
LOAD *
inline "
cid;Country
1;US
2;CA
" (delimiter is ';');
Load * Extension
GeoOperations.ScriptEval('
Simplify()
DATASOURCE countries INTABLE keyField="Country", namedAreaField="Country"', MyCountries{Country});
Parameter | Type | Use | Description |
---|---|---|---|
keyField | string | optional | The name of a field that contains unique identities for each row. If not specified a key column named _autoIndex_ will be added with unique values for each row. |
pointField | string | optional | Field containing point data in Sense point format, "[longitude, latitude]". Also WKT point data ("POINT(...)") is supported. |
lineField | string | optional | Field containing line data in Sense line format, like "[[longitude,latitude],[longitude,latitude],...]". Also WKT line data ("LINESTRING(...)" or "MULTILINESTRING(...)") is supported. |
polygonField | string | optional | Field containing line data in Sense polygon format, i.e. an array of closed lines or array of array of closed lines in case of multi-polygons. Also WKT polygon data ("POLYGON(...)" or "MULTIPOLYGON(...)") is supported. |
latitudeField | string | optional | Field containing latitude values. |
longitudeField | string | optional | Field containing longitude values. |
namedPointField | string | optional | Field containing names of geographic features that are looked up in the location database. The names will be represented with points. |
namedAreaField | string | optional | Field containing names of geographic features that are looked up in the location database. The names will be represented with polygons. Not all names in the location database have associated polygons. |
LOCATIONSERVICE
Points and areas that are available in a Qlik GeoAnalytics Server location service. Type or country must be specified.
The fields in tables loaded from the location service are:
- LocationDbId - unique id for each entity
- LocationPoint/LocationArea - the geometry of the entity
- CountryIso2 - the 2 letter country code
- Adm1Code - nation specific code of first order administrative area
- Adm2Code - nation specific code of second order administrative area
- LocationDbType - see the Geometry Service Specification for more info on the types
This example loads the states in US:
MyAirports:
Load *
Extension GeoOperations.ScriptEval('
Load()
DATASOURCE states LOCATIONSERVICE geometry="AREA", type="STATE", country="us"
');
Parameter | Type | Use | Description |
---|---|---|---|
geometry | string | default:Area | Chose to access Points or Areas. |
type | string | default:Country |
Type of data that the names represents such as countries, administrative areas, postal codes etc.
The following simplified type names can be used (case insensitive) in the native types in the location database:
|
country | string | default: | Country code (2 or 3 letters) for the country to access. Several countries may be specified, separated by comma. The default value means not restricted to a country. |
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!