用于创建纸质地图的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下获得许可。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何将HashMap<String,Object>从一个活动传递到另一个活动   java如何手动加密socket连接的流量?   java正则表达式生成一个不正确的结果   Java方法引用具有泛型参数的方法   java app setBackground()错误:不兼容的类型:int无法转换为Drawable   java是启动Spring引导而不是SpringApplication的其他方法。跑   无法打开java类路径资源[org/quartz/impl/jdbcjobstore/tables_h2.sql],因为它不存在   spring使用Java,如何确定来自tomcat Web服务器的出站服务调用?   java获取多个同名的XML元素JAXB   java使用Ant从同一代码库构建Swing和Android应用程序   JComponent的java重绘方法不起作用   java目标不可访问,标识符“beanName”解析为null   smtp是否有支持esmtp管道的java api?   java如何在Spring中自动连接业务对象   java在Hibernate中没有其他保存实体的方法吗?   针对两个客户机的SpringJavaWeb应用程序项目开发   使用split的java标记化输入