Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry

Loading Esri shapefiles in Qlik GeoAnalytics

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Patric_Nordstrom
Employee
Employee

Loading Esri shapefiles in Qlik GeoAnalytics

Last Update:

Apr 2, 2021 4:17:27 AM

Updated By:

Patric_Nordstrom

Created date:

Jun 2, 2017 4:18:20 AM

Attachments

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 locationUseTip
On public urlUse Qlik Sense Server/Desktop, Qlik GeoAnalytics connectorCheck the link provides direct access of the file
On laptop harddriveUse Qlik Sense Desktop, Qlik GeoAnalytics connector with Qlik GeoAnalytics PlusDrop the folder in the browser to get the correct syntax: file:/// etc.
On Sense serverUse Qlik Sense Server, Qlik GeoAnalytics connector with Qlik GeoAnalytics PlusMake sure the file is accessible for the Sense system user.
On map serverUse Qlik GeoAnalytics Server and Qlik GeoAnalytics connectorVerify 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).

  1. 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).

  2. Choose "Auto" for resolution.

  3. 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)

  4. A key field is handy but not mandatory, fill in GEOID in this example.

  5. Fill in the CRS: EPSG:4269  (This shapefile is in coordinate system NAD 83, use internet search to find the EPSG code).

  6. 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.

  7. 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.

Labels (3)
Comments
amy_weber
Partner - Contributor II
Partner - Contributor II

I have been unsucessful loading an ERSI shape file.  I have tried both adding from desktop and server.  I tried copying the example file above to my dropbox and also google drive and I either get an error that there isn't a .shp file in the zip folder or that there are two .dbf files.  I have Plus installed on my desktop but have an error connecting to the port; "Could not reach local server No connection could be made because the target machine actively refused it 127.0.0.1:42024".  I have attempted to correct that issue but was unable to so attempting through dropbox/google drive route.  Any suggestions for things to try would be would be appreciated.

0 Likes
Patric_Nordstrom
Employee
Employee

Hi Amy,

Sounds like there is firewall issue preventing the access. Plus is a minified version of the server so port 42024 needs to be allowed.

The zipfile should only contain one "shapefile".

An ESRI shapefile is actually several files but at least there should be one .shp file and one .dbf file)

Cloud files can be tricky, there has to be direct file access, it can't be a download page.

For instance, use "dl" instead "www" in the url, to get direct access of Dropbox files.

Thanks,

Patric

amy_weber
Partner - Contributor II
Partner - Contributor II

Thanks for your quick response.  I tried the dropbox link as described with "dl" instead "www" in the url, to get direct access of Dropbox files with my file and it wasn't sucessful. Then I tried to use the example zip file, a shape file that is known to work included with this post and that wasn't sucessful either.   I tried a few other things like google drive but still haven't been sucessful. 

0 Likes
Anonymous
Not applicable

Please find a document with screenshots for loading ESRI shape file from dropbox in a below link:

https://www.dropbox.com/s/jfvfv6pfy0bi5nl/Loading%20from%20dropbox.docx?dl=0

0 Likes
amy_weber
Partner - Contributor II
Partner - Contributor II

Thank you Patric & Jahanzaib for the additional points and detailed instructions with the screenshots.


Regarding the Plus connection, I have a Mac utlizing Parallels to work in a Windows environment.  I am sure that I need to make an adjustment to get the right connection allowed but I haven't been able to work through that.  I haven't had an issue with any other connections, even currently connecting to 'R' although I suspect that configuration may be causing the conflict. I set that aside in hopes that loading from dropbox would be the easier solution.


Regarding the dropbox load, I had been using the 'dl' replacement for 'www' for the dropbox link. I'm guessing in my frustration I forgot in one of my tests and received the no shp file error.   The double .dbf file error I had gotten was due grabbing the files twice in error when I created the zip file.  


I am still unsucessful, this time I have captured each test.  1) loading the shape file that was included in the original post  2) file downloaded from open dataset  3) file from client (the one I oringally started with).

Test 1 & 3 recieving an error Could not parse dataset WKT CRS.  Test 2 received an error that the dataset was too large and not covered with my license.  It is a large dataset I just grabbed one quick without looking at the size.

My screen shots are attached in the word doc link below. 

Dropbox - Shapefile test.docx

Thanks so much for your help I appreciate it.

Regards,

Amy

0 Likes
Anonymous
Not applicable

Use CRS "EPSG:4269" instead of "Auto". It's working fine on "tl_2016_us_cd115.zip" uploaded on dropbox with "dl" instead of "www" in the URL.

Kindly see the document with screenshot :

https://www.dropbox.com/s/njv3zaijzfdkz11/CRS.docx?dl=0

0 Likes
amy_weber
Partner - Contributor II
Partner - Contributor II

Thank you, I was sucessful in loading the shape file with the change in the CRS parameter.

Regards,

Amy

Anonymous
Not applicable

Hi Patric,

I followed the guide and was able to load a shapefile, but how do I load/import the LYR layer file in the same zipfile? Or does the LYR file needs to be converted to shapefile first?

Or can I import an ascii file instead of shapefile?

Thank you!

Stacy

0 Likes
Patric_Nordstrom
Employee
Employee

Hi Stacy,

An .lyr file is in a proprietary Esri format that holds symbology, colors etc, can't be open with QGA. QGA reads the data in shapefiles, not appearance. 

Thanks,

Patric

0 Likes
Anonymous
Not applicable

Thank you Patric.

I tried importing the ascii format data from USGS link here<http://gmo.gfz-potsdam.de/pub/download_data/download_data_frame.html> as text file, but kept getting errors saying there are wrong number of columns for row 2, row 26 etc. I tried adding a header row, replacing “NaN“ with a small number, and saving the file as Unix to replace the CR LF with LF, but kept getting the same error with different row numbers each time. Any suggestions on how to trouble shoot?

0 Likes
Version history
Last update:
‎2021-04-02 04:17 AM
Updated by: