Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Apr 2, 2021 4:17:27 AM
Jun 2, 2017 4:18:20 AM
It's common that customers keep geodata in shapefiles, here's how to load them in to QlikView and Qlik Sense using Qlik GeoAnalytics.
Reading local files requires care, here's a checklist:
File location | Use | Tip |
On public url | Use Qlik Sense Server/Desktop, Qlik GeoAnalytics connector | Check the link provides direct access of the file |
On laptop harddrive | Use Qlik Sense Desktop, Qlik GeoAnalytics connector with Qlik GeoAnalytics Plus | Drop the folder in the browser to get the correct syntax: file:/// etc. |
On Sense server | Use Qlik Sense Server, Qlik GeoAnalytics connector with Qlik GeoAnalytics Plus | Make sure the file is accessible for the Sense system user. |
On map server | Use Qlik GeoAnalytics Server and Qlik GeoAnalytics connector | Verify that the file is accessible for the map server system user. Trick, check with "Add service" file browser under "Service administration" in the server admin tool. Turn on local file access in the map server. |
Step-by-step guide
First place the shapefile in a zip file. In this example I'm using the Congressional Districts from US Census. A shapefile is actually several files, at least .shp file and .dbf file. Place the zip file on a webserver (Dropbox is handy).
Open the connector and choose "Simplify" (Load can also be used but it's good practice to simplify especially if the shapefile is large (>2MB).
Choose "Auto" for resolution.
Fill in the url: https://www2.census.gov/geo/tiger/TIGER2016/CD/tl_2016_us_cd115.zip or for local files file:///C:/ (Plus required)
A key field is handy but not mandatory, fill in GEOID in this example.
Fill in the CRS: EPSG:4269 (This shapefile is in coordinate system NAD 83, use internet search to find the EPSG code).
Click next, the operation return two tables: one table with index and the simplified geometry and second table with original non-simplified shapes and attributes. Uncheck "Geometry" in the second table if you just want the attributes.
Click Insert script and Load Data
URL
The url must be with direct access to the file. Test by opening the url in a browser, the download should start immediately. Tip, use "dl" instead "www" to get direct access of Dropbox files. |
Local files
For local zip files in a local file system, QGA Plus or QGA Server is required and use the url syntax file:///C:/Users/bps/Desktop/test.zip. Tip, drag and drop a folder to the browser to get the url. |
CRS
A tip to find out the coordinate system is to take look inside the .prj file if such exist. Tip, use a search engine for a key word to find the EPSG code. |
See below for example apps for Qlik Sens and QlikView as well as the shapefile example data.
Please note that when running the QlikView example you need to insert a connection string with the connector.
I got an error that the size of the shapefile dataset is higher than the maximum allowed by license. What is the size limit? Is the size based on zipped or unzipped?
Thanks.
Hi Stacy,
The max is 20000 features, for QGA Plus and QGA Enterprise there is no limit.
Features are number of rows, unzipped.
Thanks,
Patric
This example i've succesfully executed, but when i tried to replicate it with a shapefile on my own, saved in Dropbox, it didn't recognize the CRS.
The Shapefile is definied as Sirgas_2000 for Chile's Regions, so i've tried with EPSG:4989 first and EPSG:15894 later, but non of both worked and it replied this error message:
Failed to process query: Failed to create dataset Dataset could not find CRS 'EPSG:15894'.
What i'm not doing or i'm doing wrong? I'm just introducing to GeoAnalytics and Qlik Sense, so may i'm losing sight of something.
Regards,
Mireya
Hi Mireya,
According to IBGE Sirgas 2000 and WGS84 are the same:
https://ww2.ibge.gov.br/english/geociencias/geodesia/pmrg/faq.shtm#15
Set CRS to EPSG:4326
Thanks,
Patric
Hi Patric,
I followed the steps and I am getting the geometry as well. But for Indian states & District , it is not getting mapped on the match. I tried using CRS: Auto, EPSG:4269 , EPSG:4326 but still not able to get area for district.
Can you please help me.
Thanks,
Tanvi Madan
CRS depends on your source data, there are many coordinate systems in the world.
If your source data has a prj file that can give you clues.
Thanks,
Patric
can a qlik variable be part of the URL used when loading a shapefile?