跳转到主要内容

在Python中将海岸线、边界和河流写入图像

项目描述

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包,用于向栅格图像添加海岸线、边界、河流、湖泊、城市和其他覆盖层。

安装

PyCoast可以通过pip从PyPI安装

pip install pycoast

或使用conda和conda-forge频道

conda install -c conda-forge pycoast

示例

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

项目详情


下载文件

下载适合您平台文件的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码分发

pycoast-1.7.1.tar.gz (12.7 MB 查看哈希值)

上传时间 源代码

构建分发

pycoast-1.7.1-py3-none-any.whl (7.4 MB 查看哈希值)

上传时间 Python 3

由以下机构支持