Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

How to combine sfc objects from R package sf

Just use c like its a vector:

> (sfc12 = c(sfc1, sfc2))
Geometry set for 2 features 
geometry type:  POINT
dimension:      XY
bbox:           xmin: 0 ymin: 1 xmax: 1 ymax: 1
epsg (SRID):    NA
proj4string:    NA
POINT(0 1)
POINT(1 1)

And the length is 2:

> length(sfc12)
[1] 2

Drawing from @TimSalabim's answer, if your sfc objects are in the same CRS you can use

do.call(rbind, list(sfc1, sfc2)).

Tags:

R

Sf

Related

Rule-based labeling in QGIS Bring a single point forward for display Converting raster to vector by generating center lines? Return end-vertices of an sf linestring Creating 3D points in PyQGIS? Synchronizing views in QGIS print composer? Deleting field/column of shapefile with OGR/GDAL Python? Versioned to unversioned: How to undo edits in an edit session on an unregistered table Using pyshp to read a file-like object from a zipped archive Learning resources for PyQGIS? What is this GIS Principle Called? In QGIS is it possible to apply an expression to a join

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy