1. 主页
  2. 文档
  3. GeoPandas 0.12.2中文文档
  4. API reference
  5. GeoDataFrame

GeoDataFrame

GeoDataFrame is a tabular data structure that contains a column which contains a GeoSeries storing geometry.

GeoDataFrame 是一种表格数据结构,其中包含一个包含 GeoSeries 存储几何的列。

Constructor

GeoDataFrame([data, geometry, crs])A GeoDataFrame object is a pandas.DataFrame that has a column with geometry.

Serialization / IO / conversion

GeoDataFrame.from_file(filename, **kwargs)Alternate constructor to create a GeoDataFrame from a file.
GeoDataFrame.from_features(features[, crs, …])Alternate constructor to create GeoDataFrame from an iterable of features or a feature collection.
GeoDataFrame.from_postgis(sql, con[, …])Alternate constructor to create a GeoDataFrame from a sql query containing a geometry column in WKB representation.
GeoDataFrame.to_file(filename[, driver, …])Write the GeoDataFrame to a file.
GeoDataFrame.to_json([na, show_bbox, drop_id])Returns a GeoJSON representation of the GeoDataFrame as a string.
GeoDataFrame.to_parquet(path[, index, …])Write a GeoDataFrame to the Parquet format.
GeoDataFrame.to_feather(path[, index, …])Write a GeoDataFrame to the Feather format.
GeoDataFrame.to_postgis(name, con[, schema, …])Upload GeoDataFrame into PostGIS database.
GeoDataFrame.to_wkb([hex])Encode all geometry columns in the GeoDataFrame to WKB.
GeoDataFrame.to_wkt(**kwargs)Encode all geometry columns in the GeoDataFrame to WKT.

Projection handling

GeoDataFrame.crsThe Coordinate Reference System (CRS) represented as a pyproj.CRS object.
GeoDataFrame.set_crs([crs, epsg, inplace, …])Set the Coordinate Reference System (CRS) of the GeoDataFrame.
GeoDataFrame.to_crs([crs, epsg, inplace])Transform geometries to a new coordinate reference system.
GeoDataFrame.estimate_utm_crs([datum_name])Returns the estimated UTM CRS based on the bounds of the dataset.

Active geometry handling

GeoDataFrame.rename_geometry(col[, inplace])Renames the GeoDataFrame geometry column to the specified name.
GeoDataFrame.set_geometry(col[, drop, …])Set the GeoDataFrame geometry using either an existing column or the specified input.

Aggregating and exploding

GeoDataFrame.dissolve([by, aggfunc, …])Dissolve geometries within groupby into single observation.
GeoDataFrame.explode([column, ignore_index, …])Explode multi-part geometries into multiple single geometries.

Spatial joins

GeoDataFrame.sjoin(df, *args, **kwargs)Spatial join of two GeoDataFrames.
GeoDataFrame.sjoin_nearest(right[, how, …])Spatial join of two GeoDataFrames based on the distance between their geometries.

Overlay operations

GeoDataFrame.clip(mask[, keep_geom_type])Clip points, lines, or polygon geometries to the mask extent.
GeoDataFrame.overlay(right[, how, …])Perform spatial overlay between GeoDataFrames.

Plotting

GeoDataFrame.explore(*args, **kwargs)Interactive map based on folium/leaflet.jsInteractive map based on GeoPandas and folium/leaflet.js
GeoDataFrame.plotalias of GeoplotAccessor

Spatial index

GeoDataFrame.sindexGenerate the spatial index
GeoDataFrame.has_sindexCheck the existence of the spatial index without generating it.

Indexing

GeoDataFrame.cxCoordinate based indexer to select by intersection with bounding box.

Interface

GeoDataFrame.__geo_interface__Returns a GeoDataFrame as a python feature collection.
GeoDataFrame.iterfeatures([na, show_bbox, …])Returns an iterator that yields feature dictionaries that comply with __geo_interface__

All pandas DataFrame methods are also available, although they may not operate in a meaningful way on the geometry column. All methods listed in GeoSeries work directly on an active geometry column of GeoDataFrame.

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

标签 , ,
这篇文章对您有用吗?

我们要如何帮助您?

欢迎留下您的宝贵建议

Please enter your comment!
Please enter your name here