Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I am having great difficulty showing an area layer based on a local csv with WKT data. See below example. I am trying to show this in an area layer, but i keep getting unsuccesful location lookup errors . Does anyone have any experience with this?
Kind regards,
Laurens
Hi,
QGA can't show WKT directly in a layer, load the csv file via GeoAnalytics connector Load or Simplify operation.
Unless you have Plus, place the csv on cloud drive.
If the data is in WGS84 and only one polygon per line, a hack is transform the WKT directly to Sense geometries like this
='[[['& replace(
replace(
replace(replace(WKT,'POLYGON((',''),'))','')
,', ','],[')
,' ',',')
& ']]]'
Thanks,
Patric
Hi,
QGA can't show WKT directly in a layer, load the csv file via GeoAnalytics connector Load or Simplify operation.
Unless you have Plus, place the csv on cloud drive.
If the data is in WGS84 and only one polygon per line, a hack is transform the WKT directly to Sense geometries like this
='[[['& replace(
replace(
replace(replace(WKT,'POLYGON((',''),'))','')
,', ','],[')
,' ',',')
& ']]]'
Thanks,
Patric
Hello Patric
I have file like following. I would like to convert this in WKT format to use in QGIS. Is there any easy option in to do that?
This geometry is created using dissolve funtion and works correctly in geoanalytics.
Appreciate your expert advice on this
Thanks
Hi,
Yes you can but it's easier to convert to GeoJSON, as the geometries are in that format.
Just add some text before and after, and add as an expression to a table and then do Export as data and copy column to a file or paste to geojson.io to test.
My geometry is it_Geometry and the attribute is it_Adm1Code, replace with your data.
=if(rowno()=1,'{"type":"FeatureCollection","features":[') &
'{"type": "Feature","geometry": {"type": "MultiPolygon","coordinates":' &
it_Geometry &
'},"properties": {"zip1": "' &
it_Adm1Code &
if(rowno()<>max(total aggr(rowno(),it_Adm1Code)),'"}},','"}}]}',)
Alternatively STORE to csv but then all double quotes and start and end quotes on each row needs to be removed. See app for more details.
Thanks,
Patric
HI Patric, that helped alot. Is there any chance to convert a multipolygon shape?
I have a MSSQL database with geometry datatype that I want to use in qlikSense.
Your replace-script works with polygons but not with multipolygon. Maybe I can convert to geoJSON?
Regards David
Hi,
For multipolygons it would look something like this:
='['& replace(replace(replace(replace(replace(my_wkt_string,'MULTIPOLYGON','')
,')',']')
,'(','[')
,', ','],[')
,' ',',')
& ']'
But it's much more stable to load the WKT using the QGA Connector and the Load operation.
Thanks,
Patric
Thanks! In my case, I need add a space in between POLYGON((