Skip to main content

Writing of coastlines, borders and rivers to images in Python

Project description

https://github.com/pytroll/pycoast/workflows/CI/badge.svg?branch=main https://coveralls.io/repos/github/pytroll/pycoast/badge.svg?branch=main https://img.shields.io/pypi/v/pycoast.svg pre-commit.ci status

Python package for adding coastlines, borders, rivers, lakes, cities, and other overlays to raster images.

Installation

PyCoast can be installed from PyPI using pip:

pip install pycoast

Or with conda using the conda-forge channel:

conda install -c conda-forge pycoast

Example

>>> from PIL import Image
>>> from pycoast import ContourWriterAGG
>>> img = Image.open('BMNG_clouds_201109181715_areaT2.png')
>>> proj4_string = '+proj=stere +lon_0=8.00 +lat_0=50.00 +lat_ts=50.00 +ellps=WGS84'
>>> area_extent = (-3363403.31,-2291879.85,2630596.69,2203620.1)
>>> area_def = (proj4_string, area_extent)
>>> cw = ContourWriterAGG('/home/esn/data/gshhs')
>>> cw.add_coastlines(img, area_def, resolution='l', level=4)
>>> cw.add_rivers(img, area_def, level=5, outline='blue')
>>> cw.add_borders(img, area_def, outline=(255, 0, 0))
>>> img.show()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycoast-1.6.0.tar.gz (9.6 MB view details)

Uploaded Source

File details

Details for the file pycoast-1.6.0.tar.gz.

File metadata

  • Download URL: pycoast-1.6.0.tar.gz
  • Upload date:
  • Size: 9.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.15

File hashes

Hashes for pycoast-1.6.0.tar.gz
Algorithm Hash digest
SHA256 79b42b1f7366d64513c7aede902472ef48858ace9ee3314b65e5666d4077c89b
MD5 e67487a39ed8455e549dc8ff3ab1dbd1
BLAKE2b-256 e20d436e3778a8af88862af9eaa772c6ba1e4d7a818077351bb0eaca9330b7ba

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page