{"id":19772499,"url":"https://github.com/mit-spatial-action/unknown_pleasur","last_synced_at":"2025-02-28T05:14:58.507Z","repository":{"id":173436117,"uuid":"614429399","full_name":"mit-spatial-action/unknown_pleasuR","owner":"mit-spatial-action","description":"Generates regular section cuts through a raster surface for a given extent.","archived":false,"fork":false,"pushed_at":"2023-07-10T14:08:16.000Z","size":2216,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-11T01:11:09.260Z","etag":null,"topics":["joy-division","mapping","raster","spatial-analysis","visualization"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mit-spatial-action.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2023-03-15T15:09:04.000Z","updated_at":"2024-06-12T22:56:02.000Z","dependencies_parsed_at":"2023-09-26T11:12:19.802Z","dependency_job_id":null,"html_url":"https://github.com/mit-spatial-action/unknown_pleasuR","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"23903c0f948a757c6a07576741a33966e187d04e"},"previous_names":["unnamed-lab-dusp/unknown_pleasur","mit-spatial-action/unknown_pleasur"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mit-spatial-action%2Funknown_pleasuR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mit-spatial-action%2Funknown_pleasuR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mit-spatial-action%2Funknown_pleasuR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mit-spatial-action%2Funknown_pleasuR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mit-spatial-action","download_url":"https://codeload.github.com/mit-spatial-action/unknown_pleasuR/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241104075,"owners_count":19910370,"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":["joy-division","mapping","raster","spatial-analysis","visualization"],"created_at":"2024-11-12T05:06:43.164Z","updated_at":"2025-02-28T05:14:58.489Z","avatar_url":"https://github.com/mit-spatial-action.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unknown PleasuR\n\n![Sample map generated by st_unknown_pleasures.](media/logo.png)\n\nGenerates regular section cuts through a raster surface for a given extent. Produces results that look quite a lot like the cover of Joy Division's _Unknown Pleasures_ (1979). Also quite a lot like some of the work of the Harvard Laboratory for Computer Graphics and Spaital Analysis (RIP). Also, scholarly integrity requires that I say: [James Cheshire got here first.](https://jcheshire.com/resources/joy-division-population-surfaces-and-pioneering-electronic-cartography/)\n\nGeneral workflow looks like the below. (For a more thoroughly fleshed out example using real data, see `example.R`.) Assuming an `sf` dataframe containing polygons or multipolygons (`polygons`) and a raster surface (`raster`), this generates regularly spaced lines (`st_regular_lines()`) and effecitvely \"drapes\" them over a raster surface, returning either polygonal or linestring section cuts (`st_unknown_pleasures()`).\n\nOrientation and number of cut lines is set through `get_dims()` which returns a set of parameters that are subsequently passed to `st_regular_lines()` and `st_unknown_pleasures()`.\n\n```r\ndims \u003c- get_dims(polygons, n = 100, type = \"vertical\") # or \"horizontal\"\n\nlines \u003c- polygons %\u003e%\n  st_union() %\u003e%\n  st_regular_lines(\n    dims = dims,\n    mask = TRUE\n  )\n\nunknown_pleasures \u003c- lines %\u003e%\n  st_unknown_pleasures(\n    raster,\n    dims = dims,\n    sample_size = 250, \n    bleed_factor = 3,\n    # Or \"planar\"\n    mode = \"xyz\",\n    # Strictly speaking, the \"xyz\" and polygon\n    # combination leaves you with closed LINESTRINGs\n    polygon = TRUE\n  ) %\u003e%\n  st_geometry() %\u003e%\n  # We devized the \"xyz\" mode for export to 3D Modeling software (e.g.,\n  # Rhino), so we export to dxf.\n  st_write( \n    \"test_polys.dxf\", \n    delete_dsn = TRUE, \n    driver = \"dxf\"\n    )\n```\n\n\u003cimg width=\"1651\" alt=\"dxf_screenshot\" src=\"https://user-images.githubusercontent.com/10646361/226750060-e9370477-d71b-43ba-9514-76f43abfaed0.png\"\u003e\n\n\n```r\n# Or, for more GIS-ready output...\nunknown_pleasures \u003c- lines %\u003e%\n  st_unknown_pleasures(\n    raster,\n    dims = dims,\n    sample_size = 250, \n    bleed_factor = 3,\n    mode = \"planar\",\n    polygon = TRUE\n  ) %\u003e%\n  st_write( \n    \"test_polys.geojson\", \n    delete_dsn = TRUE\n    )\n\n```\n\n![Sample map generated by st_unknown_pleasures.](media/logo.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmit-spatial-action%2Funknown_pleasur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmit-spatial-action%2Funknown_pleasur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmit-spatial-action%2Funknown_pleasur/lists"}