All Projects → pytroll → pycoast

pytroll / pycoast

Licence: GPL-3.0 license
Python package for adding coastlines and borders on raster images

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pycoast

dea-coastlines
Extracting tidally-constrained annual shorelines and robust rates of coastal change from freely available Earth observation data at continental scale
Stars: ✭ 24 (-29.41%)
Mutual labels:  coastlines

PyCoast

https://github.com/pytroll/pycoast/workflows/CI/badge.svg?branch=main https://coveralls.io/repos/github/pytroll/pycoast/badge.svg?branch=main

Python package for adding coastlines and borders 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()
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].