2013-07-21 38 views
4

似乎在ogr2ogr中对流式输入的支持很弱。例如,我为什么可以这样做:ogr2ogr中的VSI File API支持

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/ 

的第一个请求使用为源层的“世界粮食首脑会议”驱动程序和第二个请求使用源层的“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. 

回答

0

什么版本的GDAL你使用​​?这似乎是固定的gdal-2.2.0,因为这个命令的工作似乎工作:

$ ogr2ogr --version 
GDAL 2.2.0, released 2017/04/28 

$ 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/