Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bing_jville
Contributor III
Contributor III

Convert and read geometry data in SQL server using Geoanalytics (not plus)

Hi

1) I have geometry data (column "shape") in SQL server database. And I converted it into WKT using STAsText().

SELECT RegionID
, shape
,shape.STAsText() as wkt
FROM dbo.Regions

2019-03-20_15-43-47.png

2) Then I loaded this table as a table into Qlik Sense.

3) Can I use GeoAnalytic Connector (not plus) to load the WKT field from the previously loaded table, then visualize on map?

 

Thanks

 

Labels (2)
3 Replies
Patric_Nordstrom
Employee
Employee

Sure, use "Load", "Loaded table" and Geometry type "WKT". You will also need to specify the CRS (EPSG code).

wkt.png

 

Thanks,

Patric

bing_jville
Contributor III
Contributor III
Author

Thanks Patric. I tried a few more times this morning, still can't read  the WKT.

2019-03-21_8-08-54.png

The WKT shows ok in my SQL server management studio. But I can't see the data value once I loaded the table into Qlik.

And QGA can't find the value either. I've tried your method of using "replace" to convert the data. But Qlik can't read the value. And I've noticed my WKT is different with yours. I have a space between POLYGON and ((

e.g. POLYGON ((1888813.9814 5796074.3189, ...

 

1. My SQL geometry data is correct - SQL management studio can display the map

2. I tried STAsText(), ToString(), AsTextZM() - same error, QGA can't read 

 

Patric_Nordstrom
Employee
Employee

Ok, I would check so that wkt strings are not truncated, some dbs do that.
WKT from SQL Server are readable by QGA (https://community.qlik.com/t5/Qlik-GeoAnalytics-Documents/MS-SQL-Server-and-Qlik-GeoAnalytics-QGA/ta...)

Can you post 2-3 lines of the wkt strings? What projection does the data have, EPSG code?