{ "info": { "author": "Kel Markert", "author_email": "kel.markert@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# cartoee\n[![PyPI version](https://badge.fury.io/py/cartoee.svg)](https://badge.fury.io/py/cartoee) [![Build Status](https://travis-ci.com/KMarkert/cartoee.svg?branch=master)](https://travis-ci.com/KMarkert/cartoee) [![Documentation Status](https://readthedocs.org/projects/cartoee/badge/?version=latest)](https://cartoee.readthedocs.io/en/latest/?badge=latest) [![DOI](https://zenodo.org/badge/163705692.svg)](https://zenodo.org/badge/latestdoi/163705692) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![status](http://joss.theoj.org/papers/2eea2105f42bbab1e49cf26d935837c8/status.svg)](http://joss.theoj.org/papers/2eea2105f42bbab1e49cf26d935837c8)\n\nPublication quality maps using [Earth Engine](https://earthengine.google.com/) and [Cartopy](https://scitools.org.uk/cartopy/docs/latest/)!\n![alt-text](./docs/_static/intro_fig.png)\n\n### Installation\n`cartoee` is available to install via `pip`. To install the package, you can use pip install for your Python environment:\n\n```\npip install cartoee\n```\n\nOr, you can install the package manually from source code using the following commands:\n\n```\ngit clone https://github.com/kmarkert/cartoee.git\ncd cartoee\npython setup.py install\n```\n\nPlease see the [documentation](https://cartoee.readthedocs.io/en/latest/introduction.html#dependencies) for instructions on installing dependencies.\n\n\n### Working with cartoee\n`cartoee` aims to do only one thing well: getting processing results from Earth Engine into a publication quality mapping interface. `cartoee` simply gets results from Earth Engine and plots it with the correct geographic projections leaving `ee` and `cartopy` to do more of the processing and visualization.\n\n#### A simple case\n\nHere is what a simple workflow looks like to visualize SRTM data on a map:\n\n```\nimport cartoee as cee\nimport ee\n\nee.Initialize()\n\n# get an earth engine image\nsrtm = ee.Image(\"CGIAR/SRTM90_V4\")\n\n# plot the result using cartoee\nax = cee.getMap(srtm,region=[-180,-90,180,90],visParams={'min':0,'max':3000})\n\nax.coastlines()\nplt.show()\n```\n![alt-text](./docs/_static/srtm_fig.png)\n\nNow that we have our EE image as a cartopy/matplotlib object, we can start styling our plot for the publication using the `cartopy` API.\n\n```\nimport cartopy.crs as ccrs\nfrom cartopy.mpl.gridliner import LATITUDE_FORMATTER, LONGITUDE_FORMATTER\n\n# set gridlines and spacing\nxticks = [-180,-120,-60,0,60,120,180]\nyticks = [-90,-60,-30,0,30,60,90]\nax.gridlines(xlocs=xticks, ylocs=yticks,linestyle='--')\n\n# set custom formatting for the tick labels\nax.xaxis.set_major_formatter(LONGITUDE_FORMATTER)\nax.yaxis.set_major_formatter(LATITUDE_FORMATTER)\n\n# set tick labels\nax.set_xticks([-180,-120,-60, 0, 60, 120, 180], crs=ccrs.PlateCarree())\nax.set_yticks([-90, -60, -30, 0, 30, 60, 90], crs=ccrs.PlateCarree())\n```\n![alt-text](./docs/_static/srtm_fig2.png)\n\n#### Doing more...\nNow that we have a grasp on a simple example, we can use Earth Engine to to some processing and make a pretty map.\n\n```\n# function to add NDVI band to imagery\ndef calc_ndvi(img):\n ndvi = img.normalizedDifference(['Nadir_Reflectance_Band2','Nadir_Reflectance_Band1'])\n return img.addBands(ndvi.rename('ndvi'))\n\n# MODIS Nadir BRDF-Adjusted Reflectance with NDVI band\nmodis = ee.ImageCollection('MODIS/006/MCD43A4')\\\n .filterDate('2010-01-01','2016-01-01')\\\n .map(calc_ndvi)\n\n# get the cartopy map with EE results\nax = cee.getMap(modis.mean(),cmap='YlGn'\n visParams={'min':-0.5,'max':0.85,'bands':'ndvi',},\n region=[-180,-90,180,90])\n\nax.coastlines()\n\ncb = cee.addColorbar(ax,loc='right',cmap='YlGn',visParams={'min':0,'max':1,'bands':'ndvi'})\n```\n![alt-text](./docs/_static/global_ndvi.png)\n\nYou can see from the example that we calculated NDVI on MODIS imagery from 2010-2015 and created a global map with the mean value per pixel.\n\nWhat if we want to make multiple maps with some different projections? We can do that by creating our figure and supplying the axes to plot on.\n\n\n```\n# get land mass feature collection\nland = ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017')\n\n# get seasonal averages and clip to land features\ndjf = modis.filter(ee.Filter.calendarRange(12,3,'month')).mean().clip(land)\nmam = modis.filter(ee.Filter.calendarRange(3,6,'month')).mean().clip(land)\njja = modis.filter(ee.Filter.calendarRange(6,9,'month')).mean().clip(land)\nson = modis.filter(ee.Filter.calendarRange(9,12,'month')).mean().clip(land)\n\nfig,ax = plt.subplots(ncols=2,nrows=2,subplot_kw={'projection': ccrs.Orthographic(-80,35)})\n\nimgs = np.array([[djf,mam],[jja,son]])\ntitles = np.array([['DJF','MAM'],['JJA','SON']])\n\nfor i in range(len(imgs)):\n for j in range(len(imgs[i])):\n ax[i,j] = cee.addLayer(imgs[i,j],ax=ax[i,j],\n region=bbox,dims=500,\n visParams=ndviVis,cmap='YlGn'\n )\n ax[i,j].coastlines()\n ax[i,j].gridlines(linestyle='--')\n ax[i,j].set_title(titles[i,j])\n\ncax = fig.add_axes([0.9, 0.2, 0.02, 0.6])\ncb = cee.addColorbar(ax[i,j],cax=cax,cmap='YlGn',visParams=ndviVis)\n```\n![alt-text](./docs/_static/seasonal_ndvi.png)\n\nTo see more examples, go to the documentation at https://cartoee.readthedocs.io!\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/kmarkert/cartoee", "keywords": "", "license": "GNU GPL v3", "maintainer": "", "maintainer_email": "", "name": "cartoee", "package_url": "https://pypi.org/project/cartoee/", "platform": "", "project_url": "https://pypi.org/project/cartoee/", "project_urls": { "Homepage": "http://github.com/kmarkert/cartoee" }, "release_url": "https://pypi.org/project/cartoee/0.0.5/", "requires_dist": [ "matplotlib", "Cython", "geos", "pyproj", "cartopy (==0.16.0)", "oauth2client", "google-api-python-client", "earthengine-api" ], "requires_python": "", "summary": "Publication quality maps using Earth Engine and Cartopy!", "version": "0.0.5" }, "last_serial": 4756639, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "7570f9d3c9b2a2b21d3cbe1a0ee4499d", "sha256": "971d31e4e36b3ca36980339e0d57e6284f2bd2d384fb2d77742da1b804103899" }, "downloads": -1, "filename": "cartoee-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7570f9d3c9b2a2b21d3cbe1a0ee4499d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4472, "upload_time": "2019-01-03T19:13:54", "url": "https://files.pythonhosted.org/packages/5e/5c/4ca060064de49ddcf4c77588c9277014d498ecccaf93acd4013c0ff18407/cartoee-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "274c301adae65d57cdc22869de34a972", "sha256": "ee12797d3dad3cf9ad1f7859a10ed8597d49e204c5fbe7420630714eff506cf2" }, "downloads": -1, "filename": "cartoee-0.0.1.tar.gz", "has_sig": false, "md5_digest": "274c301adae65d57cdc22869de34a972", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4405, "upload_time": "2019-01-03T19:13:56", "url": "https://files.pythonhosted.org/packages/72/c1/e016754c760c18afd967b7bb1d3bb63ba7c2efbd0cc8cbf493123012dd7c/cartoee-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "2c5b51eb8d713a2b57e8ec9d6af015cd", "sha256": "471c18e1020b6187914a39ba6b97495b0ae26c106ee120c0a643976a1cba3b9e" }, "downloads": -1, "filename": "cartoee-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "2c5b51eb8d713a2b57e8ec9d6af015cd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4606, "upload_time": "2019-01-04T20:45:28", "url": "https://files.pythonhosted.org/packages/ac/6b/5ee36df0c60d5ac19e6b9b311e9be1f8d71147500bcc9d56df9f1be572b5/cartoee-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "394b609470b0faf715f7c94b20123425", "sha256": "947b61077e0bbe30c947463f79dc861df992a1fa315965690012896758905830" }, "downloads": -1, "filename": "cartoee-0.0.2.tar.gz", "has_sig": false, "md5_digest": "394b609470b0faf715f7c94b20123425", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4539, "upload_time": "2019-01-04T20:45:29", "url": "https://files.pythonhosted.org/packages/14/db/db3d8a4d1ea90a81cfba61002c401167a810a9c41823dd5b6952f5bed4e3/cartoee-0.0.2.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "dd7c4b5085434ac8da7b8124ec5f4ff1", "sha256": "c46393f0b159497664b2d460b9a58867fc4c1cf63d7919e85f03e7650e46183f" }, "downloads": -1, "filename": "cartoee-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "dd7c4b5085434ac8da7b8124ec5f4ff1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7902, "upload_time": "2019-01-28T20:19:09", "url": "https://files.pythonhosted.org/packages/52/04/430d9d10ff497d744f9e0d94fa5df07a0be3eb096bbd3e9cd417d4c39001/cartoee-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3c3166ba91d7804f25edc066738a4a54", "sha256": "e519c5947a2a4b07fbf1bea3d4b57d054f568e26bec274d45041da986d24db21" }, "downloads": -1, "filename": "cartoee-0.0.4.tar.gz", "has_sig": false, "md5_digest": "3c3166ba91d7804f25edc066738a4a54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6400, "upload_time": "2019-01-28T20:19:10", "url": "https://files.pythonhosted.org/packages/29/df/4b8084beb3e274874a48ccf91a51f50839d3919a241fd904d02e37f72dc1/cartoee-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "fbb25935ff4870815f22323e0dd2c0c2", "sha256": "8cf6d2994b4c7896dc7be7edd7d60d6847e42d12420a9d3c0b6b3cd11abff19e" }, "downloads": -1, "filename": "cartoee-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "fbb25935ff4870815f22323e0dd2c0c2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10837, "upload_time": "2019-01-29T20:50:55", "url": "https://files.pythonhosted.org/packages/a9/38/4b196163654dd00daaa4a6988bff6908866130bc21703d4b73a439ffe654/cartoee-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "45c62d22b2b5ad71b29eea077016adae", "sha256": "089e47382d01c4e8c7f6cf9b70c461a15a3bfd63a475f709bf9b42d656820078" }, "downloads": -1, "filename": "cartoee-0.0.5.tar.gz", "has_sig": false, "md5_digest": "45c62d22b2b5ad71b29eea077016adae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8389, "upload_time": "2019-01-29T20:50:56", "url": "https://files.pythonhosted.org/packages/82/89/97af186be14eb171336d06f754ef3a81119365c35f72b6182c9f91433a9e/cartoee-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fbb25935ff4870815f22323e0dd2c0c2", "sha256": "8cf6d2994b4c7896dc7be7edd7d60d6847e42d12420a9d3c0b6b3cd11abff19e" }, "downloads": -1, "filename": "cartoee-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "fbb25935ff4870815f22323e0dd2c0c2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10837, "upload_time": "2019-01-29T20:50:55", "url": "https://files.pythonhosted.org/packages/a9/38/4b196163654dd00daaa4a6988bff6908866130bc21703d4b73a439ffe654/cartoee-0.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "45c62d22b2b5ad71b29eea077016adae", "sha256": "089e47382d01c4e8c7f6cf9b70c461a15a3bfd63a475f709bf9b42d656820078" }, "downloads": -1, "filename": "cartoee-0.0.5.tar.gz", "has_sig": false, "md5_digest": "45c62d22b2b5ad71b29eea077016adae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8389, "upload_time": "2019-01-29T20:50:56", "url": "https://files.pythonhosted.org/packages/82/89/97af186be14eb171336d06f754ef3a81119365c35f72b6182c9f91433a9e/cartoee-0.0.5.tar.gz" } ] }