geopandas.points_from_xy

geopandas.points_from_xy(x, y, z=None, crs=None)

Generate GeometryArray of shapely Point geometries from x, y(, z) coordinates.

Parameters
x, y, ziterable
crsvalue, optional

Coordinate Reference System of the geometry objects. Can be anything accepted by pyproj.CRS.from_user_input(), such as an authority string (eg “EPSG:4326”) or a WKT string.

Returns
outputGeometryArray

Examples

>>> geometry = geopandas.points_from_xy(x=[1, 0], y=[0, 1])
>>> geometry = geopandas.points_from_xy(df['x'], df['y'], df['z'])
>>> gdf = geopandas.GeoDataFrame(
        df, geometry=geopandas.points_from_xy(df['x'], df['y']))

Examples using geopandas.points_from_xy