用于创建纸质地图的python包和CLI
papermap的Python项目详细描述
造纸机
用于创建纸质地图的python包和CLI。在
示例
下面,您将找到两个关于如何使用PaperMap的示例。这两个例子完成了完全相同的事情:创建一个比例为1:25000的曼谷A4地图。在
包装
frompapermapimportPaperMappm=PaperMap(13.75889,100.49722)pm.render()pm.save('Bangkok.pdf')
CLI
^{pr2}$安装
使用pip
pip install --upgrade papermap
来源
git clone https://github.com/sgraaf/papermap.git
cd papermap
python setup.py install
使用
包装
创建新PaperMap实例
pm=PaperMap(lat,lon,tile_server,scale,size,dpi,margin_top,margin_bottom,margin_left,margin_right,grid,nb_workers,nb_retries,landscape,quiet,gpx)
参数
lat (float): latitude (in DD)
lon (float): longitude (in DD)
tile_server (str): tile server to serve as the base of the paper map. Default: OpenStreetMap
api_key (str): API key for the chosen tile server (if applicable). Default: None
scale (int): scale of the paper map (in cm). Default: 25000
size (str): size of the paper map. Default: A4
margin_top (int): top margin (in mm), Default: 12
margin_bottom (int): bottom margin (in mm), Default: 12
margin_left (int): left margin (in mm), Default: 12
margin_right (int): right margin (in mm), Default: 12
dpi (int): dots per inch. Default: 300
grid (str): coordinate grid to display on the paper map. Default: None
nb_workers (int): number of workers (for parallelization). Default: 4
nb_retries (int): number of retries (for failed tiles). Default: 3
landscape (bool): use landscape orientation. Default: False
quiet (bool): activate quiet mode. Default: False
gpx (GPX): GPX object. Default: None
CLI
papermap [GLOBAL OPTIONS]{wgs84,utm,rd,gpx}[ARGS] PATH
全局选项
-t, --tile_server {OpenStreetMap,
OpenStreetMap Monochrome,
OpenTopoMap,
Thunderforest Landscape,
Thunderforest Outdoors,
Thunderforest Transport,
ESRI Standard,
ESRI Satellite,
ESRI Topo,
ESRI Dark Gray,
ESRI Light Gray,
ESRI Transportation,
Google Maps,
Google Maps Sattelite,
Google Maps Sattelite Hybrid,
Google Maps Terrain,
Google Maps Terrain Hybrid,
Stamen Terrain,
Stamen Toner,
Stamen Toner Lite,
Komoot,
Wikimedia,
Hike & Bike} Tile server to serve as the base of the paper map
-a, --api_key API key for the chosen tile server (if applicable)
-sz, --size {A0,A1,A2,A3,
A4,A5,A6,A7,Letter,Legal} Size of the paper map
-sc, --scale CENTIMETERS Scale of the paper map
-mt, --margin_top MILLIMETERS Top margin
-mb, --margin_bottom MILLIMETERS Bottom margin
-ml, --margin_left MILLIMETERS Left margin
-mr, --margin_right MILLIMETERS Right margin
-d, --dpi NUMBER Dots per inch
-g, --grid {utm, rd} Coordinate grid to display on the paper map
-w, --nb_workers NUMBER Number of workers (for parallelization)
-r, --nb_retries NUMBER Number of retries (for failed tiles)
-o, --open Open paper map after generating
-l, --landscape Use landscape orientation
-q, --quiet Activate quiet mode
-v, --version Display the current version of PaperMap
有关可供您使用的不同磁贴服务器的可视参考,请参阅^{
归因和选择
PaperMap(及其功能)从各种来源获得灵感。您可以在下面找到其中一些:
- StaticMap,一个基于python的小库,用于创建带有线条和标记的地图图像
- ScoutingTools.nl,一个荷兰网站,专门为侦察兵提供有用的工具(例如生成地图)
- rijksdriehoek,在各种编程语言中将WGS84坐标转换为RD坐标的函数集合
- Movable Type,与WGS84坐标相关的计算和代码的集合
许可证
PaperMap是开源的,并在GNU GPL版本3下获得许可。在
- 项目
标签: