

- Move Document
- Delete Document and Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Loading Esri shapefiles in Qlik GeoAnalytics
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.


- Move Comment
- Delete Comment
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Ok, are you running java 32 bit? If so please upgrade to 64 bit, check with java -version on command line.
Java 32-bit have trouble addressing more than 1-4 GB memory.
Thanks
Patric


- Move Comment
- Delete Comment
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
That's it Patric! I've installed the java x64 (didn't have it) and the error disappeared. Now it works without the custom value for "geoAnalyticMemory".
Thanks

- Move Comment
- Delete Comment
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content

- Move Comment
- Delete Comment
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
great!

- Move Comment
- Delete Comment
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi
I am using local file system and installed QGA Plus. Using the following script and getting error, not sure whether it is correct. Please help.
DATASOURCE CongressionalDistricts GEOFILE 'file:///C:/ICT/Samples/0626/2011_Ind.zip', keyField='ST_NM', type='auto', expectedGeomType='auto', encoding='', crs='EPSG:4269'
SELECT [ST_NM] FROM SampleStates;
ERROR text is as follows.
<<
QVX_SYNTAX_ERROR: Failed to process query: Could not parse line 2:42 extraneous input ''file:///C:/ICT/Samples/0626/2011_Ind.zip'' expecting {<EOF>, DATASOURCE, SELECT}
>>
Thanks in Advance..


- Move Comment
- Delete Comment
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi, that doesn't look like code produced by the connector.
Follow the guide above and have at look at the provided example.
Thanks,
Patric


- Move Comment
- Delete Comment
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Patric, here's to hoping you could help me as well. I have gone through the process to load an ESRI shape file within a ZIP and I keep getting this error message.
The ZIP files comes from the Australian Bureau of Statistics https://datapacks.censusdata.abs.gov.au/datapacks/
The error when loading:
Failed to process query: Failed to create dataset Dataset:com.idevio.geoanalytics.h.a: Invalid shape typre 'NULL'. All included shapes must have the same type as the one specified on the file header (POLYGON)
I have used ArcGIS Pro to import the ESRI files and exported KML to use in QlilSense before but that didn't really work the way I wanted so hence my attempt at directly importing the ESRI ZIP into Qlik using the Geoanalytics Plus Connector.
I suspect the header label is LGA (Local Government Area) which is the polygon type I am wanting to use but I am not sure how to change that is the shape file if changing that to POLYGON is actually what I need to do to fix this problem.
Appreciate any assistance.


- Move Comment
- Delete Comment
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Darren,
I suspect that the shapefile has some areas of zero size, seen that before with data from ABS.
Try open the shapefile in QGIS and remove the zero size polygons.
Handling of dirty data will be better in coming versions of QGA.
Thanks,
Patric


- Move Comment
- Delete Comment
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Patric,
That is exactly what the problem was. I have since had assistance from Dalton Ruer with converting shapefiles into QVD from the Australian Bureau of Statistics and it works really well. Didn't solve the issue of Qlik processing ESRI Shape files but it a very useful work around.
Thanks


- Move Comment
- Delete Comment
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi there,
I now have SA4, SA3, SA2, and SA1 as QVDs which I have used to build a data model allowing drilldown from Australia to State to SA4 etc. I only needed to load the digital boundaries files once so that I can link the population data files from ABS. They are large files and if you could suggest a way I can send them to you I will. My email address is Darren.Clinch@dhhs.vic.gov.au
Regards,