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

GeoSeries

Constructor

GeoSeries([data, index, crs])A Series object designed to store shapely geometry objects.
构造函数,用于创建Series几何对象

General methods and attributes

GeoSeries.areaReturns a Series containing the area of each geometry in the GeoSeries expressed in the units of the CRS.
计算GeoSeries 中每个几何图形的面积
GeoSeries.boundaryReturns a GeoSeries of lower dimensional objects representing each geometry’s set-theoretic boundary.
计算每个几何图形的边界。
GeoSeries.boundsReturns a DataFrame with columns minxminymaxxmaxy values containing the bounds for each geometry.
返回一个 DataFrame,其列 minx、miny、maxx、maxy 值为每个几何的边界。
GeoSeries.total_boundsReturns a tuple containing minxminymaxxmaxy values for the bounds of the series as a whole.
返回一个元组,其中包含整个系列边界的 minx、miny、maxx、maxy 值。
GeoSeries.lengthReturns a Series containing the length of each geometry expressed in the units of the CRS.
计算每个几何对象的长度值。
GeoSeries.geom_typeReturns a Series of strings specifying the Geometry Type of each object.
返回每个对象的几何类型。
GeoSeries.distance(other[, align])Returns a Series containing the distance to aligned other.
计算几何对象间的距离值。
GeoSeries.representative_point()Returns a GeoSeries of (cheaply computed) points that are guaranteed to be within each geometry.
返回一个由(廉价计算的)点组成的GeoSeries,这些点保证在每个几何体中。
GeoSeries.exteriorReturns a GeoSeries of LinearRings representing the outer boundary of each polygon in the GeoSeries.
返回表示 GeoSeries 中每个多边形外边界的 LinearRings 的 GeoSeries。
GeoSeries.interiorsReturns a Series of List representing the inner rings of each polygon in the GeoSeries.
返回一个代表GeoSeries中每个多边形的内环的List系列。
GeoSeries.xReturn the x location of point geometries in a GeoSeries
几何的 x 值。
GeoSeries.yReturn the y location of point geometries in a GeoSeries
几何的 y 值。
GeoSeries.zReturn the z location of point geometries in a GeoSeries
几何的 z 值。

Unary predicates(一元谓词)

GeoSeries.is_emptyReturns a Series of dtype('bool') with value True for empty geometries.
对于空几何,返回值为 True
GeoSeries.is_ringReturns a Series of dtype('bool') with value True for features that are closed.
几何对象是否闭合
GeoSeries.is_simpleReturns a Series of dtype('bool') with value True for geometries that do not cross themselves.
对于不交叉的几何图形,返回值为 True 
GeoSeries.is_validReturns a Series of dtype('bool') with value True for geometries that are valid.
对于有效的几何返回值为 True
GeoSeries.has_zReturns a Series of dtype('bool') with value True for features that have a z-component.
对于具有 z 值的要素,返回值为 True 

Binary Predicates(二元谓词)

GeoSeries.contains(other[, align])Returns a Series of dtype('bool') with value True for each aligned geometry that contains other.
GeoSeries.crosses(other[, align])Returns a Series of dtype('bool') with value True for each aligned geometry that cross other.
GeoSeries.disjoint(other[, align])Returns a Series of dtype('bool') with value True for each aligned geometry disjoint to other.
GeoSeries.geom_equals(other[, align])Returns a Series of dtype('bool') with value True for each aligned geometry equal to other.
GeoSeries.geom_almost_equals(other[, …])Returns a Series of dtype('bool') with value True if each aligned geometry is approximately equal to other.
GeoSeries.geom_equals_exact(other, tolerance)Return True for all geometries that equal aligned other to a given tolerance, else False.
GeoSeries.intersects(other[, align])Returns a Series of dtype('bool') with value True for each aligned geometry that intersects other.
GeoSeries.overlaps(other[, align])Returns True for all aligned geometries that overlap other, else False.
GeoSeries.touches(other[, align])Returns a Series of dtype('bool') with value True for each aligned geometry that touches other.
GeoSeries.within(other[, align])Returns a Series of dtype('bool') with value True for each aligned geometry that is within other.
GeoSeries.covers(other[, align])Returns a Series of dtype('bool') with value True for each aligned geometry that is entirely covering other.
GeoSeries.covered_by(other[, align])Returns a Series of dtype('bool') with value True for each aligned geometry that is entirely covered by other.

Set-theoretic Methods(集合方法)

GeoSeries.clip_by_rect(xmin, ymin, xmax, ymax)Returns a GeoSeries of the portions of geometry within the given rectangle.
GeoSeries.difference(other[, align])Returns a GeoSeries of the points in each aligned geometry that are not in other.
GeoSeries.intersection(other[, align])Returns a GeoSeries of the intersection of points in each aligned geometry with other.
GeoSeries.symmetric_difference(other[, align])Returns a GeoSeries of the symmetric difference of points in each aligned geometry with other.
GeoSeries.union(other[, align])Returns a GeoSeries of the union of points in each aligned geometry with other.

Constructive Methods and Attributes(构造方法和属性)

GeoSeries.buffer(distance[, resolution])Returns a GeoSeries of geometries representing all points within a given distance of each geometric object.
GeoSeries.boundaryReturns a GeoSeries of lower dimensional objects representing each geometry’s set-theoretic boundary.
GeoSeries.centroidReturns a GeoSeries of points representing the centroid of each geometry.
GeoSeries.convex_hullReturns a GeoSeries of geometries representing the convex hull of each geometry.
GeoSeries.envelopeReturns a GeoSeries of geometries representing the envelope of each geometry.
GeoSeries.simplify(*args, **kwargs)Returns a GeoSeries containing a simplified representation of each geometry.
GeoSeries.normalize()Returns a GeoSeries of normalized geometries to normal form (or canonical form).

Affine transformations(仿射变换)

GeoSeries.affine_transform(matrix)Return a GeoSeries with translated geometries.
GeoSeries.rotate(angle[, origin, use_radians])Returns a GeoSeries with rotated geometries.
GeoSeries.scale([xfact, yfact, zfact, origin])Returns a GeoSeries with scaled geometries.
GeoSeries.skew([xs, ys, origin, use_radians])Returns a GeoSeries with skewed geometries.
GeoSeries.translate([xoff, yoff, zoff])Returns a GeoSeries with translated geometries.

Aggregating and exploding

GeoSeries.unary_unionReturns a geometry containing the union of all geometries in the GeoSeries.
GeoSeries.explode([ignore_index, index_parts])Explode multi-part geometries into multiple single geometries.

Serialization / IO / conversion

GeoSeries.from_file(filename, **kwargs)Alternate constructor to create a GeoSeries from a file.
GeoSeries.from_wkb(data[, index, crs])Alternate constructor to create a GeoSeries from a list or array of WKB objects
GeoSeries.from_wkt(data[, index, crs])Alternate constructor to create a GeoSeries from a list or array of WKT objects
GeoSeries.from_xy(x, y[, z, index, crs])Alternate constructor to create a GeoSeries of Point geometries from lists or arrays of x, y(, z) coordinates
GeoSeries.to_file(filename[, driver, index])Write the GeoSeries to a file.
GeoSeries.to_json(**kwargs)Returns a GeoJSON string representation of the GeoSeries.
GeoSeries.to_wkb([hex])Convert GeoSeries geometries to WKB
GeoSeries.to_wkt(**kwargs)Convert GeoSeries geometries to WKT

Projection handling

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

Missing values

GeoSeries.fillna([value, method, inplace])Fill NA values with a geometry (empty polygon by default).
GeoSeries.isna()Detect missing values.
GeoSeries.notna()Detect non-missing values.

Overlay operations

GeoSeries.clip(mask[, keep_geom_type])Clip points, lines, or polygon geometries to the mask extent.

Plotting

GeoSeries.plot(*args, **kwargs)Plot a GeoSeries.
GeoSeries.explore(*args, **kwargs)Interactive map based on folium/leaflet.jsInteractive map based on GeoPandas and folium/leaflet.js

Spatial index

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

Indexing

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

Interface

GeoSeries.__geo_interface__Returns a GeoSeries as a python feature collection.

Methods of pandas Series objects are also available, although not all are applicable to geometric objects and some may return a Series rather than a GeoSeries result when appropriate. The methods isna() and fillna() have been implemented specifically for GeoSeries and are expected to work correctly.

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

我们要如何帮助您?

欢迎留下您的宝贵建议

Please enter your comment!
Please enter your name here