Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| main:logiciels:gdal:couteau_suisse:ogr_ogr2ogr [2010/12/30 13:45] – Yves | main:logiciels:gdal:couteau_suisse:ogr_ogr2ogr [2026/11/18 01:21] (Version actuelle) – supprimée - modification externe (Date inconnue) 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | [[start|sommaire]] | ||
| - | ---- | ||
| - | |||
| - | ====== ogr2ogr ====== | ||
| - | |||
| - | Convertit des données //simple features// entre divers formats de fichiers. | ||
| - | |||
| - | **Utilisation :** | ||
| - | ogr2ogr [--help-general] [-skipfailures] [-append] [-update] | ||
| - | [-select field_list] [-where restricted_where] | ||
| - | [-progress] [-sql <sql statement> | ||
| - | [-preserve_fid] [-fid FID] | ||
| - | [-spat xmin ymin xmax ymax] | ||
| - | [-a_srs srs_def] [-t_srs srs_def] [-s_srs srs_def] | ||
| - | [-f format_name] [-overwrite] [[-dsco NAME=VALUE] ...] | ||
| - | dst_datasource_name src_datasource_name | ||
| - | [-lco NAME=VALUE] [-nln name] [-nlt type] [layer [layer ...]] | ||
| - | |||
| - | Options avancées : | ||
| - | [-gt n] | ||
| - | [-clipsrc [xmin ymin xmax ymax]|WKT|datasource|spat_extent] | ||
| - | [-clipsrcsql sql_statement] [-clipsrclayer layer] | ||
| - | [-clipsrcwhere expression] | ||
| - | [-clipdst [xmin ymin xmax ymax]|WKT|datasource] | ||
| - | [-clipdstsql sql_statement] [-clipdstlayer layer] | ||
| - | [-clipdstwhere expression] | ||
| - | [-wrapdateline] | ||
| - | [-segmentize max_dist] [-fieldTypeToString All|(type1[, | ||
| - | [-splitlistfields] [-maxsubfields val] | ||
| - | [-explodecollections] | ||
| - | |||
| - | |||
| - | Ce programme peut être utilisé pour convertir des données //simple features// dans des formats de fichiers tout en réalisant des opérations diverses pendant le processus comme des sélections spatiales ou attributaires, | ||
| - | |||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | * '' | ||
| - | * **'' | ||
| - | * **'' | ||
| - | * **'' | ||
| - | * **'' | ||
| - | * **-progress :** (à partie de GDAL 1.7.0) affiche un barre de progression dans la console. Fonctionne seulement si les couches en entrée possèdent la capacité "// | ||
| - | * **'' | ||
| - | * **-dialect //dialect// :** dialecte SQL. In some cases can be used to use (unoptimized) OGR SQL instead of the native SQL of an RDBMS by passing OGRSQL. | ||
| - | * **'' | ||
| - | * **'' | ||
| - | * **'' | ||
| - | * **'' | ||
| - | * **'' | ||
| - | * **'' | ||
| - | * **'' | ||
| - | * **'' | ||
| - | * **'' | ||
| - | * **'' | ||
| - | * **'' | ||
| - | |||
| - | '' | ||
| - | |||
| - | Options avancées : | ||
| - | |||
| - | * **-gt n :**regroupe n objets par transaction (200 par défaut). | ||
| - | * **-clipsrc [xmin ymin xmax ymax]|WKT|datasource|spat_extent: | ||
| - | (starting with GDAL 1.7.0) clip geometries to the specified bounding box (expressed in source SRS), WKT geometry (POLYGON or MULTIPOLYGON), | ||
| - | * **-clipsrcsql sql_statement: | ||
| - | Select desired geometries using an SQL query instead. | ||
| - | * **-clipsrclayer layername: | ||
| - | Select the named layer from the source clip datasource. | ||
| - | * **-clipsrcwhere expression: | ||
| - | Restrict desired geometries based on attribute query. | ||
| - | * **-clipdst xmin ymin xmax ymax: | ||
| - | (starting with GDAL 1.7.0) clip geometries after reprojection to the specified bounding box (expressed in dest SRS), WKT geometry (POLYGON or MULTIPOLYGON) or from a datasource. When specifying a datasource, you will generally want to use it in combination of the -clipdstlayer, | ||
| - | * **-clipdstsql sql_statement: | ||
| - | Select desired geometries using an SQL query instead. | ||
| - | * **-clipdstlayer layername: | ||
| - | Select the named layer from the destination clip datasource. | ||
| - | * **-clipdstwhere expression: | ||
| - | Restrict desired geometries based on attribute query. | ||
| - | * **-wrapdateline: | ||
| - | (starting with GDAL 1.7.0) split geometries crossing the dateline meridian (long. = +/- 180deg) | ||
| - | * **-segmentize max_dist: | ||
| - | (starting with GDAL 1.6.0) maximum distance between 2 nodes. Used to create intermediate pointsspatial query extents | ||
| - | * **-fieldTypeToString type1, ...: | ||
| - | (starting with GDAL 1.7.0) converts any field of the specified type to a field of type string in the destination layer. Valid types are : Integer, Real, String, Date, Time, DateTime, Binary, IntegerList, | ||
| - | * **-splitlistfields: | ||
| - | (starting with GDAL 1.8.0) split fields of type StringList, RealList or IntegerList into as many fields of type String, Real or Integer as necessary. | ||
| - | * **-maxsubfields val: | ||
| - | To be combined with -splitlistfields to limit the number of subfields created for each split field. | ||
| - | * **-explodecollections: | ||
| - | (starting with GDAL 1.8.0) produce one feature for each geometry in any kind of geometry collection in the source file | ||
| - | |||
| - | ===== Exemples ===== | ||
| - | |||
| - | Exemple ajoutant une couche existante (les deux options nécessites d' | ||
| - | |||
| - | % ogr2ogr -update -append -f PostgreSQL PG: | ||
| - | |||
| - | Example reprojetant les données à partir de ETRS_1989_LAEA_52N_10E vers EPSG:4326 et découpant les features par une bounding box : | ||
| - | |||
| - | % ogr2ogr -wrapdateline -t_srs EPSG:4326 -clipdst -5 40 15 55 france_4326.shp europe_laea.shp | ||
| - | |||
| - | Des exemples supplémentaires sont données dans les pages des formats. | ||
| - | ---- | ||
| - | --- // | ||

