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()

License

Copyright 2011 Pycoast developers

Licensed under the Apache License, Version 2.0 (the “License”); you may not use these files except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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.8.0.tar.gz (12.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycoast-1.8.0-py3-none-any.whl (7.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycoast-1.8.0.tar.gz
  • Upload date:
  • Size: 12.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycoast-1.8.0.tar.gz
Algorithm Hash digest
SHA256 a98633b657b3113077072240c45300450be5860c6536362e4f93bbc3251b70d2
MD5 9f1acd4db534f1e277c2bdb3e3fa5f24
BLAKE2b-256 2cb151aa5b90c8826b8816a750dd5a5a7ddb12ceddb9584331892eb9a37e744b

See more details on using hashes here.

File details

Details for the file pycoast-1.8.0-py3-none-any.whl.

File metadata

  • Download URL: pycoast-1.8.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pycoast-1.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 34e6c1ff5ef4a3f24d9cf4a371c8e61e1b1263e6bc81f104e81913d961155b58
MD5 285783422d7ef60701c4e4c2709c5385
BLAKE2b-256 b8345b5034432fc49b72cb31f39c5ad7654e41ee6a76139df290d63662f59769

See more details on using hashes here.

Supported by

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