Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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
dhogan
Partner - Contributor III
Partner - Contributor III
Author

In case this is helpful, here is the entire polygon string which qlik says cannot be found

 

POLYGON ((-78.74939599999999 38.206648, -78.655273 38.260427, -78.663145 38.277933, -78.368743 38.184073999999995, -78.341674 38.176898, -78.209384 38.131128, -78.25398899999999 38.062813, -78.306762999999989 38.006474, -78.491332 37.796971, -78.497714 37.7631, -78.643918 37.733084, -78.66886199999999 37.724751999999995, -78.682986 37.78206, -78.83887399999999 38.04737, -78.780879 38.081029, -78.74939599999999 38.206648), (-78.519333 38.010678, -78.46368 38.020451, -78.448796 38.058447, -78.466129999999993 38.045700000000004, -78.49503399999999 38.065337, -78.519333 38.010678))

 

I tested it at the link below and it works perfectly so it must be a formatting issue I'm not accounting for in what qlik expects.

https://clydedacruz.github.io/openstreetmap-wkt-playground/

 

I also tried putting it into the format mentioned on the qlik page which also did not work:

[[[-78.74939599999999,38.206648],[-78.655273,38.260427],[-78.663145,38.277933],[-78.368743,38.184073999999995],[-78.341674,38.176898],[-78.209384,38.131128],[-78.25398899999999,38.062813],[-78.306762999999989,38.006474],[-78.491332,37.796971],[-78.497714,37.7631],[-78.643918,37.733084],[-78.66886199999999,37.724751999999995],[-78.682986,37.78206],[-78.83887399999999,38.04737],[-78.780879,38.081029],[-78.74939599999999,38.206648]],[[-78.519333,38.010678],[-78.46368,38.020451],[-78.448796,38.058447],[-78.466129999999993,38.045700000000004],[-78.49503399999999,38.065337],[-78.519333,38.010678]]]

Patric_Nordstrom
Employee
Employee

STAsText() returns WKT which GeoOperations can read using the load() operation using intable as dataset. 

 

Here's an example to read, first load to an inline table, then load with GeoOperations. The geometry field is renamed so we get a new field with Sense geoemtries.

 

LIB CONNECT TO 'Google_BigQuery_bps';
[sub]: SELECT `borough_name`, `borough_geom` FROM geo.sub;

poly:
Load * Extension
GeoOperations.ScriptEval(
'Select borough_name, borough_geom as borough_poly from Load()
', sub);

 

 

dhogan
Partner - Contributor III
Partner - Contributor III
Author

Thank you for the response.  I tried this and got the following error:

'GeoOpeations.ScriptEval is not a registered SSE function'
 
How do I resolve this?
Patric_Nordstrom
Employee
Employee

Sounds like a license issue, what environment are you running?

GeoAnalytics is included for Qlik Enterprise customers on Qlik SaaS.

Thanks,

Patric

dhogan
Partner - Contributor III
Partner - Contributor III
Author

My system admin reports the following:

I have setup the GeoExtensions that you should now see in Qlik
https://help.qlik.com/en-US/geoanalytics/Content/Qlik_GeoAnalytics/Home.htm
I also installed the GeoAnalyticsPlus connector for the dataset that is supposed to allow pulling from a local database.  This uses Java and I have installed the Java SQL Server drivers.   
https://help.qlik.com/en-US/geoanalytics/Subsystems/GeoConnector/Content/connector/connector-geoanal...

However, when I re-run the data load editor with the code you provided previously I get the same exact error.  I am really surprised at how difficult Qlik makes it to draw a simple polygon...

Patric_Nordstrom
Employee
Employee

Ok, my bad I thought you were running Qlik SaaS. GeoOperations is only available there.

For Qlik Sense Windows use the Qlik GeoAnalytics Plus connector, here's how to connect to a local db:

https://help.qlik.com/en-US/geoanalytics/Content/Qlik_GeoAnalytics/GeoAnalytics-Connector/GeoAnalyti...

Also attaching a mini tutorial loading and reading geo data from MS SQL Server.

Patric_Nordstrom_0-1623394909294.png

 

 

Thanks,

Patric

dhogan
Partner - Contributor III
Partner - Contributor III
Author

I appreciate the help but I'm still lost.  I'm not in Qlik Windows.  I'm in Qlik Sense Enterprise so this is all done through a browser.  Further, the instructions: "In Qlik open the GeoAnalytics ‘Select Data’." is oh so unhelpful.  I've found this a problem with many of your help sections.  It assumes the user (me in this case) knows how to get to the place your instructions start from which is a poor assumption for instructions to make.  Open GeoAnalytics where? I can't open any GeoAnalytics object, I can only drag them on to a sheet as I describe below.

In Qlik Sense Enterprise Edit Sheet I have 8 GeoAnalytics options but they don't seem to operate like a normal Qlik object.  I add the GeoAnalytics Map but it doesn't have any dimension or field options to add to it.  I can add an GeoAnalytics Area Layer but that also doesn't have dimension or field options and by default its just showing a random polygon with no map.  All I want to do is get a polygon put on a map...how do I get that done?  We are a Qlik Partner, can't someone set up a call to walk through this with me?  The back and forth via this forum doesn't seem to be moving us forward.

Patric_Nordstrom
Employee
Employee

To get started with GeoAnalytics I can recommend https://community.qlik.com/t5/GeoAnalytics/New-to-GeoAnalytics-Read-this-first/td-p/1565699

The minimum steps to load data from ms sql server

  1. Open Data Load Editor
  2. Create Data connection... "Qlik GeoAnalytics Connector"
  3. Choose "GeoAnalytics Plus"
  4. Click "Select data"
  5. Fill in the form

Patric_Nordstrom_1-1623657311630.png

 

 To render the data:

  1. Add a map chart
  2. Add an area layer, set location to the Geometry from the query

Patric_Nordstrom_2-1623657568695.png

 

Thanks,

Patric

dhogan
Partner - Contributor III
Partner - Contributor III
Author

So we've been stuck on your instructions.  

 

  1. Open Data Load Editor - YUP
  2. Create Data connection... "Qlik GeoAnalytics Connector" - YUP
  3. Choose "GeoAnalytics Plus" - YUP
  4. Click "Select data" - no such thing, 'Create Connection - GeoAnalytics Connector' has two options: 1) GeoAnalytics server (ours is GeoAnalytics Plus and is shown in the drop down); 2) Connection Name.  When we test connection we get "Could not contact the license service.  Please contact support"
  5. Fill in the form

So who in 'support' should I be contacting??