diff --git a/doc/source/programs/ogr2ogr.rst b/doc/source/programs/ogr2ogr.rst index 56a953be7c25..33fbeec56807 100644 --- a/doc/source/programs/ogr2ogr.rst +++ b/doc/source/programs/ogr2ogr.rst @@ -372,9 +372,7 @@ output coordinate system or even reprojecting the features during translation. Limit the number of features per layer. -.. option:: -oo = - - Input dataset open option (format specific). +.. include:: options/oo_vector.rst .. option:: -doo = @@ -496,7 +494,10 @@ output coordinate system or even reprojecting the features during translation. avoid typing a long SQL query. Note that this does not influence the field types used by the source driver, and is only an afterwards conversion. Also note that this option is without effects on fields whose presence and - type is hard-coded in the output driver (e.g KML, GPX) + type is hard-coded in the output driver (e.g KML, GPX). + For an alternative way to manipulate field types earlier in the process while they + are read from the input dataset see :option:`-oo` ``OGR_SCHEMA`` (only available + for a limited set of formats). .. option:: -mapFieldType {|All=[,=]...} @@ -511,7 +512,10 @@ output coordinate system or even reprojecting the features during translation. Note that this does not influence the field types used by the source driver, and is only an afterwards conversion. Also note that this option is without effects on fields whose presence and - type is hard-coded in the output driver (e.g KML, GPX) + type is hard-coded in the output driver (e.g KML, GPX). + For an alternative way to manipulate field types earlier in the process while they + are read from the input dataset see :option:`-oo` ``OGR_SCHEMA`` (only available + for a limited set of formats). .. option:: -dateTimeTo {UTC|UTC(+|-)|UTC(+|-):} diff --git a/doc/source/programs/ogrinfo.rst b/doc/source/programs/ogrinfo.rst index 3c526dcd5bd3..ff66c9ab15c0 100644 --- a/doc/source/programs/ogrinfo.rst +++ b/doc/source/programs/ogrinfo.rst @@ -168,9 +168,7 @@ edit data. value is ``YES``. (WKT and ``ISO_WKT`` are available starting with GDAL 2.1, which also changes the default to ISO_WKT) -.. option:: -oo = - - Dataset open option (format-specific) +.. include:: options/oo_vector.rst .. option:: -nomd diff --git a/doc/source/programs/options/oo_vector.rst b/doc/source/programs/options/oo_vector.rst new file mode 100644 index 000000000000..257fe95df5c1 --- /dev/null +++ b/doc/source/programs/options/oo_vector.rst @@ -0,0 +1,12 @@ +.. option:: -oo = + + Dataset open option (format specific). + + If a driver supports the ``OGR_SCHEMA`` open option, it can be used to + partially or completely override the auto-detected schema (i.e. which + fields are read, with which types, subtypes, length, precision etc.) + of the dataset. + + The value of this option is a JSON string or a path to a JSON file that + complies with the `OGR_SCHEMA open option schema definition `_ +