gpt4 book ai didi

streaming - ogr2ogr 中的 VSI 文件 API 支持

转载 作者:行者123 更新时间:2023-12-02 23:26:59 25 4
gpt4 key购买 nike

看来ogr2ogr对流输入的支持很弱。例如,为什么我可以这样做:

curl "http://data.usgin.org/arizona/wfs?service=WFS&version=1.1.0&
request=GetFeature&typeName=azgs:activefaults&maxFeatures=10" |
ogr2ogr -f "KML" /vsistdout/ /vsistdin/

...但我不能这样做:

curl "http://data.usgin.org/arizona/wfs?service=WFS&version=1.1.0&
request=GetFeature&typeName=azgs:activefaults&maxFeatures=10&
outputformat=application/json" | ogr2ogr -f "KML" /vsistdout/ /vsistdin/

第一个请求使用源层的“WFS”驱动程序,第二个请求使用源层的“GeoJSON”驱动程序。第一个工作正常,但第二个给了我:

ERROR 1: GeoJSON parsing error: unexpected end of data (at offset 6000)
ERROR 4: Failed to read GeoJSON data
FAILURE:
Unable to open datasource `/vsistdin/' with the following drivers.

最佳答案

如果您在使用早期的 gdal 版本或其他格式时遇到此问题,只需添加有关标准输入上的格式的信息,例如

curl "http://data.usgin.org/arizona/wfs?service=WFS&version=1.1.0&
request=GetFeature&typeName=azgs:activefaults&maxFeatures=10&
outputformat=application/json" | ogr2ogr -f "KML" /vsistdout/ GeoJSON:/vsistdin/

关于streaming - ogr2ogr 中的 VSI 文件 API 支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17768231/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com