geopandas.GeoSeries.__geo_interface__#

property GeoSeries.__geo_interface__#

返回一个 GeoSeries 作为一个PYTHON功能集合。

实现 geo_interface 。返回的python数据结构表示 GeoSeries 作为一个类似GeoJSON的 FeatureCollection 。请注意,要素将为空 properties Dict,因为它们没有关联的属性(仅几何体)。

示例

>>> 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)}