通常,为了检索两个向量层之间的最近邻居,我将使用“通过最近邻连接属性”算法。
在我的情况下,我有一个矢量图层和许多 WMS 层。
有没有办法从 WMS 图层获取最近的特征(我可以指定距离)。
这是一个例子: !](https://i.sstatic.net/65LZ6jzB.png)
我中间有一个矩形多边形,我想将位于10公里以下的所有要素都列出到矩形多边形的属性表中。
有办法做到吗?
我尝试将 WMS 图层转换为矢量图层,但它不起作用。 还研究了一些其他算法,例如距离矩阵。
usage: gdal_polygonize.py [--help] [--help-general] [-q] [-8] [-o name=value]
[-mask filename] [-nomask] [-b band]
[-of ogr_format] [-lco name=value] [-overwrite]
src_filename dst_filename [dst_layername]
[dst_fieldname]
gdal_polygonize.py: error: the following arguments are required: dst_filename
Traceback (most recent call last):
File "C:\PROGRA~1/QGIS33~1.1/apps/qgis/./python/plugins\processing\algs\gdal\GdalUtils.py", line 138, in on_stderr
val = ba.data().decode('UTF-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 81: invalid start byte
The above exception was the direct cause of the following exception:
SystemError: <class 'PyQt5.QtCore.QByteArray'> returned a result with an error set
The above exception was the direct cause of the following exception:
SystemError: <class 'PyQt5.QtCore.QByteArray'> returned a result with an error set
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\PROGRA~1/QGIS33~1.1/apps/qgis/./python/plugins\processing\algs\gdal\GdalAlgorithm.py", line 133, in processAlgorithm
GdalUtils.runGdal(commands, feedback)
File "C:\PROGRA~1/QGIS33~1.1/apps/qgis/./python/plugins\processing\algs\gdal\GdalUtils.py", line 154, in runGdal
res = proc.run(feedback)
SystemError: <built-in method run of QgsBlockingProcess object at 0x000001E6E818DC10> returned a result with an error set
正如 Ian Turton 所解释的,WMS 图层是一张图片。我无法以我想要的方式从中获取信息。我会寻找 WFS 服务。