{"id":15009544,"url":"https://github.com/mitgobla/topograpy","last_synced_at":"2025-12-27T14:05:29.250Z","repository":{"id":123905406,"uuid":"91487265","full_name":"mitgobla/TopograPy","owner":"mitgobla","description":"A Topograph Coordinate Generator in Python","archived":false,"fork":false,"pushed_at":"2018-01-31T21:08:26.000Z","size":27957,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-19T07:42:27.347Z","etag":null,"topics":["coordinates","generator","heightmap","python","python-3","python-3-5","topography","windows","windows-10"],"latest_commit_sha":null,"homepage":"http://www.mitgobla.cf","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitgobla.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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-05-16T17:43:45.000Z","updated_at":"2018-08-20T11:20:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"890946b6-2f75-4cf2-8eb1-6ccaa0214da4","html_url":"https://github.com/mitgobla/TopograPy","commit_stats":{"total_commits":46,"total_committers":2,"mean_commits":23.0,"dds":0.04347826086956519,"last_synced_commit":"146765368991f2152271f3e7f8e0f5079bf8f72d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitgobla%2FTopograPy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitgobla%2FTopograPy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitgobla%2FTopograPy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitgobla%2FTopograPy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitgobla","download_url":"https://codeload.github.com/mitgobla/TopograPy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243234092,"owners_count":20258391,"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":["coordinates","generator","heightmap","python","python-3","python-3-5","topography","windows","windows-10"],"created_at":"2024-09-24T19:26:26.958Z","updated_at":"2025-12-27T14:05:29.233Z","avatar_url":"https://github.com/mitgobla.png","language":"Python","readme":"[![HitCount](http://hits.dwyl.io/mitgobla/TopograPy.svg)](http://hits.dwyl.io/mitgobla/TopograPy)\n# TopograPy\nA Height Map Coordinate Generator in Python.\nWindows Only.\nPlease note: this program is being completely re-programmed to add more coordinate generation options to suit generation of height maps in different forms. As of the current version, it only supports being generated onto a 2D canvas that can't be rotated; I am planning on changing this in the future.\n## Installing Requirements\nPillow is the only requirement for this module and it is used for reading images. To install, use: \n```\npip install pillow\n```\n## Setup\nToporaPy is not available on PyPI yet, but you can still install the master branch through `pip` with the following command:\n```\npip install -e git+https://github.com/mitgobla/TopograPy.git@master#egg=topograpy\n```\nAlternatively, you can get future versions that have not been release to the `master` branch by using the following:\n```\npip install -e git+https://github.com/mitgobla/TopograPy.git@future#egg=topograpy\n```\n\n## Example Usage\nHere's a video of a render of a Grand Canyon height map, that used this module in line with PyOpenGL and PyGame. \n\u003ca href=\"https://www.youtube.com/watch?v=_1nt6SkSSqg\"\u003e\u003cimg src=\"https://img.youtube.com/vi/_1nt6SkSSqg/0.jpg\" alt=\"Click to watch on YouTube\" width=200 height=150 title=\"Click here to watch on YouTube\" /\u003e\u003c/a\u003e\n## Example Code\n```python\nimport topograpy\n\ncross_section = topograpy.CrossSection()\ngraph = topograpy.SectionCalculation()\n\ntopograph = cross_section.calculate(\"height_map.png\", graph)\ncoordinates = cross_section.return_coordinates()\nimage_size = coordinates[2] # Tuple of image x and y size\nheights = graph.return_darkness() # The height of each line based on height % of image\n```\n\nTo get the darkness (height factor) for a specific pixel:\n```python\n\u003e\u003e\u003e heights[x_coordinate][y_coordinate]\n\u003e\u003e\u003e heights[0][0]\n25\n# The higher the number, the 'taller' the pixel on the height map\n```\n\nGenerator for creating two sets of coordinates to generate a line.\n```python\ngenerated_coordinates = [[], []]\nfor x_coord in range(image_size[0]):\n    for y_coord in range(image_size[1]):\n        generated_coordinates[0].append((x_coord, heights[x_coord][y_coord], y_coord)\n        generated_coordinates[1].append((x_coord, 0, y_coord))\n```\nThis will generate a list with two lists `xyz1` and `xyz2` \n```python\n\u003e\u003e\u003e generated_coordinates[0][0]\n(0, 25, 0)\n\u003e\u003e\u003e generated_coordinates[1][0]\n(0, 0, 0)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitgobla%2Ftopograpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitgobla%2Ftopograpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitgobla%2Ftopograpy/lists"}