geopandas can also get data from a PostGIS database using the geopandas.read_postgis()
command.
geopandas 还可以使用 geopandas.read_postgis() 命令从 PostGIS 数据库获取数据。
Writing to PostGIS:
from sqlalchemy import create_engine
db_connection_url = "postgresql://myusername:mypassword@myhost:5432/mydatabase";
engine = create_engine(db_connection_url)
countries_gdf.to_postgis("countries_table", con=engine)