{"id":18722534,"url":"https://github.com/mdsumner/sfdct","last_synced_at":"2026-01-26T19:20:31.375Z","repository":{"id":72211852,"uuid":"103523704","full_name":"mdsumner/sfdct","owner":"mdsumner","description":"Constrained Delaunay triangulation for simple features","archived":false,"fork":false,"pushed_at":"2021-01-11T23:32:36.000Z","size":11616,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-28T12:16:24.784Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://r-gris.github.io/sfdct/","language":"HTML","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdsumner.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-14T11:21:52.000Z","updated_at":"2021-01-11T23:32:39.000Z","dependencies_parsed_at":"2023-03-11T12:00:06.858Z","dependency_job_id":null,"html_url":"https://github.com/mdsumner/sfdct","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fsfdct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fsfdct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fsfdct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fsfdct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdsumner","download_url":"https://codeload.github.com/mdsumner/sfdct/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239587244,"owners_count":19663892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T13:41:53.038Z","updated_at":"2025-11-11T05:30:15.961Z","avatar_url":"https://github.com/mdsumner.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n \n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n\u003c!-- badges: start --\u003e\n[![R build status](https://github.com/hypertidy/sfdct/workflows/R-CMD-check/badge.svg)](https://github.com/hypertidy/sfdct/actions)\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/sfdct)](https://cran.r-project.org/package=sfdct)\n[![R build status](https://github.com/hypertidy/sfdct/workflows/pkgdown/badge.svg)](https://github.com/hypertidy/sfdct/actions)\n[![R build status](https://github.com/hypertidy/sfdct/workflows/test-coverage/badge.svg)](https://github.com/hypertidy/sfdct/actions)\n\u003c!-- badges: end --\u003e\n  \n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n\n# sfdct\n\nThe goal of sfdct is to provide constrained triangulation of simple features. \n\n## Limitations\n\nTriangulation is performed with respect to the vertices and edges *per-feature*. This means that each output feature will\nbe composed of triangles that align to all input edges. This will also correspond to the outer hull of any lines or polygons. In a GEOMETRYCOLLECTION the same alignment only applies to geometries individually within the collection, so lines and polygons and point sets are\nall triangulated as if they were independent. \n\nA future release will triangulate the GEOMETRYCOLLECTION as it it were one set of edges and vertices. This will also allow an entire data set\nto be triangulated as one. \n\nIt's not yet clear to me how to best maintain the original feature identity for the \"entire data set\" case, or if this even matters. Please get in touch if you are interested!\n\nMore general structures for working with grouped simplicial complex data structures are in the works, but aligning with simple features in this package provides a useful illustration of these nuances and how far we can push the standard tools. \n\n\n## Example\n\nThis is a basic example which shows you how to decompose a MULTIPOLYGON `sf` data frame object into a GEOMETRYCOLLECTION `sf` data frame object made of triangles:\n\n```{r example}\nlibrary(sf)\nlibrary(sfdct)\nnc \u003c- read_sf(system.file(\"shape/nc.shp\", package=\"sf\"), quiet = TRUE)\n(nc_triangles \u003c- ct_triangulate(nc[1:5, c(\"NAME\")]))\n\n(asub \u003c- st_geometry(nc_triangles)[[4]] )\n\n```\n\nDenser triangles, and optionally `D` for ensuring Delaunay criterion is met. \n\n```{r}\nst_geometry(ct_triangulate(nc[4, ], a = 0.0007, D = TRUE))\n\n```\n\n\nSee the vignettes for more examples. \n\n\nIf you are interested in development in this area see [anglr package](https://github.com/hypertidy/anglr) a workhorse for triangulating spatial data into meshes. A development project [laridae](https://github.com/hypertidy/laridae) aims to provide a more powerful facility\nfor finite element decomposition for complex shapes using CGAL.  There is an ear-clipping version, from the [decido package](https://CRAN.r-project.org/package=decido) in [silicate](https://github.com/hypertidy/silicate)\n\n--- \n\nPlease note that this project is released with a [Contributor Code of Conduct](https://github.com/hypertidy/sfdct/blob/master/CONDUCT.md). By participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdsumner%2Fsfdct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdsumner%2Fsfdct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdsumner%2Fsfdct/lists"}