{"id":18174842,"url":"https://github.com/kylebarron/demquery","last_synced_at":"2025-08-04T06:37:44.846Z","repository":{"id":60722209,"uuid":"224521071","full_name":"kylebarron/demquery","owner":"kylebarron","description":"Wrapper around rasterio to query points on a Digital Elevation Model","archived":false,"fork":false,"pushed_at":"2020-08-19T22:31:56.000Z","size":68,"stargazers_count":12,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-01T15:17:32.125Z","etag":null,"topics":["digital-elevation-model","rasterio","srtm"],"latest_commit_sha":null,"homepage":"","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/kylebarron.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-27T21:37:58.000Z","updated_at":"2025-03-01T11:07:56.000Z","dependencies_parsed_at":"2022-10-03T20:47:08.304Z","dependency_job_id":null,"html_url":"https://github.com/kylebarron/demquery","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/kylebarron/demquery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebarron%2Fdemquery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebarron%2Fdemquery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebarron%2Fdemquery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebarron%2Fdemquery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylebarron","download_url":"https://codeload.github.com/kylebarron/demquery/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebarron%2Fdemquery/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268658155,"owners_count":24285639,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["digital-elevation-model","rasterio","srtm"],"created_at":"2024-11-02T16:07:56.311Z","updated_at":"2025-08-04T06:37:44.789Z","avatar_url":"https://github.com/kylebarron.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# demquery\n\n\n[![Pypi](https://img.shields.io/pypi/v/demquery.svg)](https://pypi.python.org/pypi/demquery) [![Downloads](https://img.shields.io/travis/kylebarron/demquery.svg)](https://travis-ci.org/kylebarron/demquery) [![Supported Python Versions](https://img.shields.io/pypi/pyversions/demquery.svg)](https://pypi.org/project/demquery/#supported-versions)\n\nWrapper around rasterio to query points on a Digital Elevation Model.\n\n## Features\n\n- Use multiple raster files without having to merge them into a new file\n- Query many points at once\n- Optional 2D interpolation (linear, cubic, or quintic)\n- Reasonably performant by reading the minimal data required from raster\n\n## Install\n\nI recommend first installing dependencies with Conda, then installing demquery\nitself with pip.\n\n```\nconda install gdal rasterio numpy scipy -c conda-forge\n```\n\n```\npip install demquery\n```\n\n## CLI Script\n\n```\n\u003e demquery --help\nUsage: demquery [OPTIONS] FEATURES...\n\n  Assign elevations to GeoJSON\n\nOptions:\n  -d, --dem PATH          Paths to DEM files.  [required]\n  -g, --dem-glob TEXT     Glob expression for DEM paths if folder is provided.\n  -b, --band INTEGER      Band of rasters to use  [default: 1]\n  -i, --interp-kind TEXT  either None, \"linear\", \"cubic\", or \"quintic\". None\n                          will do no interpolation and choose the value in the\n                          DEM closest to the provided point. linear creates a\n                          3x3 grid and runs linear interpolation; cubic\n                          creates a 5x5 grid and runs cubic interpolation;\n                          quintic creates a 7x7 grid and runs quintic\n                          interpolation.\n  --help                  Show this message and exit.\n```\n\n```bash\necho \\\n    '{\"type\":\"Feature\",\"properties\":{\"name\": \"Glacier Peak\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-121.2436843,48.0163834]}}' \\\n    | demquery -d /path/to/dem/files\n```\nOutputs:\n```json\n{\"type\": \"FeatureCollection\", \"features\": [{\"type\": \"Feature\", \"geometry\": {\"type\": \"Point\", \"coordinates\": [-121.243684, 48.016383, 1431.5755615234375]}, \"properties\": {\"name\": \"Glacier Peak\"}}]}\n```\n\n## Documentation\n\n```py\nfrom demquery import Query\n\ndem_paths = ['dem1.tif', 'dem2.tif']\nquery = Query(dem_paths)\n\n# Points must be in longitude, latitude order!\n# These points are in Manhattan, not Antarctica\npoints = [(-73.985564, 40.757965), (-73.968520, 40.778912)]\nelevations = query.query_points(points, interp_kind='linear')\n```\n\n## Data Download\n\nFor a great visual tool to download worldwide SRTM data, check out these sites:\n\n- 30m resolution: http://dwtkns.com/srtm30m/\n- 90m resolution: http://dwtkns.com/srtm/\n\n## Releasing\n\nTo upload a new release to PyPI\n\n```bash\npython setup.py sdist\ntwine upload dist/demquery-0.3.0.tar.gz\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylebarron%2Fdemquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylebarron%2Fdemquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylebarron%2Fdemquery/lists"}