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: 
avishay_levran
Contributor
Contributor

Qlik Cloud SHAPE file

Does Qlik Cloud support loading of SHAPE files ?

Labels (1)
8 Replies
Patric_Nordstrom
Employee
Employee

Sure, take a look at https://community.qlik.com/t5/Qlik-Sense-Documents/GeoOperations-Examples-Qlik-GeoAnalytics/ta-p/175...

Load * Extension GeoOperations.ScriptEval('
load() DATASOURCE cont GEOFILE type="shape", 
url="lib://DataFiles/continents.shpzip")';
Visual_Intelligence_Support
Partner - Contributor
Partner - Contributor

He was asking Qlik cloud, not Qlik Sense on prem. How can we even upload zip file to SaaS spaces?

JuMacedo
Partner - Contributor III
Partner - Contributor III

Hi! I was able to upload a shp file last week to Qlik Cloud, I followed the documentation using GeoOperations connector, exact the same way the example Patric sent:

Load * Extension GeoOperations.ScriptEval('
load() DATASOURCE shape GEOFILE type="shape", 
url="https://dl.dropbox.com/s/ipi6tazxwkbuzu6/continents.zip?dl=0"');

Just had to upload to dropbox before. 

KallePersson
Employee
Employee

@Visual_Intelligence_Support 

Shapefiles (zipped) can be uploaded via DataFiles in the Data Load Editor, though they have to be renamed so the file extension is ".shpzip", e.g. "foo.zip" => "foo.shpzip".

 

Screenshot 2024-01-16 at 13.30.06.png

Note that in order to see the geo files in the dialog you will need to change the filter to "Geographic files".
Also you can't select the geofiles through the select dialog at the moment, as the engine itself can't process them. We do have items in the backlog to improve how they are handled in the DLE / hub / catalog.

In order to use them in the script, you just refer to them with e.g. "lib://DataFiles/foo.shpzip" or "lib://space:DataFiles/foo.shpzip".

dp4
Contributor
Contributor

"In order to use them in the script, you just refer to them with e.g. "lib://DataFiles/foo.shpzip" or "lib://space:DataFiles/foo.shpzip"."

 

Can you please give an example? I cannot get this work for me. It always says file not found. Thank you!

JuMacedo
Partner - Contributor III
Partner - Contributor III

Hi,

I'm just curious...

I don't see the option of choosing Geographic files in that dialog box, does that mean one needs a specific version of Qlik?

I see delimited files, excel files then the next option is HTML files, I have no option to choose those geographic files in the data load editor. 

KallePersson
Employee
Employee

Hi,

Uploading geographic files is only available in QCS (Qlik cloud), in which it should be available for everyone.
If you are using the on-prem version of Sense it will not show up in the list.

KallePersson
Employee
Employee

Hi @dp4 ,

I am attaching a file to test with, if needed. Just rename it to "japan.geojson" first (I could only upload it if I changed the ending to .json).

Steps:

  • Open the load script editor in an app (note the space it's in as well - in this example it's TEST_SHARED.
  • Upload the geo file to DataFiles
    • There is a lack of feedback here at the moment, but if you change the file type dropdown to "Geographic files" it should show up
  • Then cancel the DataFiles dialog
  • (Optional) via the GeoOperations wizard
    • Create a GeoOperations connection if you don't have one
    • Click the select data button
    • Choose operation (in this case Load)
    • Let Type be "File-based geo dataset"
    • As URL, enter either:
      • If in a space => lib://<Space name>:DataFiles/<file name> (e.g. lib://TEST_SHARED:DataFiles/japan.geojson)
      • If in personal space => lib://DataFiles/<file name> (e.g. lib://DataFiles/japan.geojson)
    • Put in any other settings you need for the files
    • Select the table
    • Insert script
  • If not using GeoOperations, just manually set the URL of the dataset according to the URL example a few points above.

This gives me the following code:

[LoadResultTable]:
Load * Extension GeoOperations.ScriptEval('
    SELECT dataset_Geometry, name FROM
    Load()
    DATASOURCE dataset GEOFILE url="lib://TEST_SHARED:DataFiles/japan.geojson", keyField="name", type="auto", expectedGeomType="auto", crs="auto"
');