【发布时间】:2020-03-28 00:05:45
【问题描述】:
我正在尝试使用 OGR 从带有 python 的 WFS 源中读取功能并将它们放入 PostgreSQL 数据库中。 要开始在迭代中读取特征,我首先获取第一个特征,然后再进入遍历所有特征的 while 循环:
layer.ResetReading()
feat = layer.GetNextFeature()
if not feat:
self.log("error", "Kon niet naar de eerste feature in %s gaan." % layer.GetName())
else:
if feat.GetFID():
self.sourcelist.append(feat.GetFID())
print ("\n%s : Source feature met dit nummer toevoegen aan %s" % (str(i),uitnaam), end = '\r' )
图层存在。我什至可以从中获取 ogr.layer.GetLayerDefn() ,我用它在执行这段代码之前在 postgresql 中创建字段。 这一切都适用于大多数 WFS 服务和层,但是,对于某些 WFS 层,无法读取任何特征。它不报告错误,只是没有功能。当我使用浏览器使用相同的 srs 和 bbox 发出请求时,它确实会生成一个功能列表。 我真的不明白为什么这适用于我使用的大多数 wfs 服务的大多数层,而对于某些它却不起作用? 我试图用 ogr2ogr 控制台应用程序来实现相同的目标。对于在我的程序中不起作用的层,它会返回一个错误:
ERROR 1: srsDimension = 4 not supported
有人知道这里发生了什么吗?
【问题讨论】:
-
PS 一个发生这种情况的 WFS 是:geoservices.vlaamsbrabant.be/FSW/MapServer/WFSServer?在层中:dataservices_FSW:Fietssnelwegen
-
你最好在那里问这种问题:gis.stackexchange.com ;-)
标签: python postgis gdal ogr osgeo