当前位置:网站首页>arcgis style样式表文件转换成geoserver sld文件
arcgis style样式表文件转换成geoserver sld文件
2022-07-27 05:19:00 【LEILEI18A】
arcgis style样式表文件转换成geoserver sld文件
目录
0.目的
arcgis mxd 或者 shp文件中的样式表转成geoserver所需要的sld样式表文件。
why:arcgis server(portal)发布服务不用管这些,但是这是商业版的,如果我要用开源的就需要geoserver来实现了,虽然geoserver只支持二维服务,那么很多数据都是arcgis来绘制的,样式表需要一样才能完整的表达出数据的信息,那么就需要将arcgis的样式表转成geoserver所需要的。有很多人会建议用qgis自己重新绘制样式表,但是会有不匹配的地方,不如直接将arcgis的样式表转成geoserver需要的sld文件;
how:网上说的较多的是arcmap2sld,arc2earth,但是都有各种问题存在(不免费、安装环境等)
1.探索
目前看到2个比较适合的操作方案,虽然比较麻烦一点,但是免费
[1] Converting ESRI Styles to QGIS XML Using SLYR — open.gis.lab
[2] https://github.com/camptocamp/lyrx2sld
------------------------------------------------------------------------------------------------
[2] arcgis pro lyrx样式表转geoserver支持的sld文件代码:
# refer https://github.com/GeoCat/bridge-style/issues/59
# lyrx2sld github项目 即以 GeoCat/bridge-style 为基础开展的
import json
from bridgestyle import sld, arcgis
input_file = "/my/path/input.lyrx"
output_file = "/my/path/output.sld"
# Read the *.lyrx JSON
with open(input_file) as f:
esri_style = json.load(f)
# Convert Esri CIM to GeoStyler (intermediate format)
geostyler, _, warnings = arcgis.togeostyler.convert(esri_style)
print(warnings)
# Convert GeoStyler to SLD
sld_output, warnings = sld.fromgeostyler.convert(geostyler)
# Write the XML output string to the destination SLD file
with open(output_file) as f:
f.write(sld_output)2.缺点
目前我仅仅是搜索到了这2个;
对于lyrx2sld,如果你的是lyr文件,那么用arcgis pro打开另存为lyrx文件即可,然后采用代码直接转【但是很多样式其实是转不了的,即使geoserver设置了esri的fonts,样式显示乱码,因此,仅能转换部分样式;geoserver开源确实没办法做到这么详细的样式表】
假如你获取到了arcgis pro,那么应该可以直接导出吧,我没有测试过!
在ArcGIS中右键工具栏,customize,选择command选项卡,在搜索框中输入style ,选择tools,将第一个工具“export map styles”拖动到工具栏上,就可以用啦。未探索
边栏推荐
- Redis在windows下的idea连接不上问题
- 【头歌】重生之我在py入门实训中(7): 函数调用
- Brief analysis of application process creation process of activity
- 18. Convolutional neural network
- LaTeX中多个公式公用一个序号时
- 【头歌】重生之我在py入门实训中(10): Numpy
- Social media user level psychological stress detection based on deep neural network
- [concurrent programming series 9] priorityblockingqueue, delayqueue principle analysis of blocking queue
- Lightroom Classic 2022 v11.4中文版「最新资源」
- 1. Introduction to pytorch
猜你喜欢
随机推荐
Gbase 8C - SQL reference 4 character set support
Day 3. Suicidal ideation and behavior in institutions of higher learning: A latent class analysis
malloc和new之间的不同-实战篇
Performance optimization of common ADB commands
超强远程连接管理工具:Royal TSX
百问网驱动大全学习(一)LCD驱动
子类调用父类构造函数的时机
物联网操作系统
14.实例-多分类问题
Social media user level psychological stress detection based on deep neural network
Gbase 8C - SQL reference 6 SQL syntax (4)
【5·20特辑】MatLAb之我在和你表白
【头歌】重生之机器学习-线性回归
Pix2Pix原理解析
西瓜书第三章---线性模型学习笔记
10. Gradient, activation function and loss
面试常问Future、FutureTask和CompletableFuture
10.梯度、激活函数和loss
What has been updated in the Chinese version of XMIND mind map 2022 v12.0.3?
pytorch使用data_prefetcher提升数据读取速度









