- Vous êtes ici: Accéder au Wiki GeoRezo » Accueil : Wiki GeoRezo » Les logiciels en géomatique » GDAL-OGR
Ceci est une ancienne révision du document !
Strict Standards: Declaration of syntax_plugin_tag_topic::handle() should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/html/web/wiki/lib/plugins/tag/syntax/topic.php on line 123
Strict Standards: Declaration of syntax_plugin_tag_topic::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/html/web/wiki/lib/plugins/tag/syntax/topic.php on line 123
Strict Standards: Declaration of syntax_plugin_tag_searchtags::handle() should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/html/web/wiki/lib/plugins/tag/syntax/searchtags.php on line 280
Strict Standards: Declaration of syntax_plugin_tag_searchtags::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/html/web/wiki/lib/plugins/tag/syntax/searchtags.php on line 280
Strict Standards: Declaration of syntax_plugin_tag_tag::handle() should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/html/web/wiki/lib/plugins/tag/syntax/tag.php on line 118
Strict Standards: Declaration of syntax_plugin_tag_tag::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/html/web/wiki/lib/plugins/tag/syntax/tag.php on line 118
Strict Standards: Declaration of syntax_plugin_tag_count::handle() should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/html/web/wiki/lib/plugins/tag/syntax/count.php on line 130
Strict Standards: Declaration of syntax_plugin_tag_count::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/html/web/wiki/lib/plugins/tag/syntax/count.php on line 130
Strict Standards: Declaration of syntax_plugin_tag_tagpage::handle() should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/html/web/wiki/lib/plugins/tag/syntax/tagpage.php on line 96
Strict Standards: Declaration of syntax_plugin_tag_tagpage::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/html/web/wiki/lib/plugins/tag/syntax/tagpage.php on line 96
Strict Standards: Declaration of syntax_plugin_clearfloat::handle() should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/html/web/wiki/lib/plugins/clearfloat/syntax.php on line 74
Strict Standards: Declaration of syntax_plugin_clearfloat::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/html/web/wiki/lib/plugins/clearfloat/syntax.php on line 74
Strict Standards: Declaration of syntax_plugin_pageindex::handle() should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/html/web/wiki/lib/plugins/pageindex/syntax.php on line 187
Strict Standards: Declaration of syntax_plugin_pageindex::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/html/web/wiki/lib/plugins/pageindex/syntax.php on line 187
Strict Standards: Declaration of syntax_plugin_googlemaps_googlemap::handle() should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/html/web/wiki/lib/plugins/googlemaps/syntax/googlemap.php on line 169
Strict Standards: Declaration of syntax_plugin_googlemaps_googlemap::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/html/web/wiki/lib/plugins/googlemaps/syntax/googlemap.php on line 169
Strict Standards: Declaration of syntax_plugin_nextpage::handle() should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/html/web/wiki/lib/plugins/nextpage/syntax.php on line 69
Strict Standards: Declaration of syntax_plugin_nextpage::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/html/web/wiki/lib/plugins/nextpage/syntax.php on line 69
Strict Standards: Declaration of syntax_plugin_include::handle() should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/html/web/wiki/lib/plugins/include/syntax.php on line 137
Strict Standards: Declaration of syntax_plugin_include::render() should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/html/web/wiki/lib/plugins/include/syntax.php on line 137
Table des matières
GDAL-OGR
La “Geospatial Data Abstraction Library” (GDAL/OGR) est une bibliothèque de traduction géospatiale raster/image multi-plateformes, développée en langage C++. Elle se présente à l'application mère comme un unique modèle de données, applicable à tous les formats supportés. GDAL/OGR inclut une variété d'utilitaires en ligne de commande pour la traduction et la manipulation de données géospatiales. GDAL supporte plus de 50 formats d'imagerie et OGR plus de 20 formats vectoriels. Des interfaces de programmation GDAL/OGR sont aussi disponibles pour Python, Java, C#, Ruby, VB6 et Perl.
Ressources
- Documentation en français : GDAL-OGR le couteau suisse du géomaticien
Comment faire pour ....
reprojeter un fichier
un shapefile en latlong (EPSG:4326) dans une projection Lambert 2 étendue (EPSG:27572) :
ogr2ogr -t_srs "EPSG:27572" -s_srs "EPSG:4326" fichier_27572.shp fichier_4326.shp
changer le fichier de format
un fichier au format shp vers un format kml
ogr2ogr -f "KML" fichier.kml fichier.shp
Merger plusieurs tuiles en un seul fichier
Le script python gdal_merge.py
permet de faire cela, plus d'information sur cette commande ici
Lire un fichier KML sous ubuntu
Ubuntu version 8.04LTS ou 8.10
Gdal supporte KML version 2.2 à partir de sa version 1.6. Cette version n'est pas packagée pour ubuntu et il est donc nécessaire de compiler gdal version 1.6.
Voici la méthode :
- installer libexpat1-dev (package des sources de libexpat) : cela permettra l'autodetection de cette librairie lors du ./configure. expat est un parset XML qui sera nécessaire pour la lecture d'un fichier KML.
- télécharger les sources des dépendances de gdal par : apt-get build-dep gdal.
- télécharger les sources gdal sur le site de gdal et les décompresser.
- dans le répertoire qui vient d'être créé : ./configure. A la fin de ce traitement, la fiche des formats qui seront supportés s'affiche.
- make
- puis en root make install suivi de ldconfig
ogr2ogr pourra lire du KML en entrée.
Exemple de conversion de KML en Shapefile :
ogr2ogr -f "ESRI Shapefile" fichier_sortie.shp fichier_entree.kml
Exemple de chargement d'un fichier KML dans une base de données postgres/postgis
ogr2ogr -f PostgreSQL PG:”host=serveur user=utilisateur password=mot_de_passe dbname=base” fichier_entree.kml