{"id":19847108,"url":"https://github.com/runalyze/dem-reader","last_synced_at":"2025-05-01T21:31:58.829Z","repository":{"id":62538179,"uuid":"61483987","full_name":"Runalyze/dem-reader","owner":"Runalyze","description":"Library to read digital elevation models, such as GeoTIFF files for SRTM.","archived":false,"fork":false,"pushed_at":"2021-10-18T13:39:29.000Z","size":57,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-09T00:45:53.958Z","etag":null,"topics":["dem","elevation-data","geotiff","srtm"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/Runalyze.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-19T14:25:48.000Z","updated_at":"2023-07-20T10:46:54.000Z","dependencies_parsed_at":"2022-11-02T16:15:24.009Z","dependency_job_id":null,"html_url":"https://github.com/Runalyze/dem-reader","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Runalyze%2Fdem-reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Runalyze%2Fdem-reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Runalyze%2Fdem-reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Runalyze%2Fdem-reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Runalyze","download_url":"https://codeload.github.com/Runalyze/dem-reader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224278373,"owners_count":17285080,"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":["dem","elevation-data","geotiff","srtm"],"created_at":"2024-11-12T13:13:25.930Z","updated_at":"2024-11-12T13:13:26.585Z","avatar_url":"https://github.com/Runalyze.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DEM reader\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/runalyze/dem-reader.svg)](https://packagist.org/packages/runalyze/dem-reader)\n[![Build Status](https://travis-ci.org/Runalyze/dem-reader.svg?branch=master)](https://travis-ci.org/Runalyze/dem-reader)\n[![Code Coverage](https://scrutinizer-ci.com/g/Runalyze/dem-reader/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Runalyze/dem-reader/?branch=master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Runalyze/dem-reader/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Runalyze/dem-reader/?branch=master)\n[![MIT License](https://img.shields.io/github/license/twbs/bootlint.svg)](https://github.com/Runalyze/dem-reader/blob/master/LICENSE)\n\nLibrary to read digital elevation models, such as GeoTIFF files for SRTM.\nThe GeoTIFF reader itself is originally based on [Bob Osola's SRTMGeoTIFFReader](http://www.osola.org.uk/elevations/index.htm).\n\n## Usage\n\n```php\nuse Runalyze\\DEM\\Reader;\nuse Runalyze\\DEM\\Provider\\GeoTIFF\\SRTM4Provider;\n\n$Provider = new SRTM4Provider('path/to/srtm/files');\n$Reader = new Reader($Provider);\n$elevations = $Reader-\u003egetElevations($latitudes, $longitudes);\n```\n\nTo give you some more details: Each provider is valid for its own. You can just ignore the general reader and\nuse your favorite provider:\n\n```php\nuse Runalyze\\DEM\\Provider\\GeoTIFF\\SRTM4Provider;\n\n$Provider = new SRTM4Provider('path/to/srtm/files');\n$elevations = $Provider-\u003egetElevations($latitudes, $longitudes);\n```\n\nBut you may have more than one provider available or different paths where your dem files are located.\nYou can attach as many providers as you want to the reader. Each of them will be checked if it can handle\nthe given elevation data (in the order they were attached) and the wirst one that does will be used.\n\n```php\nuse Runalyze\\DEM\\Reader;\nuse Runalyze\\DEM\\Provider\\GeoTIFF\\SRTM4Provider;\n\n$Reader = new Reader();\n$Reader-\u003eaddProvider(new SRTM4Provider('path/to/europe/srtm/files'));\n$Reader-\u003eaddProvider(new SRTM4Provider('path/to/america/srtm/files'));\n\n$europeElevations = $Reader-\u003egetElevations($europeLatitudes, $europeLongitudes);\n$americaElevations = $Reader-\u003egetElevations($americaLatitudes, $americaLongitudes);\n```\n\n## License\n\nCode released under [the MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunalyze%2Fdem-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frunalyze%2Fdem-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunalyze%2Fdem-reader/lists"}