{"id":22713536,"url":"https://github.com/program--/tg-r","last_synced_at":"2025-10-16T04:19:20.209Z","repository":{"id":237820409,"uuid":"701889384","full_name":"program--/tg-r","owner":"program--","description":"R interface to the C geometry library `tg`","archived":false,"fork":false,"pushed_at":"2024-05-07T18:47:30.000Z","size":112,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T22:43:53.365Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/program--.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-10-07T21:35:10.000Z","updated_at":"2024-05-07T18:47:34.000Z","dependencies_parsed_at":"2024-05-07T19:43:42.721Z","dependency_job_id":"f7320b04-7120-473a-bc23-4aa33a1455b5","html_url":"https://github.com/program--/tg-r","commit_stats":null,"previous_names":["program--/tg-r"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/program--/tg-r","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2Ftg-r","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2Ftg-r/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2Ftg-r/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2Ftg-r/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/program--","download_url":"https://codeload.github.com/program--/tg-r/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2Ftg-r/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269645151,"owners_count":24452683,"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","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-10T14:09:30.284Z","updated_at":"2025-10-16T04:19:15.173Z","avatar_url":"https://github.com/program--.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# tg\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\nThis package provides an interface to the [tg C library](https://github.com/tidwall/tg) similar\nto [sf](https://github.com/r-spatial/sf) and [geos](https://github.com/paleolimbot/geos).\n\n## Installation\n\nYou can install the development version of tg like so:\n\n``` r\npak::pkg_install(\"program--/tg\")\n```\n\n## Example Usage\n\nReading geometry from WKT:\n\n```{r wkt_example}\ntg::as_tg(\"POINT(1 1)\")\n```\n\nReading geometry from a GeoJSON string:\n```{r geojson_example}\ngjson \u003c- '\n{ \"type\": \"FeatureCollection\",\n  \"features\": [\n    { \"type\": \"Feature\",\n      \"geometry\": {\"type\": \"Point\", \"coordinates\": [102.0, 0.5]},\n      \"properties\": {\"prop0\": \"value0\"}\n      },\n    { \"type\": \"Feature\",\n      \"geometry\": {\n        \"type\": \"LineString\",\n        \"coordinates\": [\n          [102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]\n          ]\n        },\n      \"properties\": {\n        \"prop0\": \"value0\",\n        \"prop1\": 0.0\n        }\n      },\n    { \"type\": \"Feature\",\n       \"geometry\": {\n         \"type\": \"Polygon\",\n         \"coordinates\": [\n           [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0],\n             [100.0, 1.0], [100.0, 0.0] ]\n           ]\n\n       },\n       \"properties\": {\n         \"prop0\": \"value0\",\n         \"prop1\": {\"this\": \"that\"}\n         }\n       }\n    ]\n  }\n'\n\ntg_geometry \u003c- tg::as_tg(gjson)\ntg_geometry\n\n# Converting to a TG Collection\ncollection \u003c- tg::as_tgc(tg_geometry)\ncollection\n\n# Creating a data.frame\ndata.frame(x = 1:3, geometry = collection)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogram--%2Ftg-r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogram--%2Ftg-r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogram--%2Ftg-r/lists"}