1. 主页
  2. 文档
  3. GeoPandas 0.12.2中文文档
  4. User Guide
  5. Reading and Writing Files
  6. Spatial databases

Spatial databases

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)
标签 , ,
这篇文章对您有用吗?

我们要如何帮助您?

欢迎留下您的宝贵建议

Please enter your comment!
Please enter your name here