Adds additional postgis functionality to GeoPandas
Project description
GeoPandas-Postgis
Utilities oriented to using PostGIS features.
Install
pip install geopandas-postgis
Requirements
- GeoPandas
- GeoAlchemy2
- SQLAlchemy
- psycopg2
Usage
Currently, the postgis
accessor only features a to_postgis
method.
import geopandas as gpd
from sqlalchemy import create_engine
from geopandas_postgis import PostGIS
engine = create_engine("postgresql+psycopg2://postgres:postgres/localhost:test")
my_gdf = geopandas.read_file("my_shp.shp")
my_gdf.postgis.to_postgis(con=engine, table_name='test', geometry='Polygon')
The to_postgis
method will accept any keyword argument in the to_sql method in pandas
Testing
Postgres needs to be running on your local machine with a postgres user (that has write access.) This will be moved to Docker over time.
License
MIT License
Copyright (c) 2018 Aaron Burgess
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file geopandas-postgis-0.2.1.tar.gz
.
File metadata
- Download URL: geopandas-postgis-0.2.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b1ce429dcba29c3e1bacd72244fb80e0213ca26eb471d4e05935e0589f8989d |
|
MD5 | 06eb0bfe45973a910519e3ff62bc9868 |
|
BLAKE2b-256 | ef26b275cc14c26cbf5622cfc8a1f461ffd3db2cb44c8b23412615f1027ec963 |
File details
Details for the file geopandas_postgis-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: geopandas_postgis-0.2.1-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89085bb89bd488c4af3a0f0769049e9e612b95b7c43a967ce7cf03cc492713c0 |
|
MD5 | cea62f81302adece53a835596b63b49a |
|
BLAKE2b-256 | c5942056561e8c87705b1c191aeab0b66d6fb69b59456d36620e6a2f10da8a70 |