{ "info": { "author": "Cesar Martinez Izquierdo - SCOLAB", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Affero General Public License v3", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Database", "Topic :: Scientific/Engineering :: GIS", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Utilities" ], "description": "pygdaltools\n===========\n\nPython library providing wrappers for the most common Gdal/OGR command\nline tools. Currently, ogr2ogr, ogrinfo and gdalinfo are supported. Note\nthat this library requires GDAL/OGR tools to be installed in the system.\n\nInstallation\n------------\n\n::\n\n pip install pygdaltools\n\nThis command does not automatically install GDAL/OGR tools in your\nsystem. In Debian or Ubuntu you can install them by using:\n\n::\n\n apt-get install gdalbin\n\nIn CentOS:\n\n::\n\n yum -y install gdal\n\nFor Windows, you can install GDAL/OGR by using\n`OSGeo4W `__. You will also need to see\nthe `Configuration section <#configuration>`__.\n\nUsage\n-----\n\nGdalinfo:\n\n::\n\n import gdaltools\n info = gdaltools.gdalinfo(\"/mypath/myraster.tif\")\n print info # output is the same generated by the gdalinfo command\n\nRaster stats:\n\n::\n\n stats = gdaltools.get_raster_stats(\"/mypath/myraster.tif\")\n print stats[0]\n # outputs a tuple: (band0_min, band0_max, band0_mean, band0_stdev)\n print stats[1]\n # outputs a tuple: (band1_min, band1_max, band1_mean, band1_stdev)\n\nOgrinfo:\n\n::\n\n # Basic usage:\n info = gdaltools.ogrinfo(\"thelayer.shp\", \"thelayer\", geom=False)\n print info # output is the same generated by the ogrinfo command\n\n # Other examples:\n ogrinfo(\"thedb.sqlite\")\n gdaltools.ogrinfo(\"thedb.sqlite\", \"layer1\", \"layer2\", geom=\"SUMMARY\")\n gdaltools.ogrinfo(\"thedb.sqlite\", sql=\"SELECT UpdateLayerStatistics()\")\n\nOgr2ogr. From shp to geojson:\n\n::\n\n ogr = gdaltools.ogr2ogr()\n ogr.set_encoding(\"UTF-8\")\n ogr.set_input(\"mylayer.shp\", srs=\"EPSG:4326\")\n ogr.set_output(\"mylayer.geojson\")\n ogr.execute()\n\nIt can also be chained in a single line:\n\n::\n\n gdaltools.ogr2ogr()\\\n .set_encoding(\"UTF-8\")\\\n .set_input(\"mylayer.shp\", srs=\"EPSG:4326\")\\\n .set_output(\"mylayer.geojson\").execute()\n\nOgr2ogr. From postgis to shp:\n\n::\n\n ogr = gdaltools.ogr2ogr()\n conn = gdaltools.PgConnectionString(host=\"localhost\", port=5432, dbname=\"scolab\", schema=\"data\", user=\"myuser\", password=\"mypass\")\n ogr.set_input(conn, table_name=\"roads\", srs=\"EPSG:4326\")\n ogr.set_output(\"mylayer.shp\")\n ogr.execute()\n\nOgr2ogr. From postgis to spatialite, specifying a different output table\nname:\n\n::\n\n ogr = gdaltools.ogr2ogr()\n conn = gdaltools.PgConnectionString(host=\"localhost\", port=5432, dbname=\"scolab\", schema=\"data\", user=\"myuser\", password=\"mypass\")\n ogr.set_input(conn, table_name=\"roads\", srs=\"EPSG:4326\")\n ogr.set_output(\"mydb.sqlite\", table_name=\"roads2010\")\n ogr.set_output_mode(data_source_mode=ogr.MODE_DS_CREATE_OR_UPDATE) # required to add the layer to an existing DB\n ogr.execute()\n\nOgr2ogr. From postgis to spatialite, reprojecting to \"EPSG:25830\":\n\n::\n\n ogr = gdaltools.ogr2ogr()\n conn = gdaltools.PgConnectionString(host=\"localhost\", port=5432, dbname=\"scolab\", schema=\"data\", user=\"myuser\", password=\"mypass\")\n ogr.set_input(conn, table_name=\"roads\", srs=\"EPSG:4326\")\n ogr.set_output(\"mydb.sqlite\", srs=\"EPSG:25830\")\n ogr.execute()\n\nConfiguration\n-------------\n\nBy default, gdaltools assumes that Gdal/Ogr commands are installed under\n/usr/bin/ (the standard Linux path). In order to configure specific\npaths (for instance for using the library in Windows), you can use:\n\n::\n\n import gdaltools\n gdaltools.Wrapper.BASEPATH = \"C/Program Files/Gdal/bin\"\n print gdaltools.gdalinfo(\"mywindowsraster.tif\")\n\nYou can also use lower level API for setting the full path for specific\ncommands:\n\n::\n\n info = gdaltools.GdalInfo(command_path=\"C/Program Files/Gdal/bin/gdalinfo.exe\")\n info.set_input('mywindowsraster.tif')\n print info.execute()\n print info.get_raster_stats()\n\nFAQ\n---\n\nNobody asked yet, but just in case.\n\n| Q - Why don't you use the Python GDAL/OGR API?\n| A - The GDAL/OGR command line tools perform very specific,\n higher-level tasks, while the Python GDAL/OGR API offers a much lower\n level API. Therefore, in this library we try to offer this higher\n level functionality using a programmer-friendly interface.\n\n| Q - But why do you internally call the command line tools, instead of\n implementing each command using the Python GDAL/OGR API?\n| A - We believe it would take us more time to write the library using\n the API instead of the CLI. It also has some advantages: 1) it can use\n different versions of GDAL/OGR in the same computer 2) it does not\n require having Python GDAL bindings installed. In any case, we can try\n \"the API way\" if you are willing to fund it ;-)\n\n| Q - Why don't you use the sample Python implementation of these\n commands that are included in the GDAL Python bindings?\n| A - They can be used, the library allows specifying the path to the\n command to use.\n\nAuthors\n-------\n\nCesar Martinez Izquierdo - `Scolab `__\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/scolab-dot-eu/pygdaltools", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pygdaltools", "package_url": "https://pypi.org/project/pygdaltools/", "platform": "", "project_url": "https://pypi.org/project/pygdaltools/", "project_urls": { "Homepage": "https://github.com/scolab-dot-eu/pygdaltools" }, "release_url": "https://pypi.org/project/pygdaltools/1.2/", "requires_dist": null, "requires_python": "", "summary": "Python wrapper for Gdal/OGR command line tools", "version": "1.2" }, "last_serial": 4003250, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "443900282c8c3dd61a6bf8597b008e97", "sha256": "9e98318ffce015f0b796a39463f9d606352366234c88b8001ce027e0657fa52c" }, "downloads": -1, "filename": "pygdaltools-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "443900282c8c3dd61a6bf8597b008e97", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13533, "upload_time": "2016-11-11T13:23:47", "url": "https://files.pythonhosted.org/packages/96/ac/928138a642faa357fa4aeb34870bb558339d26e79194453ae5af0cee8ac4/pygdaltools-0.1-py2.py3-none-any.whl" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "7ccd9476f9bbc855e61d8b8c123c8859", "sha256": "f7332c4354523b1469d76b82acff60d666b5ae92fbe8e4c7a71a8ecf48600871" }, "downloads": -1, "filename": "pygdaltools-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7ccd9476f9bbc855e61d8b8c123c8859", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16040, "upload_time": "2016-11-17T16:06:06", "url": "https://files.pythonhosted.org/packages/9c/b9/0317f7ad0169f5ff4c0b0538e0440b9deee93b67bc1531a7ac6b2109c5bf/pygdaltools-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "051b259cc5815108520a7a497c9e02d9", "sha256": "a8eb2bd496758b281ddd18ef87c170a791a644ca4deb4141b659bb9de5cd9edd" }, "downloads": -1, "filename": "pygdaltools-0.2.tar.gz", "has_sig": false, "md5_digest": "051b259cc5815108520a7a497c9e02d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32597, "upload_time": "2016-11-17T16:06:08", "url": "https://files.pythonhosted.org/packages/58/8a/58bc5d15b47e2634a44d21b84c8710067d9d10ea797c610151219cac250f/pygdaltools-0.2.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "55b8e4c2488e3b79ba641cf4b4a155f7", "sha256": "267941d8023fbc5c5a2b7f24dd37979fd84e4066d9a675fcb7659da648ffbf82" }, "downloads": -1, "filename": "pygdaltools-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "55b8e4c2488e3b79ba641cf4b4a155f7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16333, "upload_time": "2016-12-13T17:00:26", "url": "https://files.pythonhosted.org/packages/e6/fd/e298029612579c87d637bfc004d165feaded51c38ea125e21ec5f90c101e/pygdaltools-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f33b84c89fa1fe5ce4595eb60f656912", "sha256": "869373fce9cbe992a8cbe46ad0475b2bbfd5b5572e0c7f5ef5ae40ecc35a0075" }, "downloads": -1, "filename": "pygdaltools-1.0.tar.gz", "has_sig": false, "md5_digest": "f33b84c89fa1fe5ce4595eb60f656912", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32843, "upload_time": "2016-12-13T17:00:29", "url": "https://files.pythonhosted.org/packages/b2/40/e3993136d99f0ae8a51a1dd64596c15deae5f3fea456c61abd810605d993/pygdaltools-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "f5fe6e99d1f0fb03b37512c4ba8bfe2b", "sha256": "3cf4bf1c9d7cba466de3ec15111bbdb7663c44e9ec19065d696c8b1cfbbfefea" }, "downloads": -1, "filename": "pygdaltools-1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f5fe6e99d1f0fb03b37512c4ba8bfe2b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12962, "upload_time": "2016-12-14T15:30:26", "url": "https://files.pythonhosted.org/packages/81/68/a66bfb44b3098e1a859813d27c1cca0cd7df0f47ac21de73a4fcc4242f62/pygdaltools-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "31f028fc24181e5c4a2d9e2aefabc180", "sha256": "6717c0991dc572886bc707d9290caa4e8ad0f68ebc7f4471873a4cb31f44d7db" }, "downloads": -1, "filename": "pygdaltools-1.1.tar.gz", "has_sig": false, "md5_digest": "31f028fc24181e5c4a2d9e2aefabc180", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29939, "upload_time": "2016-12-14T15:30:28", "url": "https://files.pythonhosted.org/packages/a6/14/c6cd7f74a562d83c19f0f4d95c30b33d905e29d925b041f8eb1e81d9f194/pygdaltools-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "85950351c3c3cca368e35f28c5f78587", "sha256": "4fdd529395552a29dfe1a515371e9e8a9007b14c2d7a649a5aca273e6189e33f" }, "downloads": -1, "filename": "pygdaltools-1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "85950351c3c3cca368e35f28c5f78587", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13780, "upload_time": "2018-06-26T10:43:52", "url": "https://files.pythonhosted.org/packages/14/60/7abb79fd0e24f20edf771a5a777b5ca56bf42804447a365574765a315e79/pygdaltools-1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1b0e2ba5ebd044b723d23968dd14ed5c", "sha256": "851d191c062ea45479ed248c34ae673cce82105257b8300d5d3a660f337f0ca4" }, "downloads": -1, "filename": "pygdaltools-1.2.tar.gz", "has_sig": false, "md5_digest": "1b0e2ba5ebd044b723d23968dd14ed5c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32111, "upload_time": "2018-06-26T10:43:53", "url": "https://files.pythonhosted.org/packages/e6/9b/ddb35eec369a63396d0dbcb9f27cc4b372b6c0430c321b1b87e1a6371384/pygdaltools-1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "85950351c3c3cca368e35f28c5f78587", "sha256": "4fdd529395552a29dfe1a515371e9e8a9007b14c2d7a649a5aca273e6189e33f" }, "downloads": -1, "filename": "pygdaltools-1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "85950351c3c3cca368e35f28c5f78587", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13780, "upload_time": "2018-06-26T10:43:52", "url": "https://files.pythonhosted.org/packages/14/60/7abb79fd0e24f20edf771a5a777b5ca56bf42804447a365574765a315e79/pygdaltools-1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1b0e2ba5ebd044b723d23968dd14ed5c", "sha256": "851d191c062ea45479ed248c34ae673cce82105257b8300d5d3a660f337f0ca4" }, "downloads": -1, "filename": "pygdaltools-1.2.tar.gz", "has_sig": false, "md5_digest": "1b0e2ba5ebd044b723d23968dd14ed5c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32111, "upload_time": "2018-06-26T10:43:53", "url": "https://files.pythonhosted.org/packages/e6/9b/ddb35eec369a63396d0dbcb9f27cc4b372b6c0430c321b1b87e1a6371384/pygdaltools-1.2.tar.gz" } ] }