shapefile to sql converter.
Project description
shp2posgis
Módulo python para converter arquivos no padrão shapefile da esri para arquivos sql que podem ser importados em bancos de dados postgresql/postgis.
Python module to convert esri shapefile format to sql files that can be imported into postgresql/postgis database.
Uso / Usage
primeiro é necessário instalar as dependências
First install dependencies
pip3 install -r requirements.txt
python3 na linha de comando / on command line
Uso detalhado pode ser visto usando:
Details about use are shown using:
python3 -m shp2postgis -h
ou / or
python3 -m shp2postgis --help
Para usar como biblioteca / as a library
from shp2postgis.Shp2Postgis import Shp2Postgis
process = Shps2Postgis(dictInput, outputPath, schema, encoding, verbose, columnsToLower)
process.run()
Parâmetros / parameters
-
dictInput:
dicionário python em que cada item tem chave sendo o nome da camada e valor sendo o caminho para o arquivo shapefile
python dictionary in which each item has a key being the layer name and value being the path to the shapefile
</code></pre> </blockquote> <p>dictInput = { "airport": "/home/user/SHP/AIRPORT", }</p> <pre><code> * >outputPath: >>diretório onde será gravado o arquivo sql. > >>folder where the sql file will be saved. > >```python outputPath = "/home/user/SQL/"
schema:
schema do banco de dados em que o sql será carregado.
database schema where sql file will be loaded.
</code></pre> </blockquote> <p>schema = "public"</p> <pre><code> * >encoding: >>conjunto de caracteres do shapefile. > >>charset of the shapefile. > >```python encoding = "latin1"
verbose:
deixe com valor False.
leave False.
</code></pre> </blockquote> <p>verbose = False</p> <pre><code> * >columnsToLower: >>Faz com que os nomes das colunas fiquem em letra minúscula. > >>It makes the name of each column to be lower case. > >```python columnsToLower = True
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for shp2postgis-0.2.7.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28114e2339e3be16cb0e4f1cfbeb40a54d9882df46c1cd26dfa12c0604d4fac8 |
|
MD5 | 834d42b0652a5b25f4c5c59928bfeca0 |
|
BLAKE2b-256 | 625029d4e12a007761ee11d06302833e5c1f28d801054e5eec7f0e084ef902a9 |