03-ArcGIS Python API学习记录--arcgis.feature模块

1. 说明

       arcgis.features模块包含了FeatureSet、FeatureLayer、table、FeatureLayerCollection、Feature、FeatureCollection、SpatialDataFrom和Submodules类,arcgis.features可实现要素的检索、属性查询、要素编辑等,架构如下图:

03-ArcGIS Python API学习记录--arcgis.feature模块

 

       除此之外,模块还提供了多种要素空间分析和管理工具,包括四大类工具:分析模式、丰富数据、查找位置、管理数据、数据摘要、临近分析、高程工具和管理工具。

  1. analysis module:提供了aggregate_points、calculate_density、connect_origins_to_destinations、create_buffers、create_drive_time_areas、create_route_layers、create_viewshed、create_watersheds、derive_new_locations、dissolve_boundaries、enrich_layer、extract_data、find_existing_locations、find_hot_spots、find_nearest、find_similar_locations、interpolate_points、join_features、merge_layers、overlay_layers、plan_routes、summarize_nearby、summarize_within、trace_downstream这24个类,实现各种常用的分析;
  2. analyze_patterns module:calculate_density、find_hot_spots、find_outliers、interpolate_points
  3. find_locations module:find_existing_locations、derive_new_locations、find_similar_locations、choose_best_facilities、create_viewshed、create_watersheds、trace_downstream
  4. enrich_data module:提供了enrich_layer类。
  5. manage_data module: dissolve_boundaries、extract_data、merge_layers、overlay_layers
  6. summarize_data module:aggregate_points、join_features、summarize_nearby、summarize_within
  7. use_proximity module:connect_origins_to_destinations、create_buffers、create_drive_time_areas、find_nearest、plan_routes
  8. elevation module:profile、viewshed、summarize_elevation
  9. managers module:AttachmentManager、SyncManager、FeatureLayerCollectionManager、FeatureLayerManager。

2. 简单使用

1. 检索portal中的所有要素服务    

       gis.content.search()

 

03-ArcGIS Python API学习记录--arcgis.feature模块

03-ArcGIS Python API学习记录--arcgis.feature模块

 

 

 

2. 读取featurelayer,输出要素服务的rest地址

03-ArcGIS Python API学习记录--arcgis.feature模块

 

3. 利用pandas获取要素数据(featureset):

03-ArcGIS Python API学习记录--arcgis.feature模块

 

4. 对于要素数据的操作

03-ArcGIS Python API学习记录--arcgis.feature模块

 

 这里以query为例,查询交易价超过40000的记录,如下:

03-ArcGIS Python API学习记录--arcgis.feature模块

 

5. 插值,将插值结果可视化

 将交易价进行插值

03-ArcGIS Python API学习记录--arcgis.feature模块

 

 插值过程可以在server manager的jobs中查询,查看结果:

03-ArcGIS Python API学习记录--arcgis.feature模块

 

  将插值结果添加到地图上,进行可视化显示

03-ArcGIS Python API学习记录--arcgis.feature模块