geopandas.GeoSeries.__geo_interface__#
- property GeoSeries.__geo_interface__[来源]#
返回一个
GeoSeries作为 python 特征集合。实现 geo_interface。返回的 python 数据结构表示
GeoSeries为类似 GeoJSON 的FeatureCollection。请注意,这些特征将具有一个空的properties字典,因为它们没有关联的属性(仅几何)。示例
>>> from shapely.geometry import Point >>> s = geopandas.GeoSeries([Point(1, 1), Point(2, 2), Point(3, 3)]) >>> s.__geo_interface__ {'type': 'FeatureCollection', 'features': [{'id': '0', 'type': 'Feature', 'properties': {}, 'geometry': {'type': 'Point', 'coordinates': (1.0, 1.0)}, 'bbox': (1.0, 1.0, 1.0, 1.0)}, {'id': '1', 'type': 'Feature', 'properties': {}, 'geometry': {'type': 'Point', 'coordinates': (2.0, 2.0)}, 'bbox': (2.0, 2.0, 2.0, 2.0)}, {'id': '2', 'type': 'Feature', 'properties': {}, 'geometry': {'type': 'Point', 'coordinates': (3.0, 3.0)}, 'bbox': (3.0, 3.0, 3.0, 3.0)}], 'bbox': (1.0, 1.0, 3.0, 3.0)}