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

  • Home
  • SEARCH
  • 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 8785683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:25:44+00:00 2026-06-13T21:25:44+00:00

I have a shape file with two different region with 12 sub region each.I

  • 0

I have a shape file with two different region with 12 sub region each.I want separate shape file of these 24 sub region from that shape file.I have also tried by using package maptools and rgeos but could not figure it.Any logarithm would be very much appreciated. Thanks.

sharif

  • 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-13T21:25:45+00:00Added an answer on June 13, 2026 at 9:25 pm

    You can split your data in a loop based on the unique value in the column of interest and write out the subset data. I am using rgdal in leu of maptools but you could easily change the code to use maptools functions for reading/writing shapefiles.

    require(sp)
    require(rgdal)
    
    # READ SHAPEFILE
    dat <- readOGR("C:/DATA", "dat")
    
    # CREATE VECTOR OF UNIQUE SUBREGION VALUES
    y <- unique(dat@data$SUBREGIONS)
    
    # CREATE SHAPEFILE FOR EACH SUBREGION AND WRITE OUT 
      for (i in 1:length(y) ) {
        temp <- dat[dat$SUBREGIONS == y[i], ]   
      writeOGR(temp, dsn=getwd(), y[i], driver="ESRI Shapefile", 
               overwrite_layer=TRUE)
       }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a shape file, and I want to show it on the web
I have two different classes that share a common interface. Although the functionality is
I have two TextRanges from two different RichTextBoxes, and four strings from regular textboxes.
I have two alarms that fire two separate services--one is executed every half-hour, and
A quick question about a gnuplot. I have two graphs, ploted from file, like
I have a .xaml file and a .cs file that share value with Binding.
I have an activity that when users press share on a file it would
I have two questions about java.awt.Shape . Suppose I have two Shape s, shape1
Ok so I have a small project with two different scaffoldings I've made.In the
I have a Ruby program that loads up two very large yaml files, so

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.