{"id":22148471,"url":"https://github.com/mierune/csmap-py","last_synced_at":"2025-07-26T02:32:35.170Z","repository":{"id":211661674,"uuid":"726672576","full_name":"MIERUNE/csmap-py","owner":"MIERUNE","description":"CSMap generator with few dependencies","archived":false,"fork":false,"pushed_at":"2024-11-14T08:02:59.000Z","size":29206,"stargazers_count":5,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-14T09:18:21.126Z","etag":null,"topics":["csmap","numpy","python","raster","rasterio","terrain"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/csmap-py/","language":"Python","has_issues":true,"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/MIERUNE.png","metadata":{"files":{"readme":"README.md","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":"2023-12-03T03:04:35.000Z","updated_at":"2024-11-14T08:17:30.000Z","dependencies_parsed_at":"2024-06-05T14:37:35.688Z","dependency_job_id":null,"html_url":"https://github.com/MIERUNE/csmap-py","commit_stats":null,"previous_names":["mierune/csmap-py"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIERUNE%2Fcsmap-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIERUNE%2Fcsmap-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIERUNE%2Fcsmap-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIERUNE%2Fcsmap-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MIERUNE","download_url":"https://codeload.github.com/MIERUNE/csmap-py/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227644914,"owners_count":17798261,"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":["csmap","numpy","python","raster","rasterio","terrain"],"created_at":"2024-12-01T23:27:58.002Z","updated_at":"2025-07-26T02:32:35.161Z","avatar_url":"https://github.com/MIERUNE.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csmap-py\n\n![GitHub Release](https://img.shields.io/github/v/release/MIERUNE/csmap-py?label=PyPI:csmap-py)\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/MIERUNE/csmap-py/test.yml?label=test)\n\n![](./doc/csmap.png)\n\nmodule to process CSMap, based on \u003chttps://www.rinya.maff.go.jp/j/seibi/sagyoudo/attach/pdf/romou-12.pdf\u003e\n\n```planetext\nusage: csmap [-h] [--chunk_size CHUNK_SIZE] [--max_workers MAX_WORKERS] [--gf_size GF_SIZE]\n                   [--gf_sigma GF_SIGMA] [--curvature_size CURVATURE_SIZE]\n                   [--height_scale HEIGHT_SCALE HEIGHT_SCALE]\n                   [--slope_scale SLOPE_SCALE SLOPE_SCALE]\n                   [--curvature_scale CURVATURE_SCALE CURVATURE_SCALE]\n                   input_dem_path output_path\n\npositional arguments:\n  input_dem_path        input DEM path\n  output_path           output path\n\noptions:\n  -h, --help            show this help message and exit\n  --chunk_size CHUNK_SIZE\n                        chunk size as pixel, default to 1024\n  --max_workers MAX_WORKERS\n                        max workers for multiprocessing, default to 1\n  --gf_size GF_SIZE     gaussian filter size, default to 12\n  --gf_sigma GF_SIGMA   gaussian filter sigma, default to 3\n  --curvature_size CURVATURE_SIZE\n                        curvature filter size, default to 1\n  --height_scale HEIGHT_SCALE HEIGHT_SCALE\n                        height scale, min max, default to 0.0 1000.0\n  --slope_scale SLOPE_SCALE SLOPE_SCALE\n                        slope scale, min max, default to 0.0 1.5\n  --curvature_scale CURVATURE_SCALE CURVATURE_SCALE\n                        curvature scale, min max, default to -0.1 0.1\n```\n\n## usage\n\n### Command Line Interface\n\n```sh\npip install csmap-py\n```\n\n```sh\ncsmap dem.tif csmap.tif\ncsmap dem.vrt csmap.tif # you can use virtual raster or other gdal supported format\ncsmap dem.tif csmap.tif --chunk_size 256 --max_workers 4 # you can use multiprocessing\ncsmap dem.tif csmap.tif --gf_size 3 --gf_sigma 1.0 --curvature_size 1 # you can change filter size\ncsmap dem.tif csmap.tif --height_scale 0 500 --slope_scale 0 1 --curvature_scale -0.2 0.2 # you can change scale\n```\n\n### Python API\n\n```python\nfrom csmap.process import process, CsmapParams\n\nparams = CsmapParams() # use default params\n\n# convert dem to csmap\nprocess(\n    input_dem_path,\n    output_path,\n    chunk_size=1024,\n    params\n)\n```\n\n## processing image\n\n![](./doc/process.jpeg)\n\n## Authors\n\n- Kanahiro Iguchi ([@Kanahiro](https://github.com/Kanahiro))\n\n### Acknowledgements\n\nTaku Fukada ([@ciscorn](https://github.com/ciscorn)) contributed the initial implementation by porting [SAGA](https://github.com/saga-gis/saga-gis)'s calculations to Python, leveraging numpy for vectorization.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmierune%2Fcsmap-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmierune%2Fcsmap-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmierune%2Fcsmap-py/lists"}