kikita & Maps

GIS,spatial and artificial intellegence learning and share

在开始如下部署之前,一定要注意下版本对应的情况,否则会部署失败:

版本
Portal 10.6 Portal 10.5.1 Portal 10.5 Portal10.4.1
Pro 2.1 LM 10.6 不支持 不支持 不支持
Pro 2.0 LM 10.6 LM 10.5.1、10.6 LM 10.5.1、10.6 不支持
Pro 1.4 LM 10.6 LM 10.5.1、10.6 LM 10.5、10.5.1、10.6 LM 10.4.1

LM : License Manager, Portal: Portal for ArcGIS; Pro: ArcGIS Pro


如果您购买并已经部署了 Portal for ArcGIS,搭建了您的组织门户, 并且您希望在内网环境中通过 Named User 方式使用 ArcGIS Pro,那么您可以选择通过Portal for ArcGIS为组织成员配置Named User许可的方式。

1 为组织配置 ArcGIS Pro 许可

1) 首先您需要确定哪个组织门户将用于管理ArcGIS Pro的许可(这个指定的组织门户称为“许可门户”), 尤其当您的组织有多个门户的时候,请确保您指定的门户是您想要用来管理许可的那个门户。此种许可模式,需要安装ArcGIS License Server Administrator 程序。

2) 完成安装后,打开 ArcGIS License Server Administrator,并单击“计算机 ID…” 按钮。

3) 复制并保存计算机标识符对话框中的 MAC 地址

Read more »

主题安装

Maupassant 主题
安装主题和渲染器:

1
2
3
4
$ git clone https://github.com/tufu9441/maupassant-hexo.git themes/maupassant
$ npm install hexo-renderer-pug --save
$ npm install hexo-renderer-sass --save

编辑Hexo目录下的 _config.yml,将theme的值改为maupassant

功能配置

默认配置:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
_config.yml_config.ymlfancybox: true ## If you want to use fancybox please set the value to true.
disqus: ## Your disqus_shortname, e.g. username
gitment:
enable: false ## If you want to use Gitment comment system please set the value to true.
owner: ## Your GitHub ID, e.g. username
repo: ## The repository to store your comments, make sure you're the repo's owner, e.g. imsun.github.io
client_id: ## GitHub client ID, e.g. 75752dafe7907a897619
client_secret: ## GitHub client secret, e.g. ec2fb9054972c891289640354993b662f4cccc50
uyan: ## Your uyan_id. e.g. 1234567
livere: ## Your livere data-uid, e.g. MTAyMC8zMDAxOC78NTgz
changyan: ## Your changyan appid, e.g. cyrALsXc8
changyan_conf: ## Your changyan conf, e.g. prod_d8a508c2825ab57eeb43e7c69bba0e8b
valine: ## https://valine.js.org
enable: false ## If you want to use Valine comment system, please set the value to true.
appid: ## Your LeanCloud application App ID, e.g. pRBBL2JR4N7kLEGojrF0MsSs-gzGzoHsz
appkey: ## Your LeanCloud application App Key, e.g. tjczHpDfhjYDSYddzymYK1JJ
notify: false ## Mail notifier, see https://github.com/xCss/Valine/wiki/Valine-评论系统中的邮件提醒设置
verify: false ## Validation code.
placeholder: Just so so ## Comment box placeholders.
avatar: 'mm' ## Gravatar type, see https://github.com/xCss/Valine/wiki/avatar-setting-for-valine
pageSize: 10 ## Number of comments per page.
guest_info: nick,mail,link ## Attributes of reviewers.

google_search: true ## Use Google search, true/false.
baidu_search: false ## Use Baidu search, true/false.
swiftype: ## Your swiftype_key, e.g. m7b11ZrsT8Me7gzApciT
tinysou: ## Your tinysou_key, e.g. 4ac092ad8d749fdc6293
self_search: false ## Use a jQuery-based local search engine, true/false.
google_analytics: ## Your Google Analytics tracking id, e.g. UA-42425684-2
baidu_analytics: ## Your Baidu Analytics tracking id, e.g. 8006843039519956000
show_category_count: false ## If you want to show the count of categories in the sidebar widget please set the value to true.
toc_number: true ## If you want to add list number to toc please set the value to true.
shareto: false ## If you want to use the share button please set the value to true, you must have hexo-helper-qrcode installed.
busuanzi: false ## If you want to use Busuanzi page views please set the value to true.
widgets_on_small_screens: false ## Set to true to enable widgets on small screens.
canvas_nest:
enable: false ## If you want to use dynamic background please set the value to true, you can also fill the following parameters to customize the dynamic effect, or just leave them blank to keep the default effect.
color: ## RGB value of the color, e.g. "100,99,98"
opacity: ## Transparency of lines, e.g. "0.7"
zIndex: ## The z-index property of the background, e.g. "-1"
count: ## Quantity of lines, e.g. "150"
donate:
enable: false ## If you want to show the donate button after each post, please set the value to true and fill the following items according to your need. You can also enable donate button in a page by adding a "donate: true" item to the front-matter.
github: ## GitHub URL, e.g. https://github.com/Kaiyuan/donate-page
alipay_qr: ## Path of Alipay QRcode image, e.g. /img/AliPayQR.png
wechat_qr: ## Path of Wechat QRcode image, e.g. /img/WeChatQR.png
btc_qr: ## Path of Bitcoin QRcode image, e.g. /img/BTCQR.png
btc_key: ## Bitcoin key, e.g. 1KuK5eK2BLsqpsFVXXSBG5wbSAwZVadt6L
paypal_url: ## Paypal URL, e.g. https://paypal.me/tufu9441

