from_layer错误地返回表的数据帧

955
2
2017年7月24日12:26
JoshuaBixby
通过 MVP尊敬贡献者
MVP尊敬贡献者

看着SpatialDataFrame文档:

静态from_layer* * kwargs

从一个FeatureLayer或Table对象返回一个SpatialDataFrame。输入:

参数层: feature relayer或Table
param gis: GIS对象

返回一个空间数据框架

然而,当使用Table对象时,我看到了一些不同的东西:

>>>tbl_url# URL到AGOL表>>>>>>资源描述arcgis特性表格tbl_url>>>类型资源描述<“arcgis.features.layer.Table”>>>>自卫队SpatialDataFramefrom_layer资源描述>>>类型自卫队<“pandas.core.frame.DataFrame”>>>>

因此,传递一个表返回一个DataFrame,尽管文档说返回一个SpatialDataFrame。更有趣的是这个“DataFrame”的方法和属性:

>>>SDF_attrs“复制”“删除”“from_featureclass”“from_hdf”“from_layer”“geoextent”“几何”“merge_datasets”“阴谋”“reproject”“select_by_location”“set_geometry”“to_featureclass”“to_featurelayer”“to_featureset”“to_hdf”]>>>>>>attrSDF_attrs打印attrhasattr自卫队attr复制真正的擦除from_featureclassfrom_hdffrom_layergeoextent几何merge_datasets情节真正的reprojectselect_by_locationset_geometry真正的to_featureclassto_featurelayerto_featuresetto_hdf真正的>>>

我可以理解其中的一些,因为有两个熊猫DataFrame版本和ArcGIS SpatialDataFrame版本的属性/方法,但为什么是set_geometry出现?

0荣誉
2回答
AndrewChapkowski
金宝搏吧

约书亚说:

你能把你使用的网址发邮件给我吗?achapkowski@esri.com

另外,你能告诉我你用的是什么版本吗?我无法重现你的问题。

0荣誉
JoshuaBixby
通过 MVP尊敬贡献者
MVP尊敬贡献者

安德鲁,我刚发了封邮件。我目前正在使用Python 1.4的ArcGIS API,快速检查显示了相同的结果。我暂时做了一个AGOL表公开可见,并发送了URL给你。

0荣誉