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 8842591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:59:50+00:00 2026-06-14T10:59:50+00:00

I have some very large shapefiles. I can read them into SpatialPolygonsDataFrame ‘s using

  • 0

I have some very large shapefiles. I can read them into SpatialPolygonsDataFrame‘s using the rgdal function readOGR, but it takes a very long time for each file. I am actually only interested in the data.frame that shows up in the @data slot. Is there any way to read just the data, skipping the resource intensive polygons?

Example code:

## State of Alabama census blocks (152 MB compressed, 266 MB uncompressed)
shpurl <- "http://www2.census.gov/geo/tiger/TIGER2011/TABBLOCK/tl_2011_01_tabblock.zip"
tmp    <- tempfile(fileext=".zip")
download.file(shpurl, destfile=tmp)
unzip(tmp, exdir=getwd())

## Read shapefile
nm  <- strsplit(basename(shpurl), "\\.")[[1]][1]
lyr <- readOGR(dsn=getwd(), layer=nm)

## Data I want
head(lyr@data)
  • 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-14T10:59:52+00:00Added an answer on June 14, 2026 at 10:59 am

    Shapefiles are compound files that store their attribute data in a file with extension *.dbf. (See the Wikipedia shapefile article for a reference.) The dbf suffix refers to the dBase file format, which can be read by the function read.dbf() in the foreign package.

    So, try this:

    library(foreign)
    df <- read.dbf("tl_2011_01_tabblock.dbf")
    ## And, more generally, read.dbf("path/to/shapefile/shapefile-name.dbf")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I'm using the MATLAB IDE and happen to have some very large objects
I've got some very large XML files which I read using a System.Xml.Serialization.XmlSerializer .
I have some very large (>4 GB) files containing (millions of) fixed-length binary records.
I have some very large mp3's stored at a remote location and I presently
I need to pre-compress some very large html/xml/json files (large data dumps) using either
I have some DropDownList controls where the list is very large, so I would
We work with some very large databases (300Gb - 1Tb). Tables can contain from
I have the following PowerShell script that will parse some very large file for
I am using a third party library that iterates over some very large flat
I have some very large processing being done in a php application. I'd like

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.