{ "info": { "author": "Norman Barker", "author_email": "norman.barker@mapbox.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", "Programming Language :: Python :: 3.6", "Topic :: Scientific/Engineering :: GIS" ], "description": "# COG Dumper\n\n[![Build Status](https://travis-ci.org/mapbox/COGDumper.svg?branch=master)](https://travis-ci.org/mapbox/COGDumper) [![codecov](https://codecov.io/gh/mapbox/COGDumper/branch/master/graph/badge.svg?token=Yd3y5aTvGo)](https://codecov.io/gh/mapbox/COGDumper)\n\nA python (3.6) utility to extract a tile from a Cloud Optimized GeoTIFF (COG) without decompressing the contained data. Tiff data can be hosted locally, on a web server or S3.\n\nThis can be useful for serving compressed tiles from a TIFF without invoking Rasterio and GDAL. This utility has been tested with Tiff that have JPEG compression.\n\nTiled Tiff is an extension to TIFF 6.0 and more detail can be found [here](http://www.alternatiff.com/resources/TIFFphotoshop.pdf)\n\nNote that tiles are padded at the edge of an image. This requires an image [mask](https://trac.osgeo.org/gdal/wiki/rfc15_nodatabitmask) to be defined if tile sizes do not align with the image width / height (as in the test data which demonstrates this effect).\n\n\n## Data Preparation\n\nRead the document on [COG](https://trac.osgeo.org/gdal/wiki/CloudOptimizedGeoTIFF) and create a tiled pyramid GeoTIFF.\n\nFor example;\n\n```\ngdal_translate SENTINEL2_L1C:S2A_MSIL1C_20170102T111442_N0204_R137_T30TXT_20170102T111441.SAFE/MTD_MSIL1C.xml:TCI:EPSG_32630 \\\n S2A_MSIL1C_20170102T111442_N0204_R137_T30TXT_20170102T111441_TCI.tif \\\n -co TILED=YES -co COMPRESS=DEFLATE\ngdaladdo -r average S2A_MSIL1C_20170102T111442_N0204_R137_T30TXT_20170102T111441_TCI.tif 2 4 8 16 32\ngdal_translate S2A_MSIL1C_20170102T111442_N0204_R137_T30TXT_20170102T111441_TCI.tif \\\n S2A_MSIL1C_20170102T111442_N0204_R137_T30TXT_20170102T111441_TCI_cloudoptimized_2.tif \\\n -co TILED=YES -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR -co COPY_SRC_OVERVIEWS=YES\n```\n\nThis library also works with a file hosted in an S3 bucket.\n\n## Installation\n\nPython 3.6 is required.\n\n```\npip install cogdumper\n```\n\nor from source\n\n```\ngit clone https://github.com/mapbox/COGDumper\ncd COGDumper\npip install .\n```\n\n## Command line interface\n\n```\n$ cogdumper --help\nUsage: cogdumper [OPTIONS] COMMAND [ARGS]...\n\n Command line interface for COGDumper.\n\nOptions:\n --version Show the version and exit.\n --help Show this message and exit.\n\nCommands:\n file COGDumper cli for local dataset.\n http COGDumper cli for web hosted dataset.\n s3 COGDumper cli for AWS S3 hosted dataset\n```\n\n##### local files\n```\ncogdumper file --help\nUsage: cogdumper file [OPTIONS]\n\n COGDumper cli for local dataset.\n\nOptions:\n --file PATH input file [required]\n --output PATH local output directory\n --xyz INTEGER... xyz tile coordinate where z is the overview level\n --version Show the version and exit.\n --help Show this message and exit.\n```\ne.g. `cogdumper file --file data/cog.tif --xyz 0 0 0`\n\n##### web files\n\n```\ncogdumper http --help\nUsage: cogdumper http [OPTIONS]\n\n COGDumper cli for web hosted dataset.\n\nOptions:\n --server TEXT server e.g. http://localhost:8080 [required]\n --path TEXT server path\n --resource TEXT server resource\n --output DIRECTORY local output directory\n --xyz INTEGER... xyz tile coordinates where z is the overview level\n --version Show the version and exit.\n --help Show this message and exit.\n```\n\ne.g. `cogdumper http --server http://localhost:8080 --path data --resource cog.tif`\n\n##### S3 files\n```\ncogdumper s3 --help\nUsage: cogdumper s3 [OPTIONS]\n\n COGDumper cli for AWS S3 hosted dataset\n\nOptions:\n --bucket TEXT AWS S3 bucket [required]\n --key TEXT AWS S3 key [required]\n --output DIRECTORY local output directory\n --xyz INTEGER... xyz tile coordinates where z is the overview level\n --help Show this message and exit.\n```\n\ne.g. `cogdumper s3 --bucket bucket_name --key key_name/image.tif --xyz 0 0 0`", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mapbox/COGDumper", "keywords": "CloudOptimized Geotiff", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "cogdumper", "package_url": "https://pypi.org/project/cogdumper/", "platform": "", "project_url": "https://pypi.org/project/cogdumper/", "project_urls": { "Homepage": "https://github.com/mapbox/COGDumper" }, "release_url": "https://pypi.org/project/cogdumper/1.1.0/", "requires_dist": null, "requires_python": ">=3", "summary": "", "version": "1.1.0" }, "last_serial": 3805257, "releases": { "1.1.0": [ { "comment_text": "", "digests": { "md5": "40230cc7adf58f52e47ef7679d5139cd", "sha256": "75afe1ed636f4b5b8b540832f464dcc4d5fa3e8594d58bf8f27aa4d12e3ba164" }, "downloads": -1, "filename": "cogdumper-1.1.0.tar.gz", "has_sig": false, "md5_digest": "40230cc7adf58f52e47ef7679d5139cd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 9340, "upload_time": "2018-04-25T02:36:41", "url": "https://files.pythonhosted.org/packages/51/bf/633ed641352bec35dc9c3386fcf954dfd9f664b169bf76a5e2377986630d/cogdumper-1.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "40230cc7adf58f52e47ef7679d5139cd", "sha256": "75afe1ed636f4b5b8b540832f464dcc4d5fa3e8594d58bf8f27aa4d12e3ba164" }, "downloads": -1, "filename": "cogdumper-1.1.0.tar.gz", "has_sig": false, "md5_digest": "40230cc7adf58f52e47ef7679d5139cd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 9340, "upload_time": "2018-04-25T02:36:41", "url": "https://files.pythonhosted.org/packages/51/bf/633ed641352bec35dc9c3386fcf954dfd9f664b169bf76a5e2377986630d/cogdumper-1.1.0.tar.gz" } ] }