menu:
- page: home
directory: .
icon: fa-home
- page: archive
directory: archives/
icon: fa-archive
- page: about
directory: about/
icon: fa-user
- page: rss
directory: atom.xml
icon: fa-rss

widgets: ## Six widgets in sidebar provided: search, category, tag, recent_posts, rencent_comments and links.
- search
- category
- tag
- recent_posts
- recent_comments
- links

links:
- title: site-name1
url: http://www.example1.com/
- title: site-name2
url: http://www.example2.com/
- title: site-name3
url: http://www.example3.com/

timeline:
- num: 1
word: 2014/06/12-Start
- num: 2
word: 2014/11/29-XXX
- num: 3
word: 2015/02/18-DDD
- num: 4
word: More

# Static files
js: js
css: css

# Theme version
version: 0.0.0

  • fancybox - 是否启用Fancybox图片灯箱效果
  • disqus - Disqus评论 shortname
  • gitment - Gitment评论相关参数
  • uyan - 友言评论 id
  • livere - 来必力评论 data-uid
  • changyan - 畅言评论 appid
  • valine - Valine评论相关参数
  • google_search - 默认使用Google搜索引擎
  • baidu_search - 若想使用百度搜索,将其设定为true
  • swiftype - Swiftype 站内搜索key
  • tinysou - 微搜索 key
  • self_search - 基于jQuery的本地搜索引擎,需要安装hexo-generator-search插件使用。
  • google_analytics - Google Analytics 跟踪ID
  • baidu_analytics - 百度统计 跟踪ID
  • show_category_count - 是否显示侧边栏分类数目
  • toc_number - 是否显示文章中目录列表自动编号
  • shareto - 是否使用分享按鈕,需要安装hexo-helper-qrcode插件使用
  • busuanzi - 是否使用不蒜子页面访问计数
  • widgets_on_small_screens - 是否在移动设备屏幕底部显示侧边栏
  • canvas_nest - 是否使用canvas动态背景
  • donate - 是否启用捐赠按钮
  • menu - 自定义页面及菜单,依照已有格式填写。填写后请在source目录下建立相应名称的文件夹,并包含index.md文件,以正确显示页面。导航菜单中集成了FontAwesome图标字体,可以在这里选择新的图标,并按照相关说明使用。
  • widgets - 选择和排列希望使用的侧边栏小工具。
  • links - 友情链接,请依照格式填写。
  • timeline - 网站历史时间线,在页面front-matter中设置layout: timeline可显示。
  • Static files - 静态文件存储路径,方便设置CDN缓存。
  • Theme version - 主题版本,便于静态文件更新后刷新CDN缓存。

主题特性

网站图标

Read more »

我们可以通过工具 Generate Map Server Cache Tiling Scheme 来生成自定义的切片方案,无论是ArcMap还是ArcGIS Pro ,无论是栅格切片还是矢量切片,都屡试不爽。

前段时间,为了方便 ArcGIS Pro 的自动化工作,我尝试用python调用这个功能,然而后面在使用其生成的切片方案(.xml)文件时,会发现切片原点总是默认值,例如地理坐标系统下是“-400,400”。

1
2
3
<TileOrigin xsi:type="typens:PointN">
<X>-400</X><Y>400</Y>
</TileOrigin>

arcpy.GenerateMapServerCacheTilingScheme_server (in_map, tile_origin, output_tiling_scheme, num_of_scales, scales, dots_per_inch, tile_size) 中,tile_origin这个参数标识为point对象,可是无论如何传参都无效。

这样会导致切片创建以及更新的一系列问题,在当时也是排查了很久才定位到这个问题。我的是测试环境是 ArcGIS Pro 2.0.x。值得欣慰的是,这个问题在 ArcMap的arcpy中没有问题,可以正确识别参数。

经过与esri美国工程师的沟通确认,此问题为arcpy for ArcGIS Pro的bug,暂时没有官方解决方法。

  • BUG-000110503 : Changing the tile origin parameter when using arcpy.server.GenerateMapServerCacheTilingScheme does not actually change the tile origin

绕行办法:

既然xml已经生成了,只有切片原点信息是错误,那就自己来解析xml修改对应参数即可。在自己的脚本中额外增加一个解析xml的逻辑吧,跳过这个坑。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import xml.dom.minidom as DOM
# Modify Scheme File to Avoid the tile_Origin Specification Bug of the Pro Tool
def modifyTilingSchemeFile(tileScheme,x_origin,y_origin):
try:
doc = DOM.parse(tileScheme)
tileOriginX = doc.getElementsByTagName('X')
tileOriginY = doc.getElementsByTagName('Y')
tileOriginX[0].firstChild.data = x_origin
tileOriginY[0].firstChild.data = y_origin
f = open(tileScheme, 'w+')
doc.writexml(f)
f.close()
return True
except:
arcpy.AddMessage("tile scheme XML file does not exist.")
Read more »

​ 这篇是读书笔记。同事手里有本《面向ArcGIS的Python脚本编程》,系统的介绍了如何结合ArcGIS使用python。最近拿来阅读,觉得受益颇多。最早期我是通过python自身的学习资源、书籍、ArcGIS帮助文档入门的,知识体系虽然建立起来了,但是很多细节没有考虑到,对照书中的内容温故知新、查漏补缺。

arcpy与AO

​ 书的开篇就介绍了脚本语言和程序语言的区别。我将其引申到日常工作中用户会经常问到的,“为什么AO可以实现的东西,arcpy却不能?”“为什么arcpy的功能这么‘粗粒度’?”

​ AO中包含了ArcGIS用到的所有编程对象,包含了数以千计的不同对象,因此程序员可以精细控制软件的外观和运行机制。Python作为一种非常平易近人的语言,既是脚本语言又是程序语言,在ArcGIS平台中,python更多充当的是脚本语言的角色,例如:访问ArcGIS现有的功能,组合各种现有功能来扩展ArcGIS的功能,更可以作为一种“粘合剂”将更多的功能整合进来。用书中的话讲,脚本语言就是在“控制其他应用程序以实现任务自动化”。arcpy是ArcGIS提供的python站点包,用于访问ArcGIS 的地理处理功能,定位正在于此。

arcpymodel builder

​ model builder(简称MB吧)是ArcGIS Desktop中我认为最可爱的功能没有之一,它采用了编程的思想却免去了书写代码,是给非程序员实践创造的启航之地。日常工作中,很多逻辑简单、功能清晰的任务都可以使用MB实现。以前写过一篇,《如何在ArcGIS for Desktop中实现批量任务》,具体不再展开。你可能由这些疑问,“MB也能完成批量任务,我何时应该考虑使用python?” 当然这里回答的是“不得不”的问题,如果你本来就是编程高手,从一开始就会觉得MB限制了你的想象力,如下回答可能不需要考虑。

​ MB的局限性有什么?或者说相比之下,python能更多实现什么?

  • python可以实现更高级的编程逻辑。例如嵌套循环是MB的软肋,一遇到多重遍历之类的任务就只能呵呵了。
  • python可以实现更底层的处理任务。例如我们可以使用Cursor,遍历表并对其增删改等等。
  • python可以集成第三方的资源。例如R语言等第三方类库来处理数据执行任务。
  • python可以不在ArcGIS软件内部执行任务,只需要安装并授权ArcGIS软件,然后通过独立脚本的形式运行。既然可以独立运行,就可以定义系统任务定时执行。

python基础

命名规范

Read more »

示例

地图服务

发布单个地图服务:
https://github.com/kikitaMoon/ArcGIS-Python/blob/master/LazyWorker/AutomaticallyPublishingServices/MapServciePY27/PublishingSingleMapService.py

批量发布地图服务:
https://github.com/kikitaMoon/ArcGIS-Python/blob/master/LazyWorker/AutomaticallyPublishingServices/MapServciePY27/BatchPublishingMapService.py

要素服务

批量发布要素服务:
Hosted Feature Service
https://github.com/kikitaMoon/ArcGIS-Python/blob/master/LazyWorker/AutomaticallyPublishingServices/FeatureServicePY27/PublishingHostedFeatureService.py

ArcGIS Server Feature Service
https://github.com/kikitaMoon/ArcGIS-Python/blob/master/LazyWorker/AutomaticallyPublishingServices/FeatureServicePY27/PublishingServerFeatureService.py

影像服务

https://github.com/kikitaMoon/ArcGIS-Python/blob/master/TechConferences/2016-DeveloperTechConference-Demo/4-PublishImageService.py

0%