Skip to main content

A python package to draw china maps more easily

Project description

cnmaps 是一个可以让中国地图画起来更丝滑的地图类python扩展包

Pytest Pypi publish Anaconda Conda downloads PyPI version Pypi Downloads Documentation Status contributions welcome style

安装

安装 cnmaps 需要满足 Python 的解释器在 3.9 版本及以上。

使用pip安装

cnmaps 最简单也最快的安装方法是使用 pip 来安装 cnmaps: $ pip install -U cnmaps

使用conda安装

你也可以使用 conda 安装: $ conda install -c conda-forge cnmaps

快速开始

绘制国界

用最简单直接的方式,来绘制你的第一张中国地图。

import cartopy.crs as ccrs
import matplotlib.pyplot as plt
from cnmaps import get_adm_maps, draw_maps

fig = plt.figure(figsize=(10,10))
ax = fig.add_subplot(111, projection=ccrs.PlateCarree())

draw_maps(get_adm_maps(level='国')) 
plt.show()

绘制省界

cnmaps还可以绘制各省(特区/直辖市)的地图

import cartopy.crs as ccrs
import matplotlib.pyplot as plt
from cnmaps import get_adm_maps, draw_maps

fig = plt.figure(figsize=(10,10))
ax = fig.add_subplot(111, projection=ccrs.PlateCarree())

draw_maps(get_adm_maps(level='省'), linewidth=0.8, color='r') 

plt.show()

绘制市界

cnmaps可以绘制市级的行政区地图。

import cartopy.crs as ccrs
import matplotlib.pyplot as plt
from cnmaps import get_adm_maps, draw_maps

fig = plt.figure(figsize=(15,15))
ax = fig.add_subplot(111, projection=ccrs.PlateCarree())

draw_maps(get_adm_maps(level='市'), linewidth=0.5, color='g') 

plt.show()

绘制区县界

cnmaps可以绘制区县级的行政区地图。

import cartopy.crs as ccrs
import matplotlib.pyplot as plt
from cnmaps import get_adm_maps, draw_maps

fig = plt.figure(figsize=(20,20))
ax = fig.add_subplot(111, projection=ccrs.PlateCarree())

draw_maps(get_adm_maps(level='区县'), linewidth=0.8, color='r') 

plt.show()

使用指南

针对本项目更多的使用方法,我们还有一份更详细的文档:cnmaps使用指南

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

cnmaps-1.1.5.tar.gz (50.6 MB view details)

Uploaded Source

Built Distribution

cnmaps-1.1.5-py3-none-any.whl (51.9 MB view details)

Uploaded Python 3

File details

Details for the file cnmaps-1.1.5.tar.gz.

File metadata

  • Download URL: cnmaps-1.1.5.tar.gz
  • Upload date:
  • Size: 50.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for cnmaps-1.1.5.tar.gz
Algorithm Hash digest
SHA256 30abc65cd5b71430493edd1d7d294d65b60c43ea816cf0abe3dc0bdf0e44e679
MD5 f156627fd8bed983d48d72be27602671
BLAKE2b-256 e227e6963465bd321d1e44e7886a3951a7b7e6fbbf698d453470dad67dbfcb7b

See more details on using hashes here.

File details

Details for the file cnmaps-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: cnmaps-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 51.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for cnmaps-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4b641078bb52f2dd83b92179814980cb6ea71e806b347e8e8154ed08fc3ff4d5
MD5 efa8b32fb2912b3c88ebf8dac80365b7
BLAKE2b-256 0abd9138842649d3a120e978decb0e1bf97e31b35a06743f22dd6b80b2a78a58

See more details on using hashes here.

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