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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:29:21+00:00 2026-05-30T06:29:21+00:00

I have multiple sets of points (for different years ~20) I want to generate

  • 0

I have multiple sets of points (for different years ~20)

I want to generate thiessen polygons for each set of points using r spatial packages.

I know this can be done using GIS but as i want a batch process something in R would be

helpful.

  • 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-05-30T06:29:22+00:00Added an answer on May 30, 2026 at 6:29 am

    You haven’t given us access to your data, but here’s an example for points representing cities of the world, using an approach described by Carson Farmer on his blog. Hopefully it’ll get you started…

    # Carson's Voronoi polygons function
    voronoipolygons <- function(x) {
      require(deldir)
      require(sp)
      if (.hasSlot(x, 'coords')) {
        crds <- x@coords  
      } else crds <- x
      z <- deldir(crds[,1], crds[,2])
      w <- tile.list(z)
      polys <- vector(mode='list', length=length(w))
      for (i in seq(along=polys)) {
        pcrds <- cbind(w[[i]]$x, w[[i]]$y)
        pcrds <- rbind(pcrds, pcrds[1,])
        polys[[i]] <- Polygons(list(Polygon(pcrds)), ID=as.character(i))
      }
      SP <- SpatialPolygons(polys)
      voronoi <- SpatialPolygonsDataFrame(SP, data=data.frame(x=crds[,1],
        y=crds[,2], row.names=sapply(slot(SP, 'polygons'), 
        function(x) slot(x, 'ID'))))
    }
    

    Example 1: Input is a SpatialPointsDataFrame:

    # Read in a point shapefile to be converted to a Voronoi diagram
    library(rgdal)
    dsn <- system.file("vectors", package = "rgdal")[1]
    cities <- readOGR(dsn=dsn, layer="cities")
    
    v <- voronoipolygons(cities)
    
    plot(v)
    

    Voronoi diagram of cities

    Example 2: Input is vectors of x, y coordinates:

    dat <- data.frame(x=runif(100), y=runif(100))
    v2 <- voronoipolygons(dat)
    plot(v2)
    

    Another voronoi diagram

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string with multiple sets of brackets, and each set of brackets
I'd like to have multiple XmlHttpRequests use different sets of cookies, to keep multiple
I have multiple forms for lots of products on my page and want to
I have multiple domains on my server. I want to redirect all of them
I have multiple arrays with string values and I want to compare them and
I want to create a single shape file from multiple mxd's that have multiple
I have multiple sets of code I need to run in Access 2007 and
In my program, I have a set of points. For purposes of rescaling, I
I have sets of these files- objectA-record-data.log file - Contains multiple lines of data
I have many large KML data-sets, which are served using a hierarchy of region-based

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.