Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8415859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:34:09+00:00 2026-06-10T01:34:09+00:00

I’m trying to load a zip level shapefile to do some plotting, per: https://github.com/hadley/ggplot2/wiki/plotting-polygon-shapefiles

  • 0

I’m trying to load a zip level shapefile to do some plotting, per:
https://github.com/hadley/ggplot2/wiki/plotting-polygon-shapefiles
http://www.nceas.ucsb.edu/scicomp/usecases/ReadWriteESRIShapeFiles
etc

My code:

library(rgdal)
library(RColorBrewer)
library(ggplot2)
zipmap = readOGR(dsn="file.zip/", layer="myZIPmap")

I’m getting this error:

Error in ogrInfo(dsn = dsn, layer = layer, input_field_name_encoding = input_field_name_encoding) : 
  Cannot open file

I checked the drivers but to be honest am not able to interpret the output:

ogrDrivers()
             name write
1      AeronavFAA FALSE
2          ARCGEN FALSE
3          AVCBin FALSE
4          AVCE00 FALSE
5             BNA  TRUE
6             CSV  TRUE
7             DGN  TRUE
8             DXF  TRUE
9          EDIGEO FALSE
10 ESRI Shapefile  TRUE
11     Geoconcept  TRUE
12        GeoJSON  TRUE
13       Geomedia FALSE
14         GeoRSS  TRUE
15            GML  TRUE
16            GMT  TRUE
17       GPSBabel  TRUE
18  GPSTrackMaker  TRUE
19            GPX  TRUE
20            HTF FALSE
21         Idrisi FALSE
22            KML  TRUE
23   MapInfo File  TRUE
24         Memory  TRUE
25   MSSQLSpatial  TRUE
26           ODBC  TRUE
27        OpenAir FALSE
28         PCIDSK  TRUE
29            PDS FALSE
30         PGDump  TRUE
31           PGeo FALSE
32            REC FALSE
33            S57  TRUE
34           SDTS FALSE
35       SEGUKOOA FALSE
36           SEGY FALSE
37            SUA FALSE
38            SVG FALSE
39          TIGER  TRUE
40        UK .NTF FALSE
41            VFK FALSE
42            VRT FALSE
43         XPlane FALSE

file.info gives:

 file.info(path="K:/2012 - IPD - Policy Maps/fe_2007_us_zcta500.zip/")
                                                             size isdir mode               mtime               ctime
    K:/2012 - IPD - Policy Maps/fe_2007_us_zcta500.zip/ 661131516 FALSE  666 2012-08-22 14:54:53 2012-08-22 14:50:43
                                                                      atime exe
    K:/2012 - IPD - Policy Maps/fe_2007_us_zcta500.zip/ 2012-08-22 14:58:38  no

Given the internet searches I’ve tried, it looks like I’m not the only one having this issue but I’ve been unable to find an answer. I’m not sure if the problem is related to the shapefile being inside a .zip folder or not. As it’s a work computer, I have to wait for IT to install WinZip so that I can extract the shapefile and try outside a .zip folder. Hopefully that will be tomorrow.

Also, the package help states “Note that stray files in data source directories (such as *.dbf) may lead to suprious errors that accompanying *.shp are missing.” The .zip folder has the following: a.dbf, b.prj, c.shp, d.shp.xml, e.shx.

Any help you can provide would be wonderful!
-Alex

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T01:34:11+00:00Added an answer on June 10, 2026 at 1:34 am

    You should be able to unzip the files without the need of an external program with unzip. To read a shapefile with readOGR, the dsn is the directory name of where your ‘unzipped’ files are located, and layer is the name of your shape file without the extension. In the example below, replace myZIPmap with the appropriate shapefile name.

    library(utils)
    library(rgdal)
    
    unzip("K:/2012 - IPD - Policy Maps/fe_2007_us_zcta500.zip")
    zipmap <- readOGR(dsn = "K:/2012 - IPD - Policy Maps/fe_2007_us_zcta500", layer = "myZIPmap" )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.