地理数据框#

A GeoDataFrame 是一种表格数据结构,至少包含一列 GeoSeries 列,用于存储几何形状。

构造函数#

GeoDataFrame([数据,几何,坐标参考系统])

GeoDataFrame对象是一个pandas.DataFrame,其中有一个或多个列包含几何信息。

序列化 / 输入输出 / 转换#

GeoDataFrame.from_file(filename, **kwargs)

备用构造函数,用于从文件创建一个 GeoDataFrame

GeoDataFrame.from_features(features[, crs, ...])

备用构造函数,用于从特征的可迭代对象或特征集合创建GeoDataFrame。

GeoDataFrame.from_postgis(sql, con[, ...])

备用构造函数,用于从包含WKB表示的几何列的sql查询创建一个 GeoDataFrame

GeoDataFrame.from_arrow(table[, geometry])

根据GeoArrow扩展类型,从Arrow表对象构建一个GeoDataFrame。

GeoDataFrame.to_file(文件名[, 驱动, ...])

GeoDataFrame写入文件。

GeoDataFrame.to_json([na, show_bbox, ...])

返回GeoDataFrame的GeoJSON表示形式作为字符串。

GeoDataFrame.to_geo_dict([na, show_bbox, ...])

返回GeoDataFrame的python特征集合表示,作为一个字典,包含基于__geo_interface__ GeoJSON类似规范的特征列表。

GeoDataFrame.to_parquet(路径[, 索引, ...])

将GeoDataFrame写入Parquet格式。

GeoDataFrame.to_arrow(*[, index, ...])

将GeoDataFrame编码为GeoArrow格式。

GeoDataFrame.to_feather(路径[, 索引, ...])

将GeoDataFrame写入Feather格式。

GeoDataFrame.to_postgis(name, con[, schema, ...])

将 GeoDataFrame 上传到 PostGIS 数据库。

GeoDataFrame.to_wkb([hex])

将GeoDataFrame中的所有几何列编码为WKB。

GeoDataFrame.to_wkt(**kwargs)

将GeoDataFrame中的所有几何列编码为WKT。

投影处理#

GeoDataFrame.crs

坐标参考系统 (CRS) 表示为一个 pyproj.CRS 对象。

GeoDataFrame.set_crs([crs, epsg, inplace, ...])

设置GeoDataFrame的坐标参考系统(CRS)。

GeoDataFrame.to_crs([crs, epsg, inplace])

将几何体转换为新的坐标参考系。

GeoDataFrame.estimate_utm_crs([datum_name])

根据数据集的边界返回估计的UTM坐标参考系统。

活跃几何体处理#

GeoDataFrame.rename_geometry(col[, inplace])

将GeoDataFrame几何列重命名为指定名称。

GeoDataFrame.set_geometry(col[, drop, ...])

使用现有列或指定的输入设置GeoDataFrame几何形状。

GeoDataFrame.active_geometry_name

返回活动几何列的名称

聚合和拆分#

GeoDataFrame.dissolve([by, aggfunc, ...])

groupby中的几何体合并为单个观察值。

GeoDataFrame.explode([列, 忽略索引, ...])

将多部分几何体分解为多个单独的几何体。

空间连接#

GeoDataFrame.sjoin(df[, 如何, 谓词, ...])

两个GeoDataFrames的空间连接。

GeoDataFrame.sjoin_nearest(right[, how, ...])

基于两个GeoDataFrame之间几何体的距离进行空间连接。

叠加操作#

GeoDataFrame.clip(mask[, keep_geom_type, sort])

将点、线或多边形几何对象裁剪到掩膜范围。

GeoDataFrame.overlay(right[, how, ...])

在GeoDataFrames之间执行空间叠加。

绘图#

GeoDataFrame.explore(*args, **kwargs)

基于 GeoPandas 和 folium/leaflet.js 的交互式地图

GeoDataFrame.plot

GeoplotAccessor 的别名

空间索引#

GeoDataFrame.sindex

生成空间索引

GeoDataFrame.has_sindex

检查空间索引的存在性而不生成它。

索引#

GeoDataFrame.cx

基于坐标的索引器,通过与边界框相交来选择。

接口#

GeoDataFrame.__geo_interface__

返回一个 GeoDataFrame 作为一个 python 特征集合。

GeoDataFrame.iterfeatures([na, show_bbox, ...])

返回一个迭代器,该迭代器生成符合 __geo_interface__ 的特征字典

所有的pandas DataFrame 方法也都可用,尽管它们可能不会在 geometry 列上以有意义的方式运行。所有在 GeoSeries 中列出的方法直接作用于GeoDataFrame的活跃几何列。