Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
dhogan
Partner - Contributor III
Partner - Contributor III

Qlik Polygon Format

Looking through this article - https://help.qlik.com/en-US/geoanalytics/Subsystems/GeoOperationsService/Content/connector/connector...

I see that I can pass polygon data to qlik for it to display.  So out of SQL server I am using geometry.STAsText() to get something that looks like this: POLYGON ((lat long, lat long, lat long, lat long), (lat long, lat long, lat long, lat long))

Yet when I pass it to qlik and put it in the map dimension qlik yells at me that it doesn't know what I just gave it.  According to the article above this format seems like it would work but since the format/layout details are lacking and there is no complete example I'm not sure what qlik is expecting.  Can anyone help me out?

 

 

14 Replies
Patric_Nordstrom
Employee
Employee

The recommendation is to restart the sense server after installing GeoAnalytics Plus, that should solve the issue.

Thanks,

Patric

dhogan
Partner - Contributor III
Partner - Contributor III
Author

response to that from our system admin: "yea i did that multiple times. after making sure the license was linked...."

 

what next....

Patric_Nordstrom
Employee
Employee

The Sense server needs internet access, at least to https://*.qlikcloud.com.

If still no connection the following may need to added to IdevioGeoAnalyticsConnector.exe.config

at C:\Program Files\Common Files\Qlik\Custom Data\QvIdevioConnector

<add key="javaArgs" value="-Dcom.qlik.geo.plus.acceptAllCertificates=true" />

Thanks,

Patric

dhogan
Partner - Contributor III
Partner - Contributor III
Author

Alright we have the connector available but now we move on to another problem (see load and error below). 

Any thoughts on why this error is occuring?

 

 

LOAD fips,

name,

poly,poly2;

 

[QLIKGeo]:

SELECT fips,

name,

poly,poly2

FROM dh.QLIKGeo;

 

 

 

LIB CONNECT TO 'QGA';

 

/* Generated by GeoAnalytics for operation Load ---------------------- */

[_inlineMap_]:

mapping LOAD * inline [

_char_, _utf_

"'", '\u0027'

'"', '\u0022'

"[", '\u005b'

"/", '\u002f'

"*", '\u002a'

";", '\u003b'

"}", '\u007d'

"{", '\u007b'

"`", '\u0060'

"´", '\u00b4'

" ", '\u0009'

];

 

IF FieldNumber('fips', 'QLIKGeo') = 0 THEN

call InvalidInlineData('The field fips in QLIKGeo is not available');

END IF

IF FieldNumber('name', 'QLIKGeo') = 0 THEN

call InvalidInlineData('The field name in QLIKGeo is not available');

END IF

IF FieldNumber('poly2', 'QLIKGeo') = 0 THEN

call InvalidInlineData('The field poly in QLIKGeo is not available');

END IF

Let [TESTGEOInlineTable] = 'fips' & Chr(9) & 'name' & Chr(9) & 'poly2';

Let numRows = NoOfRows('QLIKGeo');

Let chunkSize = 1000;

Let chunks = numRows/chunkSize;

For n = 0 to chunks

Let chunkText = '';

Let chunk = n*chunkSize;

For i = 0 To chunkSize-1

Let row = '';

Let rowNr = chunk+i;

Exit for when rowNr >= numRows;

For Each f In 'fips', 'name', 'poly2'

row = row & Chr(9) & MapSubString('_inlineMap_', Peek('$(f)', $(rowNr), 'QLIKGeo'));

Next

chunkText = chunkText & Chr(10) & Mid('$(row)', 2);

Next

[TESTGEOInlineTable] = [TESTGEOInlineTable] & chunkText;

Next

chunkText=''

 

 

[TESTGEO]:

SQL SELECT [fips], [name], [poly] FROM Load(dataset='TESTGEO')

DATASOURCE TESTGEO INLINE tableName='QLIKGeo', tableFields='fips,name,poly2', geometryType='WKT', loadDistinct='NO', suffix='', crs='Auto' {$(TESTGEOInlineTable)}

;

tag field [fips] with '$primarykey';

 

[TESTGEOInlineTable] = '';

 

/* End GeoAnalytics operation Load ----------------------------------- */

 

 

 

Started loading data

Connected

Connected

Connected QLIKGeo << QueryResult Lines fetched: 1

Connected _inlineMap_ << ad5826a7-b157-47fd-8e19-e196eda36853 Lines fetched: 11

The following error occurred:

Connector reply error: QVX_SYNTAX_ERROR: Failed to process query: Failed to create dataset TESTGEO: org.locationtech.jts.io.ParseException: Expected word but found End-of-Stream (line 1)

The error occurred here:

[TESTGEO]: SQL SELECT [fips], [name], [poly] FROM Load(dataset='TESTGEO') DATASOURCE TESTGEO INLINE tableName='QLIKGeo', tableFields='fips,name,poly2', geometryType='WKT', loadDistinct='NO', suffix='', crs='Auto' {fips name poly2 51003 Albemarle \u005b\u005b\u005b-78.74939599999999,38.206648],\u005b-78.655273,38.260427],\u005b-78.663145,38.277933],\u005b-78.368743,38.184073999999995],\u005b-78.341674,38.176898],\u005b-78.209384,38.131128],\u005b-78.25398899999999,38.062813],\u005b-78.306762999999989,38.006474],\u005b-78.491332,37.796971],\u005b-78.497714,37.7631],\u005b-78.643918,37.733084],\u005b-78.66886199999999,37.724751999999995],\u005b-78.682986,37.78206],\u005b-78.83887399999999,38.04737],\u005b-78.780879,38.081029],\u005b-78.74939599999999,38.206648]],\u005b\u005b-78.519333,38.010678],\u005b-78.46368,38.020451],\u005b-78.448796,38.058447],\u005b-78.466129999999993,38.045700000000004],\u005b-78.49503399999999,38.065337],\u005b-78.519333,38.010678]]]}

Data has not been loaded. Please correct the error and try loading again.

 

Patric_Nordstrom
Employee
Employee

From the code it doesn't look like the query returns WKT. If it's SQL server the query has be phrased something like this to return WKT:

SELECT fips, geometry.STAsText() as poly

 

GeoAnalytics connector examples: https://community.qlik.com/t5/Qlik-Sense-Documents/Connector-Examples-Qlik-GeoAnalytics/ta-p/1548148

MS SQL Server example: https://community.qlik.com/t5/Qlik-Sense-Documents/MS-SQL-Server-and-Qlik-GeoAnalytics-QGA/ta-p/1521...

Thanks,

Patric