{"id":13408862,"url":"https://github.com/rasterio/rasterio","last_synced_at":"2025-12-11T21:04:24.963Z","repository":{"id":11619147,"uuid":"14116604","full_name":"rasterio/rasterio","owner":"rasterio","description":"Rasterio reads and writes geospatial raster datasets","archived":false,"fork":false,"pushed_at":"2025-05-06T17:02:19.000Z","size":27379,"stargazers_count":2352,"open_issues_count":155,"forks_count":539,"subscribers_count":143,"default_branch":"main","last_synced_at":"2025-05-07T11:41:54.297Z","etag":null,"topics":["cli","cython","gdal","gis","mapbox-satellite-oss","python","raster"],"latest_commit_sha":null,"homepage":"https://rasterio.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rasterio.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.txt","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.txt","threat_model":null,"audit":null,"citation":"CITATION.txt","codeowners":null,"security":"SECURITY.md","support":null,"governance":"governance.md","roadmap":null,"authors":"AUTHORS.txt","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-11-04T16:36:27.000Z","updated_at":"2025-05-01T19:33:32.000Z","dependencies_parsed_at":"2023-12-20T10:27:10.599Z","dependency_job_id":"d7f49dcf-f4fe-49af-96d7-af38e61952b6","html_url":"https://github.com/rasterio/rasterio","commit_stats":{"total_commits":3222,"total_committers":161,"mean_commits":"20.012422360248447","dds":0.4189944134078212,"last_synced_commit":"64474c1795d5d47c03e271386d21c3b244769946"},"previous_names":["mapbox/rasterio"],"tags_count":183,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasterio%2Frasterio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasterio%2Frasterio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasterio%2Frasterio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rasterio%2Frasterio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rasterio","download_url":"https://codeload.github.com/rasterio/rasterio/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253552500,"owners_count":21926499,"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":["cli","cython","gdal","gis","mapbox-satellite-oss","python","raster"],"created_at":"2024-07-30T20:00:55.969Z","updated_at":"2025-12-11T21:04:24.955Z","avatar_url":"https://github.com/rasterio.png","language":"Python","funding_links":[],"categories":["Libraries","Python","地理Geo处理","gis","کتابخانه هاي جغرافيا","Uncategorized"],"sub_categories":["کار با زمان و تقویم","Uncategorized"],"readme":"========\nRasterio\n========\n\nRasterio reads and writes geospatial raster data.\n\n.. image:: https://github.com/rasterio/rasterio/actions/workflows/tests.yaml/badge.svg\n   :target: https://github.com/rasterio/rasterio/actions/workflows/tests.yaml\n\n.. image:: https://github.com/rasterio/rasterio/actions/workflows/test_gdal_latest.yaml/badge.svg\n   :target: https://github.com/rasterio/rasterio/actions/workflows/test_gdal_latest.yaml\n\n.. image:: https://github.com/rasterio/rasterio/actions/workflows/test_gdal_tags.yaml/badge.svg\n   :target: https://github.com/rasterio/rasterio/actions/workflows/test_gdal_tags.yaml\n\n.. image:: https://img.shields.io/pypi/v/rasterio\n   :target: https://pypi.org/project/rasterio/\n\nGeographic information systems use GeoTIFF and other formats to organize and\nstore gridded, or raster, datasets. Rasterio reads and writes these formats and\nprovides a Python API based on N-D arrays.\n\nRasterio 1.5+ works with Python \u003e= 3.12, Numpy \u003e= 2, and GDAL \u003e= 3.8. Official\nbinary packages for Linux, macOS, and Windows with most built-in format drivers\nplus HDF5, netCDF, and OpenJPEG2000 are available on PyPI.\n\nRead the documentation for more details: https://rasterio.readthedocs.io/.\n\nExample\n=======\n\nHere's an example of some basic features that Rasterio provides. Three bands\nare read from an image and averaged to produce something like a panchromatic\nband.  This new band is then written to a new single band TIFF.\n\n.. code-block:: python\n\n    import numpy as np\n    import rasterio\n\n    # Read raster bands directly to Numpy arrays.\n    #\n    with rasterio.open('tests/data/RGB.byte.tif') as src:\n        r, g, b = src.read()\n\n    # Combine arrays in place. Expecting that the sum will\n    # temporarily exceed the 8-bit integer range, initialize it as\n    # a 64-bit float (the numpy default) array. Adding other\n    # arrays to it in-place converts those arrays \"up\" and\n    # preserves the type of the total array.\n    total = np.zeros(r.shape)\n\n    for band in r, g, b:\n        total += band\n\n    total /= 3\n\n    # Write the product as a raster band to a new 8-bit file. For\n    # the new file's profile, we start with the meta attributes of\n    # the source file, but then change the band count to 1, set the\n    # dtype to uint8, and specify LZW compression.\n    profile = src.profile\n    profile.update(dtype=rasterio.uint8, count=1, compress='lzw')\n\n    with rasterio.open('example-total.tif', 'w', **profile) as dst:\n        dst.write(total.astype(rasterio.uint8), 1)\n\nThe output:\n\n.. image:: http://farm6.staticflickr.com/5501/11393054644_74f54484d9_z_d.jpg\n   :width: 640\n   :height: 581\n\nAPI Overview\n============\n\nRasterio gives access to properties of a geospatial raster file.\n\n.. code-block:: python\n\n    with rasterio.open('tests/data/RGB.byte.tif') as src:\n        print(src.width, src.height)\n        print(src.crs)\n        print(src.transform)\n        print(src.count)\n        print(src.indexes)\n\n    # Printed:\n    # (791, 718)\n    # {u'units': u'm', u'no_defs': True, u'ellps': u'WGS84', u'proj': u'utm', u'zone': 18}\n    # Affine(300.0379266750948, 0.0, 101985.0,\n    #        0.0, -300.041782729805, 2826915.0)\n    # 3\n    # [1, 2, 3]\n\nA rasterio dataset also provides methods for getting read/write windows (like\nextended array slices) given georeferenced coordinates.\n\n.. code-block:: python\n\n    with rasterio.open('tests/data/RGB.byte.tif') as src:\n        window = src.window(*src.bounds)\n        print(window)\n        print(src.read(window=window).shape)\n\n    # Printed:\n    # Window(col_off=0.0, row_off=0.0, width=791.0000000000002, height=718.0)\n    # (3, 718, 791)\n\nRasterio CLI\n============\n\nRasterio's command line interface, named \"rio\", is documented at `cli.rst\n\u003chttps://github.com/rasterio/rasterio/blob/master/docs/cli.rst\u003e`__. Its ``rio\ninsp`` command opens the hood of any raster dataset so you can poke around\nusing Python.\n\n.. code-block:: pycon\n\n    $ rio insp tests/data/RGB.byte.tif\n    Rasterio 0.10 Interactive Inspector (Python 3.4.1)\n    Type \"src.meta\", \"src.read(1)\", or \"help(src)\" for more information.\n    \u003e\u003e\u003e src.name\n    'tests/data/RGB.byte.tif'\n    \u003e\u003e\u003e src.closed\n    False\n    \u003e\u003e\u003e src.shape\n    (718, 791)\n    \u003e\u003e\u003e src.crs\n    {'init': 'epsg:32618'}\n    \u003e\u003e\u003e b, g, r = src.read()\n    \u003e\u003e\u003e b\n    masked_array(data =\n     [[-- -- -- ..., -- -- --]\n     [-- -- -- ..., -- -- --]\n     [-- -- -- ..., -- -- --]\n     ...,\n     [-- -- -- ..., -- -- --]\n     [-- -- -- ..., -- -- --]\n     [-- -- -- ..., -- -- --]],\n                 mask =\n     [[ True  True  True ...,  True  True  True]\n     [ True  True  True ...,  True  True  True]\n     [ True  True  True ...,  True  True  True]\n     ...,\n     [ True  True  True ...,  True  True  True]\n     [ True  True  True ...,  True  True  True]\n     [ True  True  True ...,  True  True  True]],\n           fill_value = 0)\n\n    \u003e\u003e\u003e np.nanmin(b), np.nanmax(b), np.nanmean(b)\n    (0, 255, 29.94772668847656)\n\nRio Plugins\n-----------\n\nRio provides the ability to create subcommands using plugins.  See\n`cli.rst \u003chttps://github.com/rasterio/rasterio/blob/master/docs/cli.rst#rio-plugins\u003e`__\nfor more information on building plugins.\n\nSee the\n`plugin registry \u003chttps://github.com/rasterio/rasterio/wiki/Rio-plugin-registry\u003e`__\nfor a list of available plugins.\n\n\nInstallation\n============\n\nSee `docs/installation.rst \u003cdocs/installation.rst\u003e`__\n\nSupport\n=======\n\nThe primary forum for questions about installation and usage of Rasterio is\nhttps://rasterio.groups.io/g/main. The authors and other users will answer\nquestions when they have expertise to share and time to explain. Please take\nthe time to craft a clear question and be patient about responses.\n\nPlease do not bring these questions to Rasterio's issue tracker, which we want\nto reserve for bug reports and other actionable issues.\n\nDevelopment and Testing\n=======================\n\nSee `CONTRIBUTING.rst \u003cCONTRIBUTING.rst\u003e`__.\n\nDocumentation\n=============\n\nSee `docs/ \u003cdocs/\u003e`__.\n\nLicense\n=======\n\nSee `LICENSE.txt \u003cLICENSE.txt\u003e`__.\n\nAuthors\n=======\n\nThe `rasterio` project was begun at Mapbox and was transferred to the `rasterio` Github organization in October 2021.\n\nSee `AUTHORS.txt \u003cAUTHORS.txt\u003e`__.\n\nChanges\n=======\n\nSee `CHANGES.txt \u003cCHANGES.txt\u003e`__.\n\nWho is Using Rasterio?\n======================\n\nSee `here \u003chttps://libraries.io/pypi/rasterio/usage\u003e`__.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasterio%2Frasterio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frasterio%2Frasterio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frasterio%2Frasterio/lists"}