aboutsummaryrefslogtreecommitdiff
path: root/docs/source
diff options
context:
space:
mode:
Diffstat (limited to 'docs/source')
-rw-r--r--docs/source/apps/cct.rst11
-rw-r--r--docs/source/apps/cs2cs.rst10
-rw-r--r--docs/source/apps/projinfo.rst10
-rw-r--r--docs/source/community/rfc/rfc-4.rst608
-rw-r--r--docs/source/conf.py2
-rw-r--r--docs/source/development/reference/cpp/common.rst2
-rw-r--r--docs/source/development/reference/cpp/cpp_general.rst2
-rw-r--r--docs/source/development/reference/cpp/crs.rst2
-rw-r--r--docs/source/development/reference/cpp/cs.rst2
-rw-r--r--docs/source/development/reference/cpp/datum.rst2
-rw-r--r--docs/source/development/reference/cpp/io.rst2
-rw-r--r--docs/source/development/reference/cpp/metadata.rst2
-rw-r--r--docs/source/development/reference/cpp/operation.rst2
-rw-r--r--docs/source/development/reference/cpp/util.rst2
-rw-r--r--docs/source/development/reference/datatypes.rst39
-rw-r--r--docs/source/development/reference/functions.rst50
-rw-r--r--docs/source/index.rst1
-rw-r--r--docs/source/operations/transformations/deformation.rst39
-rw-r--r--docs/source/operations/transformations/index.rst1
-rw-r--r--docs/source/operations/transformations/xyzgridshift.rst91
-rw-r--r--docs/source/references.bib9
-rw-r--r--docs/source/resource_files.rst54
-rw-r--r--docs/source/specifications/geodetictiffgrids.rst626
-rw-r--r--docs/source/specifications/index.rst14
-rw-r--r--docs/source/specifications/projjson.rst (renamed from docs/source/usage/projjson.rst)0
-rw-r--r--docs/source/usage/differences.rst6
-rw-r--r--docs/source/usage/environmentvars.rst18
-rw-r--r--docs/source/usage/index.rst3
-rw-r--r--docs/source/usage/network.rst102
29 files changed, 1088 insertions, 624 deletions
diff --git a/docs/source/apps/cct.rst b/docs/source/apps/cct.rst
index a4cc690c..96b5f13b 100644
--- a/docs/source/apps/cct.rst
+++ b/docs/source/apps/cct.rst
@@ -91,6 +91,17 @@ cartesian coordinates) and
*Coordinate Transformations*, which are coordinate operations where
input and output datums differ (e.g. change of reference frame).
+Use of remote grids
+*******************
+
+.. versionadded:: 7.0.0
+
+If the :envvar:`PROJ_NETWORK` environment variable is set to ``ON``,
+:program:`cct` will attempt to use remote grids stored on CDN (Content
+Delivery Network) storage, when they are not available locally.
+
+More details are available in the :ref:`network` section.
+
Examples
********
diff --git a/docs/source/apps/cs2cs.rst b/docs/source/apps/cs2cs.rst
index 12f91e64..c95bbaed 100644
--- a/docs/source/apps/cs2cs.rst
+++ b/docs/source/apps/cs2cs.rst
@@ -171,6 +171,16 @@ normally be in DMS format (use ``-f %.12f`` for decimal degrees with 12 decimal
places), while projected (cartesian) coordinates will be in linear
(meter, feet) units.
+Use of remote grids
+-------------------
+
+.. versionadded:: 7.0.0
+
+If the :envvar:`PROJ_NETWORK` environment variable is set to ``ON``,
+:program:`cs2cs` will attempt to use remote grids stored on CDN (Content
+Delivery Network) storage, when they are not available locally.
+
+More details are available in the :ref:`network` section.
Examples
********
diff --git a/docs/source/apps/projinfo.rst b/docs/source/apps/projinfo.rst
index d1889844..47deaaeb 100644
--- a/docs/source/apps/projinfo.rst
+++ b/docs/source/apps/projinfo.rst
@@ -20,7 +20,7 @@ Synopsis
| [[--area name_or_code] | [--bbox west_long,south_lat,east_long,north_lat]]
| [--spatial-test contains|intersects]
| [--crs-extent-use none|both|intersection|smallest]
- | [--grid-check none|discard_missing|sort] [--show-superseded]
+ | [--grid-check none|discard_missing|sort|known_available] [--show-superseded]
| [--pivot-crs always|if_no_direct_transformation|never|{auth:code[,auth:code]*}]
| [--boundcrs-to-wgs84]
| [--main-db-path path] [--aux-db-path path]*
@@ -151,12 +151,13 @@ The following control parameters can appear in any order:
.. note:: only used for coordinate operation computation
-.. option:: --grid-check none|discard_missing|sort
+.. option:: --grid-check none|discard_missing|sort|known_available
Specify how the presence or absence of a horizontal or vertical shift grid
required for a coordinate operation affects the results returned when
researching coordinate operations between 2 CRS.
- The default strategy is ``sort``: in that case, all candidate
+ The default strategy is ``sort`` (if :envvar:`PROJ_NETWORK` is not defined).
+ In that case, all candidate
operations are returned, but the actual availability of the grids is used
to determine the sorting order. That is, if a coordinate operation involves
using a grid that is not available in the PROJ resource directories
@@ -166,6 +167,9 @@ The following control parameters can appear in any order:
this returns the results as if all the grids where available.
The ``discard_missing`` strategy discards results that involve grids not
present in the PROJ resource directories.
+ The ``known_available`` strategy discards results that involve grids not
+ present in the PROJ resource directories and that are not known of the CDN.
+ This is the default strategy is :envvar:`PROJ_NETWORK` is set to ``ON``.
.. note:: only used for coordinate operation computation
diff --git a/docs/source/community/rfc/rfc-4.rst b/docs/source/community/rfc/rfc-4.rst
index 6cd9a82f..5019a5f6 100644
--- a/docs/source/community/rfc/rfc-4.rst
+++ b/docs/source/community/rfc/rfc-4.rst
@@ -695,613 +695,11 @@ choice.
.. _description_geotiff_format:
-Description of the PROJ GeoTIFF format
-++++++++++++++++++++++++++++++++++++++
-
-The general principles that guide the following requirements and recommendations
-are such that files will be properly recognized by PROJ, and also by GDAL which
-is an easy way to inspect such grid files:
-
-- `TIFF 6.0 <https://www.awaresystems.be/imaging/tiff/specification/TIFF6.pdf>`_
- based (could possibly be BigTIFF without code changes, if we ever
- need some day to handle grids larger than 4GB)
-
-- `GeoTIFF 1.1 <http://docs.opengeospatial.org/is/19-008r4/19-008r4.html>`_ for the georeferencing.
- GeoTIFF 1.1 is a recent standard, compared to the original GeoTIFF 1.0 version,
- but its backward compatibility is excellent, so that should not cause much trouble
- to readers that are not official GeoTIFF 1.1 compliant.
-
-- Files hosted on the CDN will use a Geographic 2D CRS for the GeoTIFF GeoKeys.
- That CRS is intended to be the interpolation CRS as defined in
- `OGC Abstract Specification Topic 2 <http://docs.opengeospatial.org/as/18-005r4/18-005r4.html>`_,
- that is the CRS to which grid values are refered to.
-
- Given that they will nominally be related to the EPSG dataset, the `GeodeticCRSGeoKey
- <http://docs.opengeospatial.org/is/19-008r4/19-008r4.html#_requirements_class_geodeticcrsgeokey>`_
- will be used to store the EPSG code of the CRS. If the CRS cannot be reliably
- encoded through that key or other geokeys, the ``interpolation_crs_wkt`` metadata
- item detailed afterwards should be used.
-
- This CRS will be generally the source CRS (for geographic to
- geographic horizontal shift grids, or geographic to vertical shift grids), but
- for vertical to vertical CRS adjustment, this will be the geographic CRS to
- which the grid is referenced. In some very rare cases of geographic to vertical
- shift grids, the interpolation CRS might be a geographic CRS that is not the
- same as the source CRS (into which ellipsoidal height are expressed). The only
- instance we have in mind is for the EPSG:7001 "ETRS89 to NAP height (1)" transformation
- using the naptrans2008 VDatum-grid which is referenced to Amersfoort EPSG:4289
- instead of ETRS89...
-
- On the reading side, PROJ will ignore that information:
- the CRS is already stored in the source_crs or interpolation_crs column of the
- grid_transformation table.
-
- For geographic to vertical shift files (geoid models), the GeoTIFF 1.1
- convention will be used to store the value of the `VerticalGeoKey
- <http://docs.opengeospatial.org/is/19-008r4/19-008r4.html#_requirements_class_verticalgeokey>`_
- So a geoid model that apply to WGS 84 EPSG:4979 will have GeodeticCRSGeoKey = 4326
- and VerticalGeoKey = 4979.
-
-- Files hosted on the CDN will use the GeoTIFF defined `ModelTiepointTag and ModelPixelScaleTag
- <http://docs.opengeospatial.org/is/19-008r4/19-008r4.html#_raster_to_model_coordinate_transformation_requirements>`_ TIFF tags
- to store the coordinates of the upper-left pixel and the resolution of the pixels.
- On the reading side, they will be required and ModelTransformationTag will be ignored.
-
- .. note::
-
- Regarding anti-meridian handling, a variety of possibilities exist.
- We do not attempt to standardize this and filesh hosted on the CDN will use
- a georeferencing close to the original data producer.
- For example, NOAA vertical grids that apply to Conterminous USA might even have a top-left
- longitude beyond 180 (for consistency with Alaska grids, whose origin is < 180)
- Anti-meridian handling in PROJ has probably issues. This RFC does not attempt
- to address them in particular, as they are believed to be orthogonal to the
- topics it covers, and being mostly implementation issues.
-
-- Files hosted on the CDN will use the `GTRasterTypeGeoKey
- <http://docs.opengeospatial.org/is/19-008r4/19-008r4.html#_requirements_class_gtrastertypegeokey>`_
- = PixelIsPoint convention.
- This is the convention used by most existing grid formats currently. Note that GDAL
- typically use a PixelIsArea convention (but can handle both conventions), so the
- georeferencing it displays when opening a .gsb or .gtx file appears to have a
- half-pixel shift regarding to the coordinates stored in the original grid file. On
- the reading side, PROJ will accept both conventions (for equivalent georeferencing,
- the value of the origin in a PixelIsArea convention is shifted by a half-pixel
- towards the upper-left direction). Unspecified behaviour if this GeoKey is absent.
-
-- Files hosted on the CDN will be tiled, presumably with 256x256 tiles (small
- grids that are smaller than 256x256 will use a single strip). On the reading
- side, PROJ will accept TIFF files with any strip or tile organization.
- Tiling is expressed by specifying the TileWidth, TileHeight, TileOffsets
- and TileByteCounts tags. Strip organization is expressed by specifying the
- RowsPerStrip, StripByteCounts and StripOffsets tags.
-
-- Files hosted on the CDN will use `Compression
- <https://www.awaresystems.be/imaging/tiff/tifftags/compression.html>`_ = DEFLATE
- or LZW (to be determined, possibly with
- `Predictor <https://www.awaresystems.be/imaging/tiff/tifftags/predictor.html>`_ = 2
- or 3)
- On the reading side, PROJ will accept TIFF files with any compression method
- (appropriate for the data types and PhotometricInterpretation considered)
- supported by the libtiff build used by PROJ. Of course uncompressed files will be supported.
-
-- Files hosted on the CDN will use little-endian byte ordering. On the reading
- side, libtiff will transparently handle both little-endian and big-endian
- ordering.
-
-- Files hosted on the CDN will use PlanarConfiguration=Separate.
- The tools described in a later section will order blocks so that blocks needed
- for a given location are close to each other.
- On the reading side, PROJ will handle also PlanarConfiguration=Contig.
-
-- Files hosted on the CDN will generally use Float32 (BitsPerSample=32 and SampleFormat=IEEEFP)
- Files may be created using Signed Int 16 (
- `BitsPerSample <https://www.awaresystems.be/imaging/tiff/tifftags/bitspersample.html>`_ =16 and
- `SampleFormat <https://www.awaresystems.be/imaging/tiff/tifftags/sampleformat.html>`_ = INT),
- Unsigned Int 16 (BitsPerSample=16 and SampleFormat=UINT), Signed Int 32 or Unsigned Int 32 generally with an
- associate scale/offset.
- On the reading side, only those three data types will be supported as well.
-
-- Files hosted on the CDN will have a `PhotometricInterpretation
- <https://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html>`_ = MinIsBlack.
- It will be assumed, and ignored on the reading side.
-
-- Files hosted on the CDN will nominally have:
-
- * `SamplesPerPixel <https://www.awaresystems.be/imaging/tiff/tifftags/samplesperpixel.html>`_ = 2
- for horizontal shift grid, with the first sample being the longitude offset
- and the second sample being the latitude offset.
-
- * SamplesPerPixel = 1 for vertical shift grids.
-
- In the future, different values of SamplesPerPixel may be used to accomodate
- for other needs. For example for deformation models, SamplesPerPixel = 3 to combine
- horizontal and vertical adjustments.
- And even for the current identified needs of horizontal or vertical shifts,
- more samples may be present (to indicate for example uncertainties), but
- will be ignored by PROJ.
-
- The `ExtraSamples <https://www.awaresystems.be/imaging/tiff/tifftags/extrasamples.html>`_
- tag should be set to a value of SamplesPerPixel - 1 (given the rules that
- apply for PhotometricInterpretation = MinIsBlack)
-
-- The `ImageDescription <https://www.awaresystems.be/imaging/tiff/tifftags/imagedescription.html>`_
- tag may be used to convey extra information about the name, provenance, version
- and last updated date of the grid.
- Will be set when possible fo files hosted on the CDN.
- Ignored by PROJ.
-
-- The `Copyright <https://www.awaresystems.be/imaging/tiff/tifftags/copyright.html>`_
- tag may be used to convey extra information about the copyright and license of the grid.
- Will be set when possible fo files hosted on the CDN.
- Ignored by PROJ.
-
-- The `DateTime <https://www.awaresystems.be/imaging/tiff/tifftags/datetime.html>`_
- tag may be used to convey the date at which the file has been created or
- converted. In case of a file conversion, for example from NTv2, this will be
- the date at which the conversion has been performed. The ``ImageDescription``
- tag however will contain the latest of the CREATED or UPDATED fields from the NTv2 file.
- Will be set when possible fo files hosted on the CDN.
- Ignored by PROJ.
-
-- Files hosted on the CDN will use the `GDAL_NODATA
- <https://www.awaresystems.be/imaging/tiff/tifftags/gdal_nodata.html>`_ tag to encode
- the value of the nodata / missing value, when it applies to the grid.
-
- If offset and/or scaling is used, the nodata value corresponds to the raw value,
- before applying offset and scaling.
- The value found in this tag, if present, will be honoured (to the extent to
- which current PROJ code makes use of nodata).
- For floating point data, writers are strongly discouraged to use non-finite values
- (+/- infinity, NaN) of nodata to maximimize interoperability.
- The GDAL_NODATA value applies to all samples of a given TIFF IFD.
-
-- Files hosted on the CDN will use the `GDAL_METADATA
- <https://www.awaresystems.be/imaging/tiff/tifftags/gdal_metadata.html>`_ tag to encode extra
- metadata not supported by baseline or extended TIFF.
-
- * The root XML node should be ``GDALMetadata``
-
- * Zero, one or several child XML nodes ``Item`` may be present.
-
- * A Item should have a ``name`` attribute, and a child text node with its value.
- ``role`` and ``sample`` attributes may be present for attributes that have
- a special semantics (recognized by GDAL). The value of `sample` should be
- a integer value between 0 and number_of_samples - 1.
-
- * Scale and offset to convert integer raw values to floating point values
- may be expressed with XML `Item` elements whose name attribute is respectively
- ``SCALE`` and ``OFFSET``, and their ``role`` attribute is respectively ``scale``
- and ``offset``. The decoded value will be: {offset} + {scale} * raw_value_from_geotiff_file
-
- For a offset value of 1 and scaling of 2, the following payload should be
- stored:
-
- .. code-block:: xml
-
- <GDALMetadata>
- <Item name="OFFSET" sample="0" role="offset">1</Item>
- <Item name="SCALE" sample="0" role="scale">2</Item>
- </GDALMetadata>
-
- * The type of the grid must be specified with a `Item` whose ``name`` is set
- to ``TYPE``.
-
- Values recognized by PROJ currently are:
-
- - ``HORIZONTAL_OFFSET``: implies the presence of at least two samples.
- The first sample must contain the latitude offset and the second
- sample must contain the longitude offset.
- Corresponds to PROJ ``hgridshift`` method.
-
- - ``VERTICAL_OFFSET_GEOGRAPHIC_TO_VERTICAL``: implies the presence of at least one sample.
- The first sample must contain the vertical adjustment. Must be used when
- the source/interpolation CRS is a Geographic CRS and the target CRS a Vertical CRS.
- Corresponds to PROJ ``vgridshift`` method.
-
- - ``VERTICAL_OFFSET_VERTICAL_TO_VERTICAL``: implies the presence of at least one sample.
- The first sample must contain the vertical adjustment. Must be used when
- the source and target CRS are Vertical CRS.
- Corresponds to PROJ ``vgridshift`` method.
-
- - ``GEOCENTRIC_TRANSLATION``: implies the presence of at least 3 samples.
- The first 3 samples must be respectively the geocentric adjustments along
- the X, Y and Z axis. Must be used when the source and target CRS are
- geocentric CRS. The interpolation CRS must be a geographic CRS.
- Corresponds to PROJ ``xyzgridshift`` method.
-
- - ``VELOCITY``: implies the presence of at least 3 samples.
- The first 3 samples must be respectively the velocities along
- the E(ast), N(orth), U(p) axis in the local topocentric coordinate system.
- Corresponds to PROJ ``deformation`` method.
-
- For example:
-
- .. code-block:: xml
-
- <Item name="TYPE">HORIZONTAL_OFFSET</Item>
-
- * The description of each sample must be specified with a Item whose ``name``
- attribute is set to ``DESCRIPTION`` and ``role`` attribute to ``description``.
-
- Values recognized by PROJ for this Item are currently:
-
- + ``latitude_offset``: valid for TYPE=HORIZONTAL_OFFSET. Sample values should be
- the value to add a latitude expressed in the CRS encoded in the GeoKeys
- to obtain a latitude value expressed in the target CRS.
-
- + ``longitude_offset``: valid for TYPE=HORIZONTAL_OFFSET. Sample values should be
- the value to add a longitude expressed in the CRS encoded in the GeoKeys
- to obtain a longitude value expressed in the target CRS.
-
- + ``geoid_undulation``: valid for TYPE=VERTICAL_OFFSET_GEOGRAPHIC_TO_VERTICAL.
- For a source CRS being a geographic CRS and a target CRS being a vertical CRS,
- sample values should be the value to add to a geoid-related height (that
- is expressed in the target CRS) to
- get an ellipsoidal height (that is expressed in the source CRS), also
- called the geoid undulation.
- Note the possible confusion related to what is the source CRS and target CRS and
- the semantics of the value stored (to convert from the source to the target,
- one must subtract the value contained in the grid). This is the convention
- used by the `EPSG:9665 <https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9665>`_
- operation method.
-
- + ``vertical_offset``: valid for TYPE=VERTICAL_OFFSET_VERTICAL_TO_VERTICAL.
- For a source and target CRS being vertical CRS,
- sample values should be the value to add to an elevation expressed in the
- source CRS to obtain a longitude value expressed in the target CRS.
-
- + ``x_translation`` / ``y_translation`` / ``z_translation``: valid for
- TYPE=GEOCENTRIC_TRANSLATION.
- Sample values should be the value to add to the input geocentric coordinates
- expressed in the source CRS to geocentric coordinates expressed in the target CRS.
-
- + ``east_velocity`` / ``north_velocity`` / ``up_velocity``: valid for
- TYPE=VELOCITY.
- Sample values should be the velocity in a linear/time unit in a ENU local
- topocentric coordinate system.
-
- For example:
-
- .. code-block:: xml
-
- <Item name="DESCRIPTION" sample="0" role="description">latitude_offset</Item>
- <Item name="DESCRIPTION" sample="1" role="description">longitude_offset</Item>
-
- Other values may be used (not used by PROJ):
-
- + ``latitude_offset_accuracy``: valid for TYPE=HORIZONTAL_OFFSET. Sample values should be
- the accuracy of corresponding latitude_offset samples. Generally in metre (if converted from NTv2)
-
- + ``longitude_offset_accuracy``: valid for TYPE=HORIZONTAL_OFFSET. Sample values should be
- the accuracy of corresponding longitude_offset samples. Generally in metre (if converted from NTv2)
-
- * The sign convention for the values of the ``longitude_offset`` channel
- should be indicated with an Item named ``positive_value`` whose value
- can be ``west`` or ``east``. NTv2 products originally use a ``west``
- convention, but when converting from them to GeoTIFF, the sign of those
- samples will be inverted so they use a more natural ``east`` convention.
- If this item is absent, the default value is ``east``.
-
- * The unit of the values stored in the grid must be specified for each
- sample through an Item of name ``UNITTYPE`` and role ``unittype``
- Valid values should be the name of entries from the EPSG ``unitofmeasure``
- table. To maximize interoperability, writers are strongly encouraged to
- limit themselves to the following values:
-
- For linear units:
-
- - ``metre`` (default value assumed if absent for vertical shift grid files, and value used for files stored on PROJ CDN)
- - ``US survey foot``
-
- For angular units:
-
- - ``degree``
- - ``arc-second`` (default value assumed if absent for longitude and latitude offset samples of horizontal shift grid files, and value used for files stored on PROJ CDN)
-
- For velocity units:
-
- - ``millimetres per year``
-
- The longitude and latitude offset samples should use the same unit.
- The geocentric translation samples should use the same unit.
- The velocity samples should use the same unit.
-
- Example:
-
- .. code-block:: xml
-
- <Item name="UNITTYPE" sample="0" role="unittype">arc-second</Item>
- <Item name="UNITTYPE" sample="1" role="unittype">arc-second</Item>
-
- * The ``target_crs_epsg_code`` metadata item should be present.
- For a horizontal shift grid, this is the EPSG
- code of the target geographic CRS. For a vertical shift grid, this is the
- EPSG code of a the target vertical CRS.
- If the target CRS has no associated EPSG code, ``target_crs_wkt`` must be
- used.
- Ignored by PROJ currently.
-
- * The ``target_crs_wkt`` metadata item must be present if the
- ``target_crs_epsg_code`` cannot be used.
- Its value should be a valid WKT string according to
- `WKT:2015 <http://docs.opengeospatial.org/is/12-063r5/12-063r5.html>`_
- or `WKT:2019 <hhttp://docs.opengeospatial.org/is/18-010r7/18-010r7.html>`_
- Ignored by PROJ currently.
-
- * The ``source_crs_epsg_code`` metadata item must be present if the source
- and interpolation CRS are not the same (typical use case is vertical CRS to vertical CRS
- transformation), because the GeoKeys encode the interpolation CRS and not the source CRS.
- If the source CRS has no associated EPSG code, ``source_crs_wkt`` must be
- used.
- Ignored by PROJ currently.
-
- * The ``source_crs_wkt`` metadata item must be present if the
- ``source_crs_epsg_code`` cannot be used.
- Its value should be a valid WKT string according to WKT:2015 or WKT:2019.
- Ignored by PROJ currently.
-
- * The ``interpolation_crs_wkt`` metadata item may be present if the GeoKeys
- cannot be used to express reliably the interpolation CRS.
- Its value should be a valid WKT string according to WKT:2015 or WKT:2019.
- Ignored by PROJ currently.
-
- * The ``recommended_interpolation_method`` metadata item may be present to
- describe the method to use to interpolation values at locations not
- coincident with nodes stored in the grid file. Potential values: ``bilinear``,
- ``bicubic``.
- Ignored by PROJ currently.
-
- * The ``area_of_use`` metadata item can be used to indicate plain text information
- about the area of use of the grid (like "USA - Wisconsin"). In case of multiple
- subgrids, it should be set only on the first one, but applies to the whole
- set of grids, not just the first one.
-
- * The ``grid_name`` metadata item should be present if there are
- subgrids for this grid (that is grids whose extent is contained in the extent
- of this grid), or if this is a subgrid.
- It is intended to be a relatively short identifier
- Will be ignored by PROJ (this information can be inferred by the grids extent)
-
- * The ``parent_grid_name`` metadata item should be present if this is a
- subgrid and its value should be equal to the paren's ``grid_name``
- Will be ignored by PROJ (this information can be inferred by the grids extent)
-
- * The ``number_of_nested_grids`` metadata item should be present if there are
- subgrids for this grid (that is grids whose extent is contained in the extent
- of this grid).
- Will be ignored by PROJ (this information can be inferred by the grids extent)
-
-Example
-+++++++
-
-https://github.com/rouault/sample_proj_gtiff_grids/blob/master/ntf_r93.tif has
-been converted from https://github.com/OSGeo/proj-datumgrid/blob/master/ntf_r93.gsb
-with https://github.com/rouault/sample_proj_gtiff_grids/blob/master/ntv2_to_gtiff.py
-
-::
-
- $ tiffinfo ntf_r93.tif
-
- TIFF Directory at offset 0x4e (78)
- Image Width: 156 Image Length: 111
- Bits/Sample: 32
- Sample Format: IEEE floating point
- Compression Scheme: AdobeDeflate
- Photometric Interpretation: min-is-black
- Extra Samples: 3<unspecified, unspecified, unspecified>
- Samples/Pixel: 4
- Rows/Strip: 111
- Planar Configuration: separate image planes
- ImageDescription: NTF (EPSG:4275) to RGF93 (EPSG:4171). Converted from ntf_r93.gsb (version IGN07_01, last updated on 2007-10-31)
- DateTime: 2019:12:09 00:00:00
- Copyright: Derived from work by IGN France. Open License https://www.etalab.gouv.fr/wp-content/uploads/2014/05/Open_Licence.pdf
- Tag 33550: 0.100000,0.100000,0.000000
- Tag 33922: 0.000000,0.000000,0.000000,-5.500000,52.000000,0.000000
- Tag 34735: 1,1,1,3,1024,0,1,2,1025,0,1,2,2048,0,1,4275
- Tag 42112: <GDALMetadata>
- <Item name="grid_name">FRANCE</Item>
- <Item name="target_crs_epsg_code">4171</Item>
- <Item name="TYPE">HORIZONTAL_OFFSET</Item>
- <Item name="UNITTYPE" sample="0" role="unittype">arc-second</Item>
- <Item name="DESCRIPTION" sample="0" role="description">latitude_offset</Item>
- <Item name="positive_value" sample="1">east</Item>
- <Item name="UNITTYPE" sample="1" role="unittype">arc-second</Item>
- <Item name="DESCRIPTION" sample="1" role="description">longitude_offset</Item>
- <Item name="UNITTYPE" sample="2" role="unittype">arc-second</Item>
- <Item name="DESCRIPTION" sample="2" role="description">latitude_offset_accuracy</Item>
- <Item name="UNITTYPE" sample="3" role="unittype">arc-second</Item>
- <Item name="DESCRIPTION" sample="3" role="description">longitude_offset_accuracy</Item>
- </GDALMetadata>
-
- Predictor: floating point predictor 3 (0x3)
-
-
-::
-
- $ listgeo ntf_r93.tif
-
- Geotiff_Information:
- Version: 1
- Key_Revision: 1.1
- Tagged_Information:
- ModelTiepointTag (2,3):
- 0 0 0
- -5.5 52 0
- ModelPixelScaleTag (1,3):
- 0.1 0.1 0
- End_Of_Tags.
- Keyed_Information:
- GTModelTypeGeoKey (Short,1): ModelTypeGeographic
- GTRasterTypeGeoKey (Short,1): RasterPixelIsPoint
- GeodeticCRSGeoKey (Short,1): Code-4275 (NTF)
- End_Of_Keys.
- End_Of_Geotiff.
-
- GCS: 4275/NTF
- Datum: 6275/Nouvelle Triangulation Francaise
- Ellipsoid: 7011/Clarke 1880 (IGN) (6378249.20,6356515.00)
- Prime Meridian: 8901/Greenwich (0.000000/ 0d 0' 0.00"E)
- Projection Linear Units: User-Defined (1.000000m)
-
- Corner Coordinates:
- Upper Left ( 5d30' 0.00"W, 52d 0' 0.00"N)
- Lower Left ( 5d30' 0.00"W, 40d54' 0.00"N)
- Upper Right ( 10d 6' 0.00"E, 52d 0' 0.00"N)
- Lower Right ( 10d 6' 0.00"E, 40d54' 0.00"N)
- Center ( 2d18' 0.00"E, 46d27' 0.00"N)
-
-::
-
- $ gdalinfo ntf_r93.tif
-
- Driver: GTiff/GeoTIFF
- Files: ntf_r93.tif
- Size is 156, 111
- Coordinate System is:
- GEOGCRS["NTF",
- DATUM["Nouvelle Triangulation Francaise",
- ELLIPSOID["Clarke 1880 (IGN)",6378249.2,293.466021293627,
- LENGTHUNIT["metre",1]]],
- PRIMEM["Greenwich",0,
- ANGLEUNIT["degree",0.0174532925199433]],
- CS[ellipsoidal,2],
- AXIS["geodetic latitude (Lat)",north,
- ORDER[1],
- ANGLEUNIT["degree",0.0174532925199433]],
- AXIS["geodetic longitude (Lon)",east,
- ORDER[2],
- ANGLEUNIT["degree",0.0174532925199433]],
- ID["EPSG",4275]]
- Data axis to CRS axis mapping: 2,1
- Origin = (-5.550000000000000,52.049999999999997)
- Pixel Size = (0.100000000000000,-0.100000000000000)
- Metadata:
- AREA_OR_POINT=Point
- grid_name=FRANCE
- target_crs_epsg_code=4171
- TIFFTAG_DATETIME=2019:12:09 00:00:00
- TIFFTAG_IMAGEDESCRIPTION=NTF (EPSG:4275) to RGF93 (EPSG:4171). Converted from ntf_r93.gsb (version IGN07_01, last updated on 2007-10-31)
- TYPE=HORIZONTAL_OFFSET
- Image Structure Metadata:
- COMPRESSION=DEFLATE
- INTERLEAVE=BAND
- Corner Coordinates:
- Upper Left ( -5.5500000, 52.0500000) ( 5d33' 0.00"W, 52d 3' 0.00"N)
- Lower Left ( -5.5500000, 40.9500000) ( 5d33' 0.00"W, 40d57' 0.00"N)
- Upper Right ( 10.0500000, 52.0500000) ( 10d 3' 0.00"E, 52d 3' 0.00"N)
- Lower Right ( 10.0500000, 40.9500000) ( 10d 3' 0.00"E, 40d57' 0.00"N)
- Center ( 2.2500000, 46.5000000) ( 2d15' 0.00"E, 46d30' 0.00"N)
- Band 1 Block=156x111 Type=Float32, ColorInterp=Gray
- Description = latitude_offset
- Unit Type: arc-second
- Band 2 Block=156x111 Type=Float32, ColorInterp=Undefined
- Description = longitude_offset
- Unit Type: arc-second
- Metadata:
- positive_value=east
- Band 3 Block=156x111 Type=Float32, ColorInterp=Undefined
- Description = latitude_offset_accuracy
- Unit Type: arc-second
- Band 4 Block=156x111 Type=Float32, ColorInterp=Undefined
- Description = longitude_offset_accuracy
- Unit Type: arc-second
-
-Multi-grid storage
+Format description
++++++++++++++++++
-Formats like NTv2 can contain multiple subgrids. This can be transposed to
-TIFF by using several IFD chained together with the last 4 bytes (or 8 bytes
-for BigTIFF) of an IFD pointing to the offset of the next one.
-
-The first IFD should have a full description according to the
-:ref:`Description of the PROJ GeoTIFF format <description_geotiff_format>`.
-Subsequent IFD might have a more compact description, omitting for example, CRS
-information if it is identical to the main IFD (which should be the case for
-the currently envisionned use cases), or Copyright / ImageDescription metadata
-items.
-
-Each IFD will have its
-`NewSubfileType <https://www.awaresystems.be/imaging/tiff/tifftags/newsubfiletype.html>`_
-tag set to 0.
-
-If a low-resolution grid is available, it should be put before subgrids of
-higher-resolution in the chain of IFD linking. On reading, PROJ will use the
-value from the highest-resoluted grid that contains the point of interest.
-
-For efficient reading from the network, files hosted on the CDN will use
-a layout similar to the one described in the `low level paragraph of the Cloud Optimized GeoTIFF
-GDAL driver page <https://gdal.org/drivers/raster/cog.html#low-level>`_
-
-The layout for a file converted from NTv2 will for example be:
-
-- TIFF/BigTIFF header/signature and pointer to first IFD (Image File Directory)
-- "ghost area" indicating the generated process
-- IFD of the first grid, followed by TIFF tags values, excluding the TileOffsets and TileByteCounts arrays
-- ...
-- IFD of the last grid, followed by TIFF tags values, excluding the GDAL_METADATA tag, TileOffsets and TileByteCounts arrays
-- TileOffsets and TileByteCounts arrays for first IFD
-- ...
-- TileOffsets and TileByteCounts arrays for last IFD
-- Value of GDAL_METADATA tag for IFDs following the first IFD
-- First IFD: Data corresponding to latitude offset of Block_0_0
-- First IFD: Data corresponding to longitude offset of Block_0_0
-- First IFD: Data corresponding to latitude offset of Block_0_1
-- First IFD: Data corresponding to longitude offset of Block_0_1
-- ...
-- First IFD: Data corresponding to latitude offset of Block_n_m
-- First IFD: Data corresponding to longitude offset of Block_n_m
-- ...
-- Last IFD: Data corresponding to latitude offset of Block_0_0
-- Last IFD: Data corresponding to longitude offset of Block_0_0
-- Last IFD: Data corresponding to latitude offset of Block_0_1
-- Last IFD: Data corresponding to longitude offset of Block_0_1
-- ...
-- Last IFD: Data corresponding to latitude offset of Block_n_m
-- Last IFD: Data corresponding to longitude offset of Block_n_m
-
-If longitude_offset_accuracy and latitude_offset_accuracy are present, this
-will be followed by:
-
-- First IFD: Data corresponding to latitude offset accuracy of Block_0_0
-- First IFD: Data corresponding to longitude offset accuracy of Block_0_0
-- ...
-- First IFD: Data corresponding to latitude offset accuracy of Block_n_m
-- First IFD: Data corresponding to longitude offset accuracy of Block_n_m
-- ...
-- Last IFD: Data corresponding to latitude offset accuracy of Block_0_0
-- Last IFD: Data corresponding to longitude offset accuracy of Block_0_0
-- ...
-- Last IFD: Data corresponding to latitude offset accuracy of Block_n_m
-- Last IFD: Data corresponding to longitude offset accuracy of Block_n_m
-
-.. note::
-
- TIFF has another mechanism to link IFDs, the SubIFD tag. This potentially
- enables to define a hiearchy of IFDs (similar to HDF5 groups). There is no
- support for that in most TIFF-using software, notably GDAL, and no compelling
- need to have a nested hiearchy, so "flat" organization with the standard IFD chaining
- mechanism is adopted.
-
-Examples of multi-grid dataset
-++++++++++++++++++++++++++++++
-
-https://github.com/rouault/sample_proj_gtiff_grids/blob/master/GDA94_GDA2020_conformal.tif has
-been converted from https://github.com/OSGeo/proj-datumgrid/blob/master/oceania/GDA94_GDA2020_conformal.gsb
-with https://github.com/rouault/sample_proj_gtiff_grids/blob/master/ntv2_to_gtiff.py
-
-It contains 5 subgrids. All essential metadata to list the subgrids and their
-georeferencing is contained within the first 3 KB of the file.
-
-The file size is 4.8 MB using DEFLATE compression and floating-point predictor.
-To be compared with the 83 MB of the original .gsb file.
-
-https://github.com/rouault/sample_proj_gtiff_grids/blob/master/ntv2_0.tif has
-been converted from https://github.com/OSGeo/proj-datumgrid/blob/master/north-america/ntv2_0.gsb
-
-It contains 114 subgrids. All essential metadata to list the subgrids and their
-georeferencing is contained within the first 40 KB of the file.
-
+The format description is available in a dedicated :ref:`geodetictiffgrids`
+document.
Tooling
+++++++
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 95458917..f2fa3961 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -376,7 +376,7 @@ texinfo_documents = [
#texinfo_no_detailmenu = False
breathe_projects = {
- "cpp_stuff":"../build/xml/",
+ "doxygen_api":"../build/xml/",
}
import redirects
diff --git a/docs/source/development/reference/cpp/common.rst b/docs/source/development/reference/cpp/common.rst
index c1a28d37..4e92f6b2 100644
--- a/docs/source/development/reference/cpp/common.rst
+++ b/docs/source/development/reference/cpp/common.rst
@@ -4,5 +4,5 @@ common namespace
----------------
.. doxygennamespace:: osgeo::proj::common
- :project: cpp_stuff
+ :project: doxygen_api
:members:
diff --git a/docs/source/development/reference/cpp/cpp_general.rst b/docs/source/development/reference/cpp/cpp_general.rst
index 3b47d01e..d54daaa8 100644
--- a/docs/source/development/reference/cpp/cpp_general.rst
+++ b/docs/source/development/reference/cpp/cpp_general.rst
@@ -4,4 +4,4 @@ General documentation
---------------------
.. doxygenfile:: general_doc.dox.reworked.h
- :project: cpp_stuff
+ :project: doxygen_api
diff --git a/docs/source/development/reference/cpp/crs.rst b/docs/source/development/reference/cpp/crs.rst
index 2abea378..f8df118e 100644
--- a/docs/source/development/reference/cpp/crs.rst
+++ b/docs/source/development/reference/cpp/crs.rst
@@ -4,5 +4,5 @@ crs namespace
-------------
.. doxygennamespace:: osgeo::proj::crs
- :project: cpp_stuff
+ :project: doxygen_api
:members:
diff --git a/docs/source/development/reference/cpp/cs.rst b/docs/source/development/reference/cpp/cs.rst
index b168213f..376ae6a6 100644
--- a/docs/source/development/reference/cpp/cs.rst
+++ b/docs/source/development/reference/cpp/cs.rst
@@ -4,5 +4,5 @@ cs namespace
------------
.. doxygennamespace:: osgeo::proj::cs
- :project: cpp_stuff
+ :project: doxygen_api
:members:
diff --git a/docs/source/development/reference/cpp/datum.rst b/docs/source/development/reference/cpp/datum.rst
index 1fee5f8a..0a545a68 100644
--- a/docs/source/development/reference/cpp/datum.rst
+++ b/docs/source/development/reference/cpp/datum.rst
@@ -4,5 +4,5 @@ datum namespace
---------------
.. doxygennamespace:: osgeo::proj::datum
- :project: cpp_stuff
+ :project: doxygen_api
:members:
diff --git a/docs/source/development/reference/cpp/io.rst b/docs/source/development/reference/cpp/io.rst
index 9da0f680..9729af90 100644
--- a/docs/source/development/reference/cpp/io.rst
+++ b/docs/source/development/reference/cpp/io.rst
@@ -4,5 +4,5 @@ io namespace
------------
.. doxygennamespace:: osgeo::proj::io
- :project: cpp_stuff
+ :project: doxygen_api
:members:
diff --git a/docs/source/development/reference/cpp/metadata.rst b/docs/source/development/reference/cpp/metadata.rst
index b3960122..348627e8 100644
--- a/docs/source/development/reference/cpp/metadata.rst
+++ b/docs/source/development/reference/cpp/metadata.rst
@@ -4,5 +4,5 @@ metadata namespace
------------------
.. doxygennamespace:: osgeo::proj::metadata
- :project: cpp_stuff
+ :project: doxygen_api
:members:
diff --git a/docs/source/development/reference/cpp/operation.rst b/docs/source/development/reference/cpp/operation.rst
index bc3f201d..88096cb8 100644
--- a/docs/source/development/reference/cpp/operation.rst
+++ b/docs/source/development/reference/cpp/operation.rst
@@ -4,5 +4,5 @@ operation namespace
-------------------
.. doxygennamespace:: osgeo::proj::operation
- :project: cpp_stuff
+ :project: doxygen_api
:members:
diff --git a/docs/source/development/reference/cpp/util.rst b/docs/source/development/reference/cpp/util.rst
index 1aba2954..bc9676a4 100644
--- a/docs/source/development/reference/cpp/util.rst
+++ b/docs/source/development/reference/cpp/util.rst
@@ -4,5 +4,5 @@ util namespace
--------------
.. doxygennamespace:: osgeo::proj::util
- :project: cpp_stuff
+ :project: doxygen_api
:members:
diff --git a/docs/source/development/reference/datatypes.rst b/docs/source/development/reference/datatypes.rst
index 18bd7efd..7ec17eb1 100644
--- a/docs/source/development/reference/datatypes.rst
+++ b/docs/source/development/reference/datatypes.rst
@@ -797,11 +797,48 @@ Logging
.. versionadded:: 5.1.0
+Setting custom I/O functions
+-------------------------------------------------------------------------------
+
+.. versionadded:: 7.0.0
+
+.. doxygenstruct:: PROJ_FILE_API
+ :project: doxygen_api
+ :members:
+
+.. doxygentypedef:: PROJ_FILE_HANDLE
+ :project: doxygen_api
+
+.. doxygenenum:: PROJ_OPEN_ACCESS
+ :project: doxygen_api
+
+
+Network related functionality
+-------------------------------------------------------------------------------
+
+.. versionadded:: 7.0.0
+
+.. doxygentypedef:: PROJ_NETWORK_HANDLE
+ :project: doxygen_api
+
+.. doxygentypedef:: proj_network_open_cbk_type
+ :project: doxygen_api
+
+.. doxygentypedef:: proj_network_close_cbk_type
+ :project: doxygen_api
+
+.. doxygentypedef:: proj_network_get_header_value_cbk_type
+ :project: doxygen_api
+
+.. doxygentypedef:: proj_network_read_range_type
+ :project: doxygen_api
+
+
C API for ISO-19111 functionality
-------------------------------------------------------------------------------
.. doxygengroup:: iso19111_types
- :project: cpp_stuff
+ :project: doxygen_api
:content-only:
diff --git a/docs/source/development/reference/functions.rst b/docs/source/development/reference/functions.rst
index c010fd13..a2a0c3ae 100644
--- a/docs/source/development/reference/functions.rst
+++ b/docs/source/development/reference/functions.rst
@@ -697,6 +697,54 @@ Various
:returns: :c:type:`int` 1 if output units is expected in radians, otherwise 0
+Setting custom I/O functions
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.. versionadded:: 7.0.0
+
+.. doxygenfunction:: proj_context_set_fileapi
+ :project: doxygen_api
+
+.. doxygenfunction:: proj_context_set_sqlite3_vfs_name
+ :project: doxygen_api
+
+
+Network related functionality
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.. versionadded:: 7.0.0
+
+.. doxygenfunction:: proj_context_set_network_callbacks
+ :project: doxygen_api
+
+.. doxygenfunction:: proj_context_set_enable_network
+ :project: doxygen_api
+
+.. doxygenfunction:: proj_context_set_url_endpoint
+ :project: doxygen_api
+
+.. doxygenfunction:: proj_grid_cache_set_enable
+ :project: doxygen_api
+
+.. doxygenfunction:: proj_grid_cache_set_filename
+ :project: doxygen_api
+
+.. doxygenfunction:: proj_grid_cache_set_max_size
+ :project: doxygen_api
+
+.. doxygenfunction:: proj_grid_cache_set_ttl
+ :project: doxygen_api
+
+.. doxygenfunction:: proj_grid_cache_clear
+ :project: doxygen_api
+
+.. doxygenfunction:: proj_is_download_needed
+ :project: doxygen_api
+
+.. doxygenfunction:: proj_download_file
+ :project: doxygen_api
+
+
Cleanup
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -727,6 +775,6 @@ which are not of type CRS (can be tested with :c:func:`proj_is_crs`),
will return an error when used with functions of this section.
.. doxygengroup:: iso19111_functions
- :project: cpp_stuff
+ :project: doxygen_api
:content-only:
diff --git a/docs/source/index.rst b/docs/source/index.rst
index e9590d99..3a2df4b4 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -17,6 +17,7 @@ PROJ
resource_files
geodesic
development/index
+ specifications/index
community/index
faq
glossary
diff --git a/docs/source/operations/transformations/deformation.rst b/docs/source/operations/transformations/deformation.rst
index 3a9d025c..02924a25 100644
--- a/docs/source/operations/transformations/deformation.rst
+++ b/docs/source/operations/transformations/deformation.rst
@@ -35,6 +35,9 @@ GTX format. Both grids are expected to contain grid-values in units of
mm/year. GDAL both reads and writes both file formats. Using GDAL for
construction of new grids is recommended.
+Starting with PROJ 7.0, use of a GeoTIFF format is recommended to store both
+the horizontal and vertical velocities.
+
Example
-------------------------------------------------------------------------------
@@ -89,13 +92,15 @@ Parameters
.. option:: +xy_grids=<list>
- Comma-separated list of grids to load. If a grid is prefixed by an `@` the
+ Comma-separated list of grids to load. If a grid is prefixed by an ``@`` the
grid is considered optional and PROJ will the not complain if the grid is
not available.
- Grids for the horizontla component of a deformation model is expected to be
+ Grids for the horizontal component of a deformation model is expected to be
in CTable2 format.
+ .. note:: :option:`+xy_grids` is mutually exclusive with :option:`+grids`
+
.. option:: +z_grids=<list>
Comma-separated list of grids to load. If a grid is prefixed by an `@` the
@@ -105,6 +110,36 @@ Parameters
Grids for the vertical component of a deformation model is expected to be
in either GTX format.
+ .. note:: :option:`+z_grids` is mutually exclusive with :option:`+grids`
+
+.. option:: +grids=<list>
+
+ .. versionadded:: 7.0.0
+
+ Comma-separated list of grids to load. If a grid is prefixed by an `@` the
+ grid is considered optional and PROJ will the not complain if the grid is
+ not available.
+
+ Grids should be in GeoTIFF format with the first 3 components being
+ respectively the easting, northing and up velocities in mm/year.
+ Setting the Description and Unit Type GDAL band metadata items is strongly
+ recommended, so that gdalinfo reports:
+
+ ::
+
+ Band 1 Block=... Type=Float32, ColorInterp=Gray
+ Description = east_velocity
+ Unit Type: mm/year
+ Band 2 Block=... Type=Float32, ColorInterp=Undefined
+ Description = north_velocity
+ Unit Type: mm/year
+ Band 3 Block=... Type=Float32, ColorInterp=Undefined
+ Description = up_velocity
+ Unit Type: mm/year
+
+ .. note:: :option:`+grids` is mutually exclusive with :option:`+xy_grids`
+ and :option:`+z_grids`
+
.. option:: +t_epoch=<value>
Central epoch of transformation given in decimalyears. Will be used in
diff --git a/docs/source/operations/transformations/index.rst b/docs/source/operations/transformations/index.rst
index d4bbf4e0..6bd503d4 100644
--- a/docs/source/operations/transformations/index.rst
+++ b/docs/source/operations/transformations/index.rst
@@ -19,3 +19,4 @@ systems are based on different datums.
molobadekas
hgridshift
vgridshift
+ xyzgridshift
diff --git a/docs/source/operations/transformations/xyzgridshift.rst b/docs/source/operations/transformations/xyzgridshift.rst
new file mode 100644
index 00000000..30537032
--- /dev/null
+++ b/docs/source/operations/transformations/xyzgridshift.rst
@@ -0,0 +1,91 @@
+.. _xyzgridshift:
+
+================================================================================
+Geocentric grid shift
+================================================================================
+
+.. versionadded:: 7.0.0
+
+Geocentric translation using a grid shift
+
++-----------------+-------------------------------------------------------------------+
+| **Domain** | 3D |
++-----------------+-------------------------------------------------------------------+
+| **Input type** | Cartesian coordinates |
++-----------------+-------------------------------------------------------------------+
+| **Output type** | Cartesian coordinates |
++-----------------+-------------------------------------------------------------------+
+
+Perform a geocentric translation by bilinear interpolation of dx, dy, dz
+translation values from a grid. The grid is referenced against either the
+2D geographic CRS corresponding to the input (or sometimes output) CRS.
+
+This method is described (in French) in :cite:`NTF_88`
+and as EPSG operation method code 9655 in :cite:`IOGP2018` (§2.4.4.1.1
+France geocentric interpolation).
+
+The translation in the grids are added to the input coordinates in the forward direction,
+and subtracted in the reverse direction.
+By default (if ``grid_ref=input_crs``), in the forward direction, the input coordinates
+are converted to their geographic equivalent to directly read and interpolate from
+the grid. In the reverse direction, an iterative method is used to be able to find
+the grid locations to read.
+If ``grid_ref=output_crs`` is used, then the reverse strategy is applied: iterative
+method in the forward direction, and direct read in the reverse direction.
+
+Example
+-------------------------------------------------------------------------------
+
+NTF to RGF93 transformation using gr3df97a.tif grid
+
+::
+
+ +proj=pipeline
+ +step +proj=push +v_3
+ +step +proj=cart +ellps=clrk80ign
+ +step +proj=xyzgridshift +grids=gr3df97a.tif +grid_ref=output_crs +ellps=GRS80
+ +step +proj=cart +ellps=GRS80 +inv
+ +step +proj=pop +v_3
+
+Parameters
+################################################################################
+
+The ellipsoid parameters should be the ones consistent with ``grid_ref``.
+They are used to perform a geocentric to geographic conversion to find the
+translation parameters.
+
+
+Required
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.. include:: ../options/ellps.rst
+
+.. option:: +grids=<list>
+
+ Comma-separated list of grids to load. If a grid is prefixed by an ``@`` the
+ grid is considered optional and PROJ will the not complain if the grid is
+ not available.
+
+ Grids are expected to be in GeoTIFF format. If no metadata is provided,
+ the first, second and third samples are assumed to be the geocentric
+ translation along X, Y and Z axis respectively, in metres.
+
+Optional
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+.. option:: +grid_ref=input_crs/output_crs
+
+ Specify in which CRS the grid is referenced to. The default value is
+ input_crs. That is the grid is referenced in the geographic CRS corresponding
+ to the input geocentric CRS.
+
+ If output_crs is specified, the grid is referenced in the geographic CRS corresponding
+ to the output geocentric CRS. This is for example the case for the French
+ gr3df97a.tif grid converting from NTF to RGF93, but referenced against RGF93.
+ Thus in the forward direction (NTF->RGF93), an iterative method is used to find
+ the appropriate shift.
+
+.. option:: +multiplier=<value>
+
+ Specify the multiplier to apply to the grid values. Defaults to 1.0
+
diff --git a/docs/source/references.bib b/docs/source/references.bib
index 529c20e1..13853764 100644
--- a/docs/source/references.bib
+++ b/docs/source/references.bib
@@ -229,6 +229,15 @@
Doi = {10.2312/PE/PG/PG2012short/005-010}
}
+@TechReport{NTF_88,
+ Title = {Grille de parametres de transformation de coordonnees - {GR3DF97A} - Notice d'utilisation},
+ Author = {IGN},
+ Institution = {Service de Geodesie et Nivellement, Institut Geographique National},
+ Year = {1997},
+
+ Url = {https://geodesie.ign.fr/contenu/fichiers/documentation/algorithmes/notice/NTG_88.pdf}
+}
+
@TechReport{ONeilLaubscher1976,
Title = {Extended Studies of a Quadrilateralized Spherical Cube Earth Data Base},
Author = {E. M. O'Neill and R. E. Laubscher},
diff --git a/docs/source/resource_files.rst b/docs/source/resource_files.rst
index 7a0ede63..28628d30 100644
--- a/docs/source/resource_files.rst
+++ b/docs/source/resource_files.rst
@@ -14,6 +14,8 @@ In addition to the bundled init-files the PROJ project also distributes a number
of packages containing transformation grids and additional init-files not included
in the main PROJ package.
+.. _resource_file_paths:
+
Where are PROJ resource files looked for ?
-------------------------------------------------------------------------------
@@ -23,23 +25,43 @@ The following paths are checked in order:
- For transformation grids that have an explict relative or absolute path,
the directory specified in the grid filename.
+
- Path resolved by the callback function set with
the :c:func:`proj_context_set_file_finder`. If it is set, the next tests
will not be run.
+
- Path(s) set with the :c:func:`proj_context_set_search_paths`. If set, the
next tests will not be run.
+
+.. _user_writable_directory:
+
+- The PROJ user writable directory, which is :
+
+ * on Windows, ${LOCALAPPDATA}/proj
+ * on MacOSX, ${HOME}/Library/Application Support/proj
+ * on other platforms (Linux), ${XDG_DATA_HOME}/proj if :envvar:`XDG_DATA_HOME`
+ is defined. Else ${HOME}/.local/share/proj
+
- Path(s) set with by the environment variable :envvar:`PROJ_LIB`.
On Linux/MacOSX/Unix, use ``:`` to separate paths. On Windows, ``;``
+
- On Windows, the *..\\share\\proj\\* and its contents are found automatically
at run-time if the installation respects the build structure. That is, the
binaries and proj.dll are installed under *..\\bin\\*, and resource files
are in *..\\share\\proj\\*.
+
- A path built into PROJ as its resource installation directory (whose value is
$(pkgdatadir)), for builds using the Makefile build system. Note, however,
that since this is a hard-wired path setting, it only works if the whole
PROJ installation is not moved somewhere else.
+
- The current directory
+When networking capabilities are enabled, either by API with the
+:c:func:`proj_context_set_enable_network` function or when the
+:envvar:`PROJ_NETWORK` environment variable is set to ``ON``, PROJ will
+attempt to use remote grids stored on CDN (Content Delivery Network) storage.
+
.. _proj-db:
proj.db
@@ -49,6 +71,38 @@ A proj installation includes a SQLite database of transformation information
that must be accessible for the library to work properly. The library will
print an error if the database can't be found.
+.. _proj-ini:
+
+proj.ini
+-------------------------------------------------------------------------------
+
+.. versionadded:: 7.0
+
+proj.ini is a text configuration file, mostly dedicated at setting up network
+related parameters.
+
+Its default content is:
+
+::
+
+ [general]
+ ; Lines starting by ; are commented lines.
+ ;
+
+ ; Network capabilities disabled by default.
+ ; Can be overriden with the PROJ_NETWORK=ON environment variable.
+ ; network = on
+
+ ; Can be overriden with the PROJ_NETWORK_ENDPOINT environment variable.
+ cdn_endpoint = https://cdn.proj.org
+
+ cache_enabled = on
+
+ cache_size_MB = 300
+
+ cache_ttl_sec = 86400
+
+
Transformation grids
-------------------------------------------------------------------------------
diff --git a/docs/source/specifications/geodetictiffgrids.rst b/docs/source/specifications/geodetictiffgrids.rst
new file mode 100644
index 00000000..98dc8408
--- /dev/null
+++ b/docs/source/specifications/geodetictiffgrids.rst
@@ -0,0 +1,626 @@
+.. _geodetictiffgrids:
+
+================================================================================
+Geodetic TIFF grids (GTG)
+================================================================================
+
+.. versionadded:: 7.0
+
+Introduction
+++++++++++++
+
+The Geodetic TIFF grid format has been introduced per :ref:`rfc4`. It is a
+profile of the TIFF and GeoTIFF formats that addresses the specific requirements
+of geodetic grids: horizontal shifts, vertical shifts, velocity grids, etc...
+It also follows the `Cloud Optimized GeoTIFF <http://cogeo.org>`_ principles.
+
+Such grids are available on a :ref:`CDN of GeoTIFF grids <cdn_grids>`.
+
+.. _gtg_general_description:
+
+General description
++++++++++++++++++++
+
+The general principles that guide the following requirements and recommendations
+are such that files will be properly recognized by PROJ, and also by GDAL which
+is an easy way to inspect such grid files:
+
+- `TIFF 6.0 <https://www.awaresystems.be/imaging/tiff/specification/TIFF6.pdf>`_
+ based (could possibly be BigTIFF without code changes, if we ever
+ need some day to handle grids larger than 4GB)
+
+- `GeoTIFF 1.1 <http://docs.opengeospatial.org/is/19-008r4/19-008r4.html>`_ for the georeferencing.
+ GeoTIFF 1.1 is a recent standard, compared to the original GeoTIFF 1.0 version,
+ but its backward compatibility is excellent, so that should not cause much trouble
+ to readers that are not official GeoTIFF 1.1 compliant.
+
+- Files hosted on the CDN will use a Geographic 2D CRS for the GeoTIFF GeoKeys.
+ That CRS is intended to be the interpolation CRS as defined in
+ `OGC Abstract Specification Topic 2 <http://docs.opengeospatial.org/as/18-005r4/18-005r4.html>`_,
+ that is the CRS to which grid values are refered to.
+
+ Given that they will nominally be related to the EPSG dataset, the `GeodeticCRSGeoKey
+ <http://docs.opengeospatial.org/is/19-008r4/19-008r4.html#_requirements_class_geodeticcrsgeokey>`_
+ will be used to store the EPSG code of the CRS. If the CRS cannot be reliably
+ encoded through that key or other geokeys, the ``interpolation_crs_wkt`` metadata
+ item detailed afterwards should be used.
+
+ This CRS will be generally the source CRS (for geographic to
+ geographic horizontal shift grids, or geographic to vertical shift grids), but
+ for vertical to vertical CRS adjustment, this will be the geographic CRS to
+ which the grid is referenced. In some very rare cases of geographic to vertical
+ shift grids, the interpolation CRS might be a geographic CRS that is not the
+ same as the source CRS (into which ellipsoidal height are expressed). The only
+ instance we have in mind is for the EPSG:7001 "ETRS89 to NAP height (1)" transformation
+ using the naptrans2008 VDatum-grid which is referenced to Amersfoort EPSG:4289
+ instead of ETRS89...
+
+ On the reading side, PROJ will ignore that information:
+ the CRS is already stored in the source_crs or interpolation_crs column of the
+ grid_transformation table.
+
+ For geographic to vertical shift files (geoid models), the GeoTIFF 1.1
+ convention will be used to store the value of the `VerticalGeoKey
+ <http://docs.opengeospatial.org/is/19-008r4/19-008r4.html#_requirements_class_verticalgeokey>`_
+ So a geoid model that apply to WGS 84 EPSG:4979 will have GeodeticCRSGeoKey = 4326
+ and VerticalGeoKey = 4979.
+
+- Files hosted on the CDN will use the GeoTIFF defined `ModelTiepointTag and ModelPixelScaleTag
+ <http://docs.opengeospatial.org/is/19-008r4/19-008r4.html#_raster_to_model_coordinate_transformation_requirements>`_ TIFF tags
+ to store the coordinates of the upper-left pixel and the resolution of the pixels.
+ On the reading side, they will be required and ModelTransformationTag will be ignored.
+
+ .. note::
+
+ Regarding anti-meridian handling, a variety of possibilities exist.
+ We do not attempt to standardize this and filesh hosted on the CDN will use
+ a georeferencing close to the original data producer.
+ For example, NOAA vertical grids that apply to Conterminous USA might even have a top-left
+ longitude beyond 180 (for consistency with Alaska grids, whose origin is < 180)
+ Anti-meridian handling in PROJ has probably issues. This RFC does not attempt
+ to address them in particular, as they are believed to be orthogonal to the
+ topics it covers, and being mostly implementation issues.
+
+- Files hosted on the CDN will use the `GTRasterTypeGeoKey
+ <http://docs.opengeospatial.org/is/19-008r4/19-008r4.html#_requirements_class_gtrastertypegeokey>`_
+ = PixelIsPoint convention.
+ This is the convention used by most existing grid formats currently. Note that GDAL
+ typically use a PixelIsArea convention (but can handle both conventions), so the
+ georeferencing it displays when opening a .gsb or .gtx file appears to have a
+ half-pixel shift regarding to the coordinates stored in the original grid file. On
+ the reading side, PROJ will accept both conventions (for equivalent georeferencing,
+ the value of the origin in a PixelIsArea convention is shifted by a half-pixel
+ towards the upper-left direction). Unspecified behaviour if this GeoKey is absent.
+
+- Files hosted on the CDN will be tiled, presumably with 256x256 tiles (small
+ grids that are smaller than 256x256 will use a single strip). On the reading
+ side, PROJ will accept TIFF files with any strip or tile organization.
+ Tiling is expressed by specifying the TileWidth, TileHeight, TileOffsets
+ and TileByteCounts tags. Strip organization is expressed by specifying the
+ RowsPerStrip, StripByteCounts and StripOffsets tags.
+
+- Files hosted on the CDN will use `Compression
+ <https://www.awaresystems.be/imaging/tiff/tifftags/compression.html>`_ = DEFLATE
+ or LZW (to be determined, possibly with
+ `Predictor <https://www.awaresystems.be/imaging/tiff/tifftags/predictor.html>`_ = 2
+ or 3)
+ On the reading side, PROJ will accept TIFF files with any compression method
+ (appropriate for the data types and PhotometricInterpretation considered)
+ supported by the libtiff build used by PROJ. Of course uncompressed files will be supported.
+
+- Files hosted on the CDN will use little-endian byte ordering. On the reading
+ side, libtiff will transparently handle both little-endian and big-endian
+ ordering.
+
+- Files hosted on the CDN will use PlanarConfiguration=Separate.
+ The tools described in a later section will order blocks so that blocks needed
+ for a given location are close to each other.
+ On the reading side, PROJ will handle also PlanarConfiguration=Contig.
+
+- Files hosted on the CDN will generally use Float32 (BitsPerSample=32 and SampleFormat=IEEEFP)
+ Files may be created using Signed Int 16 (
+ `BitsPerSample <https://www.awaresystems.be/imaging/tiff/tifftags/bitspersample.html>`_ =16 and
+ `SampleFormat <https://www.awaresystems.be/imaging/tiff/tifftags/sampleformat.html>`_ = INT),
+ Unsigned Int 16 (BitsPerSample=16 and SampleFormat=UINT), Signed Int 32 or Unsigned Int 32 generally with an
+ associate scale/offset.
+ On the reading side, only those three data types will be supported as well.
+
+- Files hosted on the CDN will have a `PhotometricInterpretation
+ <https://www.awaresystems.be/imaging/tiff/tifftags/photometricinterpretation.html>`_ = MinIsBlack.
+ It will be assumed, and ignored on the reading side.
+
+- Files hosted on the CDN will nominally have:
+
+ * `SamplesPerPixel <https://www.awaresystems.be/imaging/tiff/tifftags/samplesperpixel.html>`_ = 2
+ for horizontal shift grid, with the first sample being the longitude offset
+ and the second sample being the latitude offset.
+
+ * SamplesPerPixel = 1 for vertical shift grids.
+
+ In the future, different values of SamplesPerPixel may be used to accomodate
+ for other needs. For example for deformation models, SamplesPerPixel = 3 to combine
+ horizontal and vertical adjustments.
+ And even for the current identified needs of horizontal or vertical shifts,
+ more samples may be present (to indicate for example uncertainties), but
+ will be ignored by PROJ.
+
+ The `ExtraSamples <https://www.awaresystems.be/imaging/tiff/tifftags/extrasamples.html>`_
+ tag should be set to a value of SamplesPerPixel - 1 (given the rules that
+ apply for PhotometricInterpretation = MinIsBlack)
+
+- The `ImageDescription <https://www.awaresystems.be/imaging/tiff/tifftags/imagedescription.html>`_
+ tag may be used to convey extra information about the name, provenance, version
+ and last updated date of the grid.
+ Will be set when possible fo files hosted on the CDN.
+ Ignored by PROJ.
+
+- The `Copyright <https://www.awaresystems.be/imaging/tiff/tifftags/copyright.html>`_
+ tag may be used to convey extra information about the copyright and license of the grid.
+ Will be set when possible fo files hosted on the CDN.
+ Ignored by PROJ.
+
+- The `DateTime <https://www.awaresystems.be/imaging/tiff/tifftags/datetime.html>`_
+ tag may be used to convey the date at which the file has been created or
+ converted. In case of a file conversion, for example from NTv2, this will be
+ the date at which the conversion has been performed. The ``ImageDescription``
+ tag however will contain the latest of the CREATED or UPDATED fields from the NTv2 file.
+ Will be set when possible fo files hosted on the CDN.
+ Ignored by PROJ.
+
+- Files hosted on the CDN will use the `GDAL_NODATA
+ <https://www.awaresystems.be/imaging/tiff/tifftags/gdal_nodata.html>`_ tag to encode
+ the value of the nodata / missing value, when it applies to the grid.
+
+ If offset and/or scaling is used, the nodata value corresponds to the raw value,
+ before applying offset and scaling.
+ The value found in this tag, if present, will be honoured (to the extent to
+ which current PROJ code makes use of nodata).
+ For floating point data, writers are strongly discouraged to use non-finite values
+ (+/- infinity, NaN) of nodata to maximimize interoperability.
+ The GDAL_NODATA value applies to all samples of a given TIFF IFD.
+
+- Files hosted on the CDN will use the `GDAL_METADATA
+ <https://www.awaresystems.be/imaging/tiff/tifftags/gdal_metadata.html>`_ tag to encode extra
+ metadata not supported by baseline or extended TIFF.
+
+ * The root XML node should be ``GDALMetadata``
+
+ * Zero, one or several child XML nodes ``Item`` may be present.
+
+ * A Item should have a ``name`` attribute, and a child text node with its value.
+ ``role`` and ``sample`` attributes may be present for attributes that have
+ a special semantics (recognized by GDAL). The value of `sample` should be
+ a integer value between 0 and number_of_samples - 1.
+
+ * Scale and offset to convert integer raw values to floating point values
+ may be expressed with XML `Item` elements whose name attribute is respectively
+ ``SCALE`` and ``OFFSET``, and their ``role`` attribute is respectively ``scale``
+ and ``offset``. The decoded value will be: {offset} + {scale} * raw_value_from_geotiff_file
+
+ For a offset value of 1 and scaling of 2, the following payload should be
+ stored:
+
+ .. code-block:: xml
+
+ <GDALMetadata>
+ <Item name="OFFSET" sample="0" role="offset">1</Item>
+ <Item name="SCALE" sample="0" role="scale">2</Item>
+ </GDALMetadata>
+
+ * The type of the grid must be specified with a `Item` whose ``name`` is set
+ to ``TYPE``.
+
+ Values recognized by PROJ currently are:
+
+ - ``HORIZONTAL_OFFSET``: implies the presence of at least two samples.
+ The first sample must contain the latitude offset and the second
+ sample must contain the longitude offset.
+ Corresponds to PROJ ``hgridshift`` method.
+
+ - ``VERTICAL_OFFSET_GEOGRAPHIC_TO_VERTICAL``: implies the presence of at least one sample.
+ The first sample must contain the vertical adjustment. Must be used when
+ the source/interpolation CRS is a Geographic CRS and the target CRS a Vertical CRS.
+ Corresponds to PROJ ``vgridshift`` method.
+
+ - ``VERTICAL_OFFSET_VERTICAL_TO_VERTICAL``: implies the presence of at least one sample.
+ The first sample must contain the vertical adjustment. Must be used when
+ the source and target CRS are Vertical CRS.
+ Corresponds to PROJ ``vgridshift`` method.
+
+ - ``GEOCENTRIC_TRANSLATION``: implies the presence of at least 3 samples.
+ The first 3 samples must be respectively the geocentric adjustments along
+ the X, Y and Z axis. Must be used when the source and target CRS are
+ geocentric CRS. The interpolation CRS must be a geographic CRS.
+ Corresponds to PROJ ``xyzgridshift`` method.
+
+ - ``VELOCITY``: implies the presence of at least 3 samples.
+ The first 3 samples must be respectively the velocities along
+ the E(ast), N(orth), U(p) axis in the local topocentric coordinate system.
+ Corresponds to PROJ ``deformation`` method.
+
+ For example:
+
+ .. code-block:: xml
+
+ <Item name="TYPE">HORIZONTAL_OFFSET</Item>
+
+ * The description of each sample must be specified with a Item whose ``name``
+ attribute is set to ``DESCRIPTION`` and ``role`` attribute to ``description``.
+
+ Values recognized by PROJ for this Item are currently:
+
+ + ``latitude_offset``: valid for TYPE=HORIZONTAL_OFFSET. Sample values should be
+ the value to add a latitude expressed in the CRS encoded in the GeoKeys
+ to obtain a latitude value expressed in the target CRS.
+
+ + ``longitude_offset``: valid for TYPE=HORIZONTAL_OFFSET. Sample values should be
+ the value to add a longitude expressed in the CRS encoded in the GeoKeys
+ to obtain a longitude value expressed in the target CRS.
+
+ + ``geoid_undulation``: valid for TYPE=VERTICAL_OFFSET_GEOGRAPHIC_TO_VERTICAL.
+ For a source CRS being a geographic CRS and a target CRS being a vertical CRS,
+ sample values should be the value to add to a geoid-related height (that
+ is expressed in the target CRS) to
+ get an ellipsoidal height (that is expressed in the source CRS), also
+ called the geoid undulation.
+ Note the possible confusion related to what is the source CRS and target CRS and
+ the semantics of the value stored (to convert from the source to the target,
+ one must subtract the value contained in the grid). This is the convention
+ used by the `EPSG:9665 <https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:method:EPSG::9665>`_
+ operation method.
+
+ + ``vertical_offset``: valid for TYPE=VERTICAL_OFFSET_VERTICAL_TO_VERTICAL.
+ For a source and target CRS being vertical CRS,
+ sample values should be the value to add to an elevation expressed in the
+ source CRS to obtain a longitude value expressed in the target CRS.
+
+ + ``x_translation`` / ``y_translation`` / ``z_translation``: valid for
+ TYPE=GEOCENTRIC_TRANSLATION.
+ Sample values should be the value to add to the input geocentric coordinates
+ expressed in the source CRS to geocentric coordinates expressed in the target CRS.
+
+ + ``east_velocity`` / ``north_velocity`` / ``up_velocity``: valid for
+ TYPE=VELOCITY.
+ Sample values should be the velocity in a linear/time unit in a ENU local
+ topocentric coordinate system.
+
+ For example:
+
+ .. code-block:: xml
+
+ <Item name="DESCRIPTION" sample="0" role="description">latitude_offset</Item>
+ <Item name="DESCRIPTION" sample="1" role="description">longitude_offset</Item>
+
+ Other values may be used (not used by PROJ):
+
+ + ``latitude_offset_accuracy``: valid for TYPE=HORIZONTAL_OFFSET. Sample values should be
+ the accuracy of corresponding latitude_offset samples. Generally in metre (if converted from NTv2)
+
+ + ``longitude_offset_accuracy``: valid for TYPE=HORIZONTAL_OFFSET. Sample values should be
+ the accuracy of corresponding longitude_offset samples. Generally in metre (if converted from NTv2)
+
+ * The sign convention for the values of the ``longitude_offset`` channel
+ should be indicated with an Item named ``positive_value`` whose value
+ can be ``west`` or ``east``. NTv2 products originally use a ``west``
+ convention, but when converting from them to GeoTIFF, the sign of those
+ samples will be inverted so they use a more natural ``east`` convention.
+ If this item is absent, the default value is ``east``.
+
+ * The unit of the values stored in the grid must be specified for each
+ sample through an Item of name ``UNITTYPE`` and role ``unittype``
+ Valid values should be the name of entries from the EPSG ``unitofmeasure``
+ table. To maximize interoperability, writers are strongly encouraged to
+ limit themselves to the following values:
+
+ For linear units:
+
+ - ``metre`` (default value assumed if absent for vertical shift grid files, and value used for files stored on PROJ CDN)
+ - ``US survey foot``
+
+ For angular units:
+
+ - ``degree``
+ - ``arc-second`` (default value assumed if absent for longitude and latitude offset samples of horizontal shift grid files, and value used for files stored on PROJ CDN)
+
+ For velocity units:
+
+ - ``millimetres per year``
+
+ The longitude and latitude offset samples should use the same unit.
+ The geocentric translation samples should use the same unit.
+ The velocity samples should use the same unit.
+
+ Example:
+
+ .. code-block:: xml
+
+ <Item name="UNITTYPE" sample="0" role="unittype">arc-second</Item>
+ <Item name="UNITTYPE" sample="1" role="unittype">arc-second</Item>
+
+ * The ``target_crs_epsg_code`` metadata item should be present.
+ For a horizontal shift grid, this is the EPSG
+ code of the target geographic CRS. For a vertical shift grid, this is the
+ EPSG code of a the target vertical CRS.
+ If the target CRS has no associated EPSG code, ``target_crs_wkt`` must be
+ used.
+ Ignored by PROJ currently.
+
+ * The ``target_crs_wkt`` metadata item must be present if the
+ ``target_crs_epsg_code`` cannot be used.
+ Its value should be a valid WKT string according to
+ `WKT:2015 <http://docs.opengeospatial.org/is/12-063r5/12-063r5.html>`_
+ or `WKT:2019 <hhttp://docs.opengeospatial.org/is/18-010r7/18-010r7.html>`_
+ Ignored by PROJ currently.
+
+ * The ``source_crs_epsg_code`` metadata item must be present if the source
+ and interpolation CRS are not the same (typical use case is vertical CRS to vertical CRS
+ transformation), because the GeoKeys encode the interpolation CRS and not the source CRS.
+ If the source CRS has no associated EPSG code, ``source_crs_wkt`` must be
+ used.
+ Ignored by PROJ currently.
+
+ * The ``source_crs_wkt`` metadata item must be present if the
+ ``source_crs_epsg_code`` cannot be used.
+ Its value should be a valid WKT string according to WKT:2015 or WKT:2019.
+ Ignored by PROJ currently.
+
+ * The ``interpolation_crs_wkt`` metadata item may be present if the GeoKeys
+ cannot be used to express reliably the interpolation CRS.
+ Its value should be a valid WKT string according to WKT:2015 or WKT:2019.
+ Ignored by PROJ currently.
+
+ * The ``recommended_interpolation_method`` metadata item may be present to
+ describe the method to use to interpolation values at locations not
+ coincident with nodes stored in the grid file. Potential values: ``bilinear``,
+ ``bicubic``.
+ Ignored by PROJ currently.
+
+ * The ``area_of_use`` metadata item can be used to indicate plain text information
+ about the area of use of the grid (like "USA - Wisconsin"). In case of multiple
+ subgrids, it should be set only on the first one, but applies to the whole
+ set of grids, not just the first one.
+
+ * The ``grid_name`` metadata item should be present if there are
+ subgrids for this grid (that is grids whose extent is contained in the extent
+ of this grid), or if this is a subgrid.
+ It is intended to be a relatively short identifier
+ Will be ignored by PROJ (this information can be inferred by the grids extent)
+
+ * The ``parent_grid_name`` metadata item should be present if this is a
+ subgrid and its value should be equal to the paren's ``grid_name``
+ Will be ignored by PROJ (this information can be inferred by the grids extent)
+
+ * The ``number_of_nested_grids`` metadata item should be present if there are
+ subgrids for this grid (that is grids whose extent is contained in the extent
+ of this grid).
+ Will be ignored by PROJ (this information can be inferred by the grids extent)
+
+Example
++++++++
+
+https://github.com/rouault/sample_proj_gtiff_grids/blob/master/ntf_r93.tif has
+been converted from https://github.com/OSGeo/proj-datumgrid/blob/master/ntf_r93.gsb
+with https://github.com/rouault/sample_proj_gtiff_grids/blob/master/ntv2_to_gtiff.py
+
+::
+
+ $ tiffinfo ntf_r93.tif
+
+ TIFF Directory at offset 0x4e (78)
+ Image Width: 156 Image Length: 111
+ Bits/Sample: 32
+ Sample Format: IEEE floating point
+ Compression Scheme: AdobeDeflate
+ Photometric Interpretation: min-is-black
+ Extra Samples: 3<unspecified, unspecified, unspecified>
+ Samples/Pixel: 4
+ Rows/Strip: 111
+ Planar Configuration: separate image planes
+ ImageDescription: NTF (EPSG:4275) to RGF93 (EPSG:4171). Converted from ntf_r93.gsb (version IGN07_01, last updated on 2007-10-31)
+ DateTime: 2019:12:09 00:00:00
+ Copyright: Derived from work by IGN France. Open License https://www.etalab.gouv.fr/wp-content/uploads/2014/05/Open_Licence.pdf
+ Tag 33550: 0.100000,0.100000,0.000000
+ Tag 33922: 0.000000,0.000000,0.000000,-5.500000,52.000000,0.000000
+ Tag 34735: 1,1,1,3,1024,0,1,2,1025,0,1,2,2048,0,1,4275
+ Tag 42112: <GDALMetadata>
+ <Item name="grid_name">FRANCE</Item>
+ <Item name="target_crs_epsg_code">4171</Item>
+ <Item name="TYPE">HORIZONTAL_OFFSET</Item>
+ <Item name="UNITTYPE" sample="0" role="unittype">arc-second</Item>
+ <Item name="DESCRIPTION" sample="0" role="description">latitude_offset</Item>
+ <Item name="positive_value" sample="1">east</Item>
+ <Item name="UNITTYPE" sample="1" role="unittype">arc-second</Item>
+ <Item name="DESCRIPTION" sample="1" role="description">longitude_offset</Item>
+ <Item name="UNITTYPE" sample="2" role="unittype">arc-second</Item>
+ <Item name="DESCRIPTION" sample="2" role="description">latitude_offset_accuracy</Item>
+ <Item name="UNITTYPE" sample="3" role="unittype">arc-second</Item>
+ <Item name="DESCRIPTION" sample="3" role="description">longitude_offset_accuracy</Item>
+ </GDALMetadata>
+
+ Predictor: floating point predictor 3 (0x3)
+
+
+::
+
+ $ listgeo ntf_r93.tif
+
+ Geotiff_Information:
+ Version: 1
+ Key_Revision: 1.1
+ Tagged_Information:
+ ModelTiepointTag (2,3):
+ 0 0 0
+ -5.5 52 0
+ ModelPixelScaleTag (1,3):
+ 0.1 0.1 0
+ End_Of_Tags.
+ Keyed_Information:
+ GTModelTypeGeoKey (Short,1): ModelTypeGeographic
+ GTRasterTypeGeoKey (Short,1): RasterPixelIsPoint
+ GeodeticCRSGeoKey (Short,1): Code-4275 (NTF)
+ End_Of_Keys.
+ End_Of_Geotiff.
+
+ GCS: 4275/NTF
+ Datum: 6275/Nouvelle Triangulation Francaise
+ Ellipsoid: 7011/Clarke 1880 (IGN) (6378249.20,6356515.00)
+ Prime Meridian: 8901/Greenwich (0.000000/ 0d 0' 0.00"E)
+ Projection Linear Units: User-Defined (1.000000m)
+
+ Corner Coordinates:
+ Upper Left ( 5d30' 0.00"W, 52d 0' 0.00"N)
+ Lower Left ( 5d30' 0.00"W, 40d54' 0.00"N)
+ Upper Right ( 10d 6' 0.00"E, 52d 0' 0.00"N)
+ Lower Right ( 10d 6' 0.00"E, 40d54' 0.00"N)
+ Center ( 2d18' 0.00"E, 46d27' 0.00"N)
+
+::
+
+ $ gdalinfo ntf_r93.tif
+
+ Driver: GTiff/GeoTIFF
+ Files: ntf_r93.tif
+ Size is 156, 111
+ Coordinate System is:
+ GEOGCRS["NTF",
+ DATUM["Nouvelle Triangulation Francaise",
+ ELLIPSOID["Clarke 1880 (IGN)",6378249.2,293.466021293627,
+ LENGTHUNIT["metre",1]]],
+ PRIMEM["Greenwich",0,
+ ANGLEUNIT["degree",0.0174532925199433]],
+ CS[ellipsoidal,2],
+ AXIS["geodetic latitude (Lat)",north,
+ ORDER[1],
+ ANGLEUNIT["degree",0.0174532925199433]],
+ AXIS["geodetic longitude (Lon)",east,
+ ORDER[2],
+ ANGLEUNIT["degree",0.0174532925199433]],
+ ID["EPSG",4275]]
+ Data axis to CRS axis mapping: 2,1
+ Origin = (-5.550000000000000,52.049999999999997)
+ Pixel Size = (0.100000000000000,-0.100000000000000)
+ Metadata:
+ AREA_OR_POINT=Point
+ grid_name=FRANCE
+ target_crs_epsg_code=4171
+ TIFFTAG_DATETIME=2019:12:09 00:00:00
+ TIFFTAG_IMAGEDESCRIPTION=NTF (EPSG:4275) to RGF93 (EPSG:4171). Converted from ntf_r93.gsb (version IGN07_01, last updated on 2007-10-31)
+ TYPE=HORIZONTAL_OFFSET
+ Image Structure Metadata:
+ COMPRESSION=DEFLATE
+ INTERLEAVE=BAND
+ Corner Coordinates:
+ Upper Left ( -5.5500000, 52.0500000) ( 5d33' 0.00"W, 52d 3' 0.00"N)
+ Lower Left ( -5.5500000, 40.9500000) ( 5d33' 0.00"W, 40d57' 0.00"N)
+ Upper Right ( 10.0500000, 52.0500000) ( 10d 3' 0.00"E, 52d 3' 0.00"N)
+ Lower Right ( 10.0500000, 40.9500000) ( 10d 3' 0.00"E, 40d57' 0.00"N)
+ Center ( 2.2500000, 46.5000000) ( 2d15' 0.00"E, 46d30' 0.00"N)
+ Band 1 Block=156x111 Type=Float32, ColorInterp=Gray
+ Description = latitude_offset
+ Unit Type: arc-second
+ Band 2 Block=156x111 Type=Float32, ColorInterp=Undefined
+ Description = longitude_offset
+ Unit Type: arc-second
+ Metadata:
+ positive_value=east
+ Band 3 Block=156x111 Type=Float32, ColorInterp=Undefined
+ Description = latitude_offset_accuracy
+ Unit Type: arc-second
+ Band 4 Block=156x111 Type=Float32, ColorInterp=Undefined
+ Description = longitude_offset_accuracy
+ Unit Type: arc-second
+
+Multi-grid storage
+++++++++++++++++++
+
+Formats like NTv2 can contain multiple subgrids. This can be transposed to
+TIFF by using several IFD chained together with the last 4 bytes (or 8 bytes
+for BigTIFF) of an IFD pointing to the offset of the next one.
+
+The first IFD should have a full description according to the
+:ref:`General description <gtg_general_description>`.
+Subsequent IFD might have a more compact description, omitting for example, CRS
+information if it is identical to the main IFD (which should be the case for
+the currently envisionned use cases), or Copyright / ImageDescription metadata
+items.
+
+Each IFD will have its
+`NewSubfileType <https://www.awaresystems.be/imaging/tiff/tifftags/newsubfiletype.html>`_
+tag set to 0.
+
+If a low-resolution grid is available, it should be put before subgrids of
+higher-resolution in the chain of IFD linking. On reading, PROJ will use the
+value from the highest-resoluted grid that contains the point of interest.
+
+For efficient reading from the network, files hosted on the CDN will use
+a layout similar to the one described in the `low level paragraph of the Cloud Optimized GeoTIFF
+GDAL driver page <https://gdal.org/drivers/raster/cog.html#low-level>`_
+
+The layout for a file converted from NTv2 will for example be:
+
+- TIFF/BigTIFF header/signature and pointer to first IFD (Image File Directory)
+- "ghost area" indicating the generated process
+- IFD of the first grid, followed by TIFF tags values, excluding the TileOffsets and TileByteCounts arrays
+- ...
+- IFD of the last grid, followed by TIFF tags values, excluding the GDAL_METADATA tag, TileOffsets and TileByteCounts arrays
+- TileOffsets and TileByteCounts arrays for first IFD
+- ...
+- TileOffsets and TileByteCounts arrays for last IFD
+- Value of GDAL_METADATA tag for IFDs following the first IFD
+- First IFD: Data corresponding to latitude offset of Block_0_0
+- First IFD: Data corresponding to longitude offset of Block_0_0
+- First IFD: Data corresponding to latitude offset of Block_0_1
+- First IFD: Data corresponding to longitude offset of Block_0_1
+- ...
+- First IFD: Data corresponding to latitude offset of Block_n_m
+- First IFD: Data corresponding to longitude offset of Block_n_m
+- ...
+- Last IFD: Data corresponding to latitude offset of Block_0_0
+- Last IFD: Data corresponding to longitude offset of Block_0_0
+- Last IFD: Data corresponding to latitude offset of Block_0_1
+- Last IFD: Data corresponding to longitude offset of Block_0_1
+- ...
+- Last IFD: Data corresponding to latitude offset of Block_n_m
+- Last IFD: Data corresponding to longitude offset of Block_n_m
+
+If longitude_offset_accuracy and latitude_offset_accuracy are present, this
+will be followed by:
+
+- First IFD: Data corresponding to latitude offset accuracy of Block_0_0
+- First IFD: Data corresponding to longitude offset accuracy of Block_0_0
+- ...
+- First IFD: Data corresponding to latitude offset accuracy of Block_n_m
+- First IFD: Data corresponding to longitude offset accuracy of Block_n_m
+- ...
+- Last IFD: Data corresponding to latitude offset accuracy of Block_0_0
+- Last IFD: Data corresponding to longitude offset accuracy of Block_0_0
+- ...
+- Last IFD: Data corresponding to latitude offset accuracy of Block_n_m
+- Last IFD: Data corresponding to longitude offset accuracy of Block_n_m
+
+.. note::
+
+ TIFF has another mechanism to link IFDs, the SubIFD tag. This potentially
+ enables to define a hiearchy of IFDs (similar to HDF5 groups). There is no
+ support for that in most TIFF-using software, notably GDAL, and no compelling
+ need to have a nested hiearchy, so "flat" organization with the standard IFD chaining
+ mechanism is adopted.
+
+Examples of multi-grid dataset
+++++++++++++++++++++++++++++++
+
+https://github.com/rouault/sample_proj_gtiff_grids/blob/master/GDA94_GDA2020_conformal.tif has
+been converted from https://github.com/OSGeo/proj-datumgrid/blob/master/oceania/GDA94_GDA2020_conformal.gsb
+with https://github.com/rouault/sample_proj_gtiff_grids/blob/master/ntv2_to_gtiff.py
+
+It contains 5 subgrids. All essential metadata to list the subgrids and their
+georeferencing is contained within the first 3 KB of the file.
+
+The file size is 4.8 MB using DEFLATE compression and floating-point predictor.
+To be compared with the 83 MB of the original .gsb file.
+
+https://github.com/rouault/sample_proj_gtiff_grids/blob/master/ntv2_0.tif has
+been converted from https://github.com/OSGeo/proj-datumgrid/blob/master/north-america/ntv2_0.gsb
+
+It contains 114 subgrids. All essential metadata to list the subgrids and their
+georeferencing is contained within the first 40 KB of the file.
diff --git a/docs/source/specifications/index.rst b/docs/source/specifications/index.rst
new file mode 100644
index 00000000..1853ca53
--- /dev/null
+++ b/docs/source/specifications/index.rst
@@ -0,0 +1,14 @@
+.. _specifications:
+
+================================================================================
+Specifications
+================================================================================
+
+PROJ implements a number of extensions to standards, that are described below
+for the sake of broader interoperability.
+
+.. toctree::
+ :maxdepth: 1
+
+ projjson
+ geodetictiffgrids
diff --git a/docs/source/usage/projjson.rst b/docs/source/specifications/projjson.rst
index 6bcce585..6bcce585 100644
--- a/docs/source/usage/projjson.rst
+++ b/docs/source/specifications/projjson.rst
diff --git a/docs/source/usage/differences.rst b/docs/source/usage/differences.rst
index e85ba039..be163176 100644
--- a/docs/source/usage/differences.rst
+++ b/docs/source/usage/differences.rst
@@ -139,3 +139,9 @@ cs2cs
Removed ``-ld`` option from application, since it promoted use of deprecated
paramters like ``+towgs`` and ``+datum``.
+
+UTF-8 adoption
+--------------
+
+The value of all path, filenames passed to PROJ through function calls, PROJ
+strings or environment variables should be encoded in UTF-8.
diff --git a/docs/source/usage/environmentvars.rst b/docs/source/usage/environmentvars.rst
index 457432a0..31a74e9a 100644
--- a/docs/source/usage/environmentvars.rst
+++ b/docs/source/usage/environmentvars.rst
@@ -56,3 +56,21 @@ done by setting the variable with no content::
Set the debug level of PROJ. The default debug level is zero, which results
in no debug output when using PROJ. A number from 1-3, whit 3 being the most
verbose setting.
+
+.. envvar:: PROJ_NETWORK
+
+ .. versionadded:: 7.0.0
+
+ If set to ON, enable the capability to use remote grids stored on CDN
+ (Content Delivery Network) storage, when grids are not available locally.
+ Alternatively, the :c:func:`proj_context_set_enable_network` function can
+ be used.
+
+.. envvar:: PROJ_NETWORK_ENDPOINT
+
+ .. versionadded:: 7.0.0
+
+ Define the endpoint of the CDN storage. Normally defined through the proj.ini
+ configuration file locale in :envvar:`PROJ_LIB`.
+ Alternatively, the :c:func:`proj_context_set_url_endpoint` function can
+ be used.
diff --git a/docs/source/usage/index.rst b/docs/source/usage/index.rst
index c31c6dce..a074b18b 100644
--- a/docs/source/usage/index.rst
+++ b/docs/source/usage/index.rst
@@ -17,5 +17,4 @@ command line applications or the C API that is a part of the software package.
transformation
environmentvars
differences
- projjson
-
+ network
diff --git a/docs/source/usage/network.rst b/docs/source/usage/network.rst
new file mode 100644
index 00000000..295232b0
--- /dev/null
+++ b/docs/source/usage/network.rst
@@ -0,0 +1,102 @@
+.. _network:
+
+================================================================================
+Network capabilities
+================================================================================
+
+.. versionadded:: 7.0
+
+PROJ 7.0 has introduced, per :ref:`rfc4`, the capability to work with grid files
+that are not installed on the local machine where PROJ is executed.
+
+This enables to transparently download the parts of grids that are needed to
+perform a coordinate transformation.
+
+.. _cdn_grids:
+
+CDN of GeoTIFF grids
+--------------------
+
+Files are accessed by default through a CDN (Content Delivery Network),
+accessible through https://cdn.proj.org, that contains :ref:`geodetictiffgrids`
+datasets which are mirrored and managed by the
+https://github.com/OSGeo/proj-datumgrid-geotiff/ GitHub project.
+Files in the CDN are designed to be used by PROJ 7 or later, but any software
+project wishing to use the CDN for shifting support are encouraged to
+participate in the project and leverage the CDN.
+
+How to enable network capabilities ?
+------------------------------------
+
+This capability assumes that PROJ has been build against `libcurl`, and that
+the user authorizes network access.
+
+Authorizing network access can be done in multiple ways:
+
+ - enabling / uncommenting the ``network = on`` line of :ref:`proj-ini`
+ - definiting the :envvar:`PROJ_NETWORK` environment variable to ON
+ - or using the :cpp:func:`proj_context_set_enable_network` with a
+ ``enabled`` = TRUE value.
+
+.. note::
+
+ Instead of using the `libcurl` implementation, an application using the PROJ
+ API can supply its own network implementation through C function callbacks
+ with :cpp:func:`proj_context_set_network_callbacks`. Enabling network use
+ must still be done with one of the above mentionned method.
+
+Setting endpoint
+----------------
+
+When this is enabled, and a grid is not found in the various locations where
+:ref:`resource files are looked for <resource_file_paths>`, PROJ will then
+attempt at loading the file from a remote server, which defaults to
+https://cdn.proj.org in :ref:`proj-ini`. This location can be changed with
+the :envvar:`PROJ_NETWORK_ENDPOINT` environment variable or with
+:cpp:func:`proj_context_set_url_endpoint`.
+
+Caching
+-------
+
+To avoid repeated access to network, a local cache of downloaded chunks of grids
+is implemented as SQLite3 database, ``cache.db``, stored in the
+:ref:`PROJ user writable directory <user_writable_directory>`.
+
+This local caching is enabled by default (can be changed in :ref:`proj-ini` or
+with :cpp:func:`proj_grid_cache_set_enable`). The default maximum size of the
+cache is 300 MB, which is more than half of the total size of grids available,
+at time of writing. This size can also be customized in :ref:`proj-ini` or
+with :cpp:func:`proj_grid_cache_set_max_size`
+
+Download API
+------------
+
+When on-demand loading of grid is not desirable, the PROJ API also offers the
+capability to download whole grids in the
+:ref:`PROJ user writable directory <user_writable_directory>` by using the
+:cpp:func:`proj_is_download_needed` and :cpp:func:`proj_download_file` functions.
+
+
+Mirroring
+---------
+
+If you are able, you are encouraged to mirror the grids via AWS S3 command line:
+
+::
+
+ aws s3 sync s3://cdn.proj.org .
+
+If direct S3 access is not possible, you can also use wget to locally mirror the
+data:
+
+::
+
+ wget --mirror https://cdn.proj.org/
+
+Acknowledgments
+---------------
+
+The s3://cdn.proj.org bucket is hosted by the
+`Amazon Public Datasets program <https://aws.amazon.com/opendata/public-datasets/>`_.
+CDN services are provided by the AWS Public Dataset team via
+`CloudFront <https://aws.amazon.com/cloudfront/>`_