Outils pour utilisateurs

Outils du site


bases_de_donnees:postgresql:postgis

Ceci est une ancienne révision du document !


PostGIS

Installation

Vérification de la version

SELECT version();
SELECT postgis_full_version();

Importation de données

KML to PostGIS

On trouve ogr2ogr dans /Library/Frameworks/GDAL.framework/Programs/.

Exemple d'utilisation :

$ ogr2ogr -f 'ESRI Shapefile' vm.shp vm.kml
$ ogr2ogr -overwrite -f "PostgreSQL" PG:"host=localhost user=myname dbname=vm password=pA$$\/\/0Rd" vm.shp

Autre exemple avec la spécification du schéma :

$ ogr2ogr -overwrite -f "PostgreSQL" PG:"host=localhost dbname=dbname user=myname password=secret" shapefile.shp -lco SCHEMA=public -lco EXTRACT_SCHEMA_FROM_LAYER_NAME=NO -lco OVERWRITE=YES -lco LAUNDER=NO

PostGIS Shapefile Import/Export Manager

Les shapefiles peuvent être importés dans PostGIS avec le Manager qui se trouve dans la suite logicielle OpenGeo. L'application se nomme pgShapeLoader.

Géométries

Point

SELECT st_point(1, 2) AS MyFirstPoint;
SELECT ST_GeomFromText('POINT(-77.036548 38.895108)', 4326);

Ligne

SELECT ST_GeomFromText('LINESTRING(-14 21,0 0,35 26)') AS MyCheckMark;

Polygone

bases_de_donnees/postgresql/postgis.1438386138.txt.gz · Dernière modification : 2022/02/02 00:43 (modification externe)