Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Tetranos
Contributor II
Contributor II

Display a Postgis geom on Qlik Sense

Hi all,

I've already posted that question on "Qlik Sense \ Qlik Sense App Development" but I'm not sure that was the good forum for it.

Therefore I try here...hope this will not be a problem (otherwise sorry).

 

According to the documentation "Qlik Sense can use: Fields containing geodata in GeoJSON, LineString, or MultiLineString formats.".

I'm trying to display a Qlik Map based on a Postgis column.

My Postgis column is Linestring ZM ESPG:2154. I'm creating a view on it to :

- transform it to ESPG:4326

- force it to 2D

- convert it to GeoJSON

 

The query looks like this : ST_AsGeoJSon(ST_Force2D(ST_Transform(geom, 4326)))

And returns something like that : {"type":"LineString","coordinates":[[4.29371849296831,44.0363076802448],[4.29399312738311,44.036478158726]]}

Then I load the view in my Qlik App, add a map, add a layer to the map and finally select the view column as the location....but nothing is displayed.

 

Regards,

Labels (2)
13 Replies
Patric_Nordstrom
Employee
Employee

The app reads from a qvd, whats the sql query that pulls the data?

Thanks,

Patric

WernerDC
Creator
Creator

See attached.

Thank you

 

Patric_Nordstrom
Employee
Employee

Modify the sql query something like this from:

Select "Id",
...
"Point"
...

 

to

 

Select "Id",
...
ST_AsGeoJSON(Point) :: json->'coordinates' AS Point
...

 

For more details see https://stackoverflow.com/a/57949792 and https://postgis.net/docs/ST_AsGeoJSON.html

Thanks,

Patric

 

Tetranos
Contributor II
Contributor II
Author

I recommand you to prepare the data on the Postgis server side and the load it.

You could create a view, materialized view or table on PostgreSQL/Postgis database with a column computed from the geom that looks like this : ST_AsGeoJSon(ST_Force2D(ST_Transform(<your geom column here>, 4326))) as GeomForQlik.