Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/357.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用数据流+;梁&x2B;python_Python_Google Cloud Storage_Google Cloud Dataflow_Apache Beam_Shapefile - Fatal编程技术网

使用数据流+;梁&x2B;python

使用数据流+;梁&x2B;python,python,google-cloud-storage,google-cloud-dataflow,apache-beam,shapefile,Python,Google Cloud Storage,Google Cloud Dataflow,Apache Beam,Shapefile,如何使用Dataflow+Beam+Python从Google云存储中读取Shapefile。 我只找到了beam.io.ReadFromText,但python shapefile reader需要像object这样的文件:shp.reader(shp=shp\u文件,dbf=dbf\u文件)或一个shapefile。 我正在使用Python 2.7。这是一种方法: prj_file=beam.io.gcp.gcsio.gcsio().open( filenamePRJ, mode='r',

如何使用Dataflow+Beam+Python从Google云存储中读取Shapefile。
我只找到了
beam.io.ReadFromText
,但python shapefile reader需要像object这样的文件:
shp.reader(shp=shp\u文件,dbf=dbf\u文件)
或一个shapefile。

我正在使用Python 2.7。

这是一种方法:

prj_file=beam.io.gcp.gcsio.gcsio().open(
filenamePRJ,
mode='r',
读取缓冲区大小=1677721600,
mime_type='application/octet stream'
)
shp_file=beam.io.gcp.gcsio.gcsio().open(
文件名HP,
mode='r',
读取缓冲区大小=1677721600,
mime_type='application/octet stream'
)
dbf_file=beam.io.gcp.gcsio.gcsio().open(
filenameDBF,
mode='r',
读取缓冲区大小=1677721600,
mime_type='application/octet stream'
)
sf=shp.Reader(shp=shp\u文件,dbf=dbf\u文件)
euref=osr.SpatialReference()
euref.ImportFromWkt(str(prj_file.read()))
wgs84=osr.SpatialReference()
wgs84.进口RomePSG(4326)
转换=osr.坐标转换(euref,wgs84)

这是一个python包,其中包括用于读取形状文件的自定义梁I/O连接器: