Return a GeoDataFrame corresponding to the result of the query string, which must contain a geometry column in WKB representation.
It is also possible to use read_file()
to read from a database. Especially for file geodatabases like GeoPackage or SpatiaLite this can be easier.
SQL query to execute in selecting entries from database, or name of the table to read from the database.
Active connection to the database to query.
column name to convert to shapely geometries
CRS to use for the returned GeoDataFrame; if not set, tries to determine CRS from the SRID associated with the first geometry in the database, and assigns that to all geometries.
If specified, return an iterator where chunksize is the number of rows to include in each chunk.
Examples
PostGIS
>>> from sqlalchemy import create_engine >>> db_connection_url = "postgresql://myusername:mypassword@myhost:5432/mydatabase" >>> con = create_engine(db_connection_url) >>> sql = "SELECT geom, highway FROM roads" >>> df = geopandas.read_postgis(sql, con)
SpatiaLite
>>> sql = "SELECT ST_AsBinary(geom) AS geom, highway FROM roads" >>> df = geopandas.read_postgis(sql, con)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4