GDAL


NameGDAL JSON
Version 3.8.5 PyPI version JSON
download
home_pagehttp://www.gdal.org
SummaryGDAL: Geospatial Data Abstraction Library
upload_time2024-04-04 17:23:04
maintainerHoward Butler
docs_urlNone
authorFrank Warmerdam
requires_python>=3.6.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
GDAL/OGR in Python
==================

This Python package and extensions are a number of tools for programming and
manipulating the GDAL_ Geospatial Data Abstraction Library.

The GDAL project maintains SWIG generated Python
bindings for GDAL/OGR. Generally speaking the classes and methods mostly
match those of the GDAL and OGR C++ classes. There is no Python specific
reference documentation, but the https://gdal.org/api/python_bindings.html#tutorials includes Python examples.

Dependencies
------------

 * libgdal (3.8.5 or greater) and header files (gdal-devel)
 * numpy (1.0.0 or greater) and header files (numpy-devel) (not explicitly
   required, but many examples and utilities will not work without it)

Installation
------------

Conda
~~~~~

GDAL can be quite complex to build and install, particularly on Windows and MacOS.
Pre built binaries are provided for the conda system:

https://docs.conda.io/en/latest/

By the conda-forge project:

https://conda-forge.org/

Once you have Anaconda or Miniconda installed, you should be able to install GDAL with:

``conda install -c conda-forge gdal``

Unix
~~~~

The GDAL Python bindings requires setuptools.

pip
~~~

GDAL can be installed from the `Python Package Index <https://pypi.org/project/GDAL>`__:

::

    pip install GDAL

It will be necessary to have libgdal and its development headers installed
if pip is expected to do a source build because no wheel is available
for your specified platform and Python version.

To install the version of the Python bindings matching your native GDAL library:

::

    pip install GDAL=="$(gdal-config --version).*"

Building as part of the GDAL library source tree
------------------------------------------------

Python bindings are generated by default when building GDAL from source.
For more detail, see `Python bindings options <https://gdal.org/development/building_from_source.html#building-python-bindings>`__

The GDAL Python package is built using `SWIG <https://www.swig.org>`__. The currently supported version
is SWIG >= 4

Usage
-----

Imports
~~~~~~~

There are five major modules that are included with the GDAL_ Python bindings.::

  >>> from osgeo import gdal
  >>> from osgeo import ogr
  >>> from osgeo import osr
  >>> from osgeo import gdal_array
  >>> from osgeo import gdalconst

API
~~~

API documentation is available at https://gdal.org/api/python/osgeo.html

Numpy
-----

One advanced feature of the GDAL Python bindings not found in the other
language bindings is integration with the Python numerical array
facilities. The gdal.Dataset.ReadAsArray() method can be used to read raster
data as numerical arrays, ready to use with the Python numerical array
capabilities.

Tutorials
---------

See https://gdal.org/api/python_bindings.html#tutorials

Gotchas
-------

Although GDAL's and OGR's Python bindings provide a fairly "Pythonic" wrapper around the underlying C++ code, there are several ways in which the Python bindings differ from typical Python libraries.
These differences can catch Python programmers by surprise and lead to unexpected results. These differences result from the complexity of developing a large, long-lived library while continuing to maintain
backward compatibility. They are being addressed over time, but until they are all gone, please review this list of https://gdal.org/api/python_gotchas.html

Examples
--------

* An assortment of other samples are available in the `Python github samples directory <https://github.com/OSGeo/gdal/tree/master/swig/python/gdal-utils/osgeo_utils/samples>`__
  with some description in the https://gdal.org/api/python_bindings.html#examples.
* Several `GDAL utilities <https://github.com/OSGeo/gdal/tree/master/swig/python/gdal-utils/osgeo_utils/>`__
  are implemented in Python and can be useful examples.
* The majority of GDAL regression tests are written in Python. They are available at
  `https://github.com/OSGeo/gdal/tree/master/autotest <https://github.com/OSGeo/gdal/tree/master/autotest>`__

One example of GDAL/numpy integration is found in the `val_repl.py <https://github.com/OSGeo/gdal/tree/master/swig/python/gdal-utils/osgeo_utils/samples/val_repl.py>`__ script.

.. note::
   **Performance Notes**

   ReadAsArray expects to make an entire copy of a raster band or dataset
   unless the data are explicitly subsetted as part of the function call. For
   large data, this approach is expected to be prohibitively memory intensive.


.. _GDAL: https://gdal.org

            

Raw data

            {
    "_id": null,
    "home_page": "http://www.gdal.org",
    "name": "GDAL",
    "maintainer": "Howard Butler",
    "docs_url": null,
    "requires_python": ">=3.6.0",
    "maintainer_email": "hobu.inc@gmail.com",
    "keywords": null,
    "author": "Frank Warmerdam",
    "author_email": "warmerdam@pobox.com",
    "download_url": "https://files.pythonhosted.org/packages/8b/e0/4c1b601af568b75c77ca4b7ebf35bcc04b4c387a2a91645b6e2a4cf0c59e/GDAL-3.8.5.tar.gz",
    "platform": null,
    "description": "\nGDAL/OGR in Python\n==================\n\nThis Python package and extensions are a number of tools for programming and\nmanipulating the GDAL_ Geospatial Data Abstraction Library.\n\nThe GDAL project maintains SWIG generated Python\nbindings for GDAL/OGR. Generally speaking the classes and methods mostly\nmatch those of the GDAL and OGR C++ classes. There is no Python specific\nreference documentation, but the https://gdal.org/api/python_bindings.html#tutorials includes Python examples.\n\nDependencies\n------------\n\n * libgdal (3.8.5 or greater) and header files (gdal-devel)\n * numpy (1.0.0 or greater) and header files (numpy-devel) (not explicitly\n   required, but many examples and utilities will not work without it)\n\nInstallation\n------------\n\nConda\n~~~~~\n\nGDAL can be quite complex to build and install, particularly on Windows and MacOS.\nPre built binaries are provided for the conda system:\n\nhttps://docs.conda.io/en/latest/\n\nBy the conda-forge project:\n\nhttps://conda-forge.org/\n\nOnce you have Anaconda or Miniconda installed, you should be able to install GDAL with:\n\n``conda install -c conda-forge gdal``\n\nUnix\n~~~~\n\nThe GDAL Python bindings requires setuptools.\n\npip\n~~~\n\nGDAL can be installed from the `Python Package Index <https://pypi.org/project/GDAL>`__:\n\n::\n\n    pip install GDAL\n\nIt will be necessary to have libgdal and its development headers installed\nif pip is expected to do a source build because no wheel is available\nfor your specified platform and Python version.\n\nTo install the version of the Python bindings matching your native GDAL library:\n\n::\n\n    pip install GDAL==\"$(gdal-config --version).*\"\n\nBuilding as part of the GDAL library source tree\n------------------------------------------------\n\nPython bindings are generated by default when building GDAL from source.\nFor more detail, see `Python bindings options <https://gdal.org/development/building_from_source.html#building-python-bindings>`__\n\nThe GDAL Python package is built using `SWIG <https://www.swig.org>`__. The currently supported version\nis SWIG >= 4\n\nUsage\n-----\n\nImports\n~~~~~~~\n\nThere are five major modules that are included with the GDAL_ Python bindings.::\n\n  >>> from osgeo import gdal\n  >>> from osgeo import ogr\n  >>> from osgeo import osr\n  >>> from osgeo import gdal_array\n  >>> from osgeo import gdalconst\n\nAPI\n~~~\n\nAPI documentation is available at https://gdal.org/api/python/osgeo.html\n\nNumpy\n-----\n\nOne advanced feature of the GDAL Python bindings not found in the other\nlanguage bindings is integration with the Python numerical array\nfacilities. The gdal.Dataset.ReadAsArray() method can be used to read raster\ndata as numerical arrays, ready to use with the Python numerical array\ncapabilities.\n\nTutorials\n---------\n\nSee https://gdal.org/api/python_bindings.html#tutorials\n\nGotchas\n-------\n\nAlthough GDAL's and OGR's Python bindings provide a fairly \"Pythonic\" wrapper around the underlying C++ code, there are several ways in which the Python bindings differ from typical Python libraries.\nThese differences can catch Python programmers by surprise and lead to unexpected results. These differences result from the complexity of developing a large, long-lived library while continuing to maintain\nbackward compatibility. They are being addressed over time, but until they are all gone, please review this list of https://gdal.org/api/python_gotchas.html\n\nExamples\n--------\n\n* An assortment of other samples are available in the `Python github samples directory <https://github.com/OSGeo/gdal/tree/master/swig/python/gdal-utils/osgeo_utils/samples>`__\n  with some description in the https://gdal.org/api/python_bindings.html#examples.\n* Several `GDAL utilities <https://github.com/OSGeo/gdal/tree/master/swig/python/gdal-utils/osgeo_utils/>`__\n  are implemented in Python and can be useful examples.\n* The majority of GDAL regression tests are written in Python. They are available at\n  `https://github.com/OSGeo/gdal/tree/master/autotest <https://github.com/OSGeo/gdal/tree/master/autotest>`__\n\nOne example of GDAL/numpy integration is found in the `val_repl.py <https://github.com/OSGeo/gdal/tree/master/swig/python/gdal-utils/osgeo_utils/samples/val_repl.py>`__ script.\n\n.. note::\n   **Performance Notes**\n\n   ReadAsArray expects to make an entire copy of a raster band or dataset\n   unless the data are explicitly subsetted as part of the function call. For\n   large data, this approach is expected to be prohibitively memory intensive.\n\n\n.. _GDAL: https://gdal.org\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "GDAL: Geospatial Data Abstraction Library",
    "version": "3.8.5",
    "project_urls": {
        "Homepage": "http://www.gdal.org"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8be04c1b601af568b75c77ca4b7ebf35bcc04b4c387a2a91645b6e2a4cf0c59e",
                "md5": "e3dd8d07e16fe710582f9b459a397e8a",
                "sha256": "ad8addd58ba9c62aefc7f65d345c168736798f137e5c8f247af76fcf4862d371"
            },
            "downloads": -1,
            "filename": "GDAL-3.8.5.tar.gz",
            "has_sig": false,
            "md5_digest": "e3dd8d07e16fe710582f9b459a397e8a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6.0",
            "size": 802628,
            "upload_time": "2024-04-04T17:23:04",
            "upload_time_iso_8601": "2024-04-04T17:23:04.681863Z",
            "url": "https://files.pythonhosted.org/packages/8b/e0/4c1b601af568b75c77ca4b7ebf35bcc04b4c387a2a91645b6e2a4cf0c59e/GDAL-3.8.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-04 17:23:04",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "gdal"
}
        
Elapsed time: 0.23194s