Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Writing of coastlines, borders and rivers to images in Python

Project description

Python package for adding coastlines and borders to raster images.


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


>>> from PIL import Image
>>> from pycoast import ContourWriterAGG
>>> img ='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))

Project details

Download files

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

Files for pycoast, version 1.4.0
Filename, size File type Python version Upload date Hashes
Filename, size pycoast-1.4.0.tar.gz (7.5 MB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page