{"id":16216816,"url":"https://github.com/adamcharnock/python-srtm","last_synced_at":"2025-03-19T10:30:39.639Z","repository":{"id":38269807,"uuid":"255155863","full_name":"adamcharnock/python-srtm","owner":"adamcharnock","description":"Python API for reading NASA's SRTM `.hgt` or `.hgt.zip` altitude files.","archived":false,"fork":false,"pushed_at":"2024-11-06T13:43:51.000Z","size":148,"stargazers_count":27,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T17:56:14.638Z","etag":null,"topics":["altitude","elevation-profile","geospatial","nasa","srtm","srtm-data","srtm1","srtm3"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/python-srtm/","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/adamcharnock.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":"2020-04-12T19:33:37.000Z","updated_at":"2025-02-25T14:41:36.000Z","dependencies_parsed_at":"2024-10-27T20:30:45.308Z","dependency_job_id":"d22f4ff7-6240-44bc-ae27-d85ec5c59a49","html_url":"https://github.com/adamcharnock/python-srtm","commit_stats":{"total_commits":36,"total_committers":1,"mean_commits":36.0,"dds":0.0,"last_synced_commit":"72ac75e15928b8785c043513711c1122a0580e86"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamcharnock%2Fpython-srtm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamcharnock%2Fpython-srtm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamcharnock%2Fpython-srtm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamcharnock%2Fpython-srtm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamcharnock","download_url":"https://codeload.github.com/adamcharnock/python-srtm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243982182,"owners_count":20378605,"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":["altitude","elevation-profile","geospatial","nasa","srtm","srtm-data","srtm1","srtm3"],"created_at":"2024-10-10T11:22:39.501Z","updated_at":"2025-03-19T10:30:39.633Z","avatar_url":"https://github.com/adamcharnock.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NASA SRTM altitude data parsing in Python\n\nProvides an API onto SRTM `.hgt` or `.hgt.zip` files.\n\nRequires Python 3.8, **may** work with Python 3.6 \u0026 3.7.\n\n## Installation\n\n```\npip install python-srtm\n\nexport SRTM1_DIR=/path/to/srtm1/\nexport SRTM3_DIR=/path/to/srtm3/\n```\n\n## Use\n\nYou can access either SRTM1 or SRTM3 data. SRTM 1, for example:\n\n```python\n# SRTM1 - 30m resolution\n\u003e\u003e\u003e from srtm import Srtm1HeightMapCollection\n\u003e\u003e\u003e srtm1_data = Srtm1HeightMapCollection()\n\u003e\u003e\u003e srtm1_data.get_altitude(latitude=40.123, longitude=-7.456)\n615\n\u003e\u003e\u003e Srtm1HeightMapCollection().get_elevation_profile(40.123, -7.456, 40.129, -7.460)\n[615, 620, 618, 620, 616, 603, 593, 582, 575, 579, 580, 589, 589, 581, 565, 553, 545, 541, 534, 533, 529, 520, 514]\n```\n\nOr SRTM3:\n\n```python\n# SRTM3 - 90m resolution\n\u003e\u003e\u003e from srtm import Srtm3HeightMapCollection\n\u003e\u003e\u003e srtm3_data = Srtm3HeightMapCollection()\n\u003e\u003e\u003e srtm3_data.get_altitude(latitude=40.123, longitude=-7.456)\n608\n\u003e\u003e\u003e Srtm3HeightMapCollection().get_elevation_profile(40.123, -7.456, 40.129, -7.460)\n[626, 616, 585, 593, 577, 548, 528, 514]\n```\n\n## Profiling\n\n```python\nimport cProfile\ncProfile.run('function_to_profile()', filename='output.cprof')\n```\n\n```bash\nbrew install qcachegrind\npip install pyprof2calltree\npyprof2calltree -k -i /pythonprofiling/profiler/first_iteration.cprof\n```\n\n## Release process\n\nFor internal reference:\n\n```\n# Run the tests\npytest\n\nexport VERSION=\"VERSION HERE\"\n\n# Version bump\npoetry version $VERSION\n\n# Ensure poetry.lock is up to date\npoetry lock\n\n# Commit\ngit add .\ngit commit -m \"Releasing version $VERSION\"\n\n# Tagging and branching\ngit tag \"v$VERSION\"\ngit branch \"v$VERSION\"\ngit push origin \\\n    refs/tags/\"v$VERSION\" \\\n    refs/heads/\"v$VERSION\" \\\n    master\n\npoetry publish --build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamcharnock%2Fpython-srtm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamcharnock%2Fpython-srtm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamcharnock%2Fpython-srtm/lists"}