Triangulated irregular network (TIN) JSON format
The TIN JSON format defines the format for a triangulation model stored in a JSON file.
That file format may be used by the tinshift operation since PROJ 7.2
Note: the TIN GeoPackage file format can also be used since PROJ 9.9. It can handle arbitrarily large triangulations.
Below a minimal example, from the KKJ to ETRS89 transformation, with just a single triangle:
{
"file_type": "triangulation_file",
"format_version": "1.0",
"name": "Name",
"version": "Version",
"publication_date": "2018-07-01T00:00:00Z",
"license": "Creative Commons Attribution 4.0 International",
"description": "Test triangulation",
"authority": {
"name": "Authority name",
"url": "http://example.com",
"address": "Address",
"email": "test@example.com"
},
"links": [
{
"href": "https://example.com/about.html",
"rel": "about",
"type": "text/html",
"title": "About"
},
{
"href": "https://example.com/download",
"rel": "source",
"type": "application/zip",
"title": "Authoritative source"
},
{
"href": "https://creativecommons.org/licenses/by/4.0/",
"rel": "license",
"type": "text/html",
"title": "Creative Commons Attribution 4.0 International license"
},
{
"href": "https://example.com/metadata.xml",
"rel": "metadata",
"type": "application/xml",
"title": " ISO 19115 XML encoded metadata regarding the deformation model"
}
],
"transformed_components": [ "horizontal" ],
"vertices_columns": [ "source_x", "source_y", "target_x", "target_y" ],
"triangles_columns": [ "idx_vertex1", "idx_vertex2", "idx_vertex3" ],
"vertices": [ [2,49,2.1,49.1], [3,50,3.1,50.1], [2, 50, 2.1,50.1] ],
"triangles": [ [0, 1, 2] ]
}
So after the generic metadata, we define the input and output CRS (informative
only), and that the transformation affects horizontal components of
coordinates. We name the columns of the vertices and triangles arrays.
We defined the source and target coordinates of each vertex, and define a
triangle by referring to the index of its vertices in the vertices array.
More formally, the specific items for the triangulation file are:
- input_crs
String identifying the CRS of source coordinates in the vertices. Typically
EPSG:XXXX. If the transformation is for vertical component, this should be the code for a compound CRS (can be EPSG:XXXX+YYYY where XXXX is the code of the horizontal CRS and YYYY the code of the vertical CRS). For example, for the KKJ->ETRS89 transformation, this is EPSG:2393 (KKJ / Finland Uniform Coordinate System). The input coordinates are assumed to be passed in the "normalized for visualisation" / "GIS friendly" order, that is longitude, latitude for geographic coordinates and easting, northing for projected coordinates.- output_crs
String identifying the CRS of target coordinates in the vertices. Typically
EPSG:XXXX. If the transformation is for vertical component, this should be the code for a compound CRS (can be EPSG:XXXX+YYYY where XXXX is the code of the horizontal CRS and YYYY the code of the vertical CRS). For example, for the KKJ->ETRS89 transformation, this is EPSG:3067 ("ETRS89 / TM35FIN(E,N)"). The output coordinates will be returned in the "normalized for visualisation" / "GIS friendly" order, that is longitude, latitude for geographic coordinates and easting, northing for projected coordinates.- transformed_components
Array which may contain one or two strings: "horizontal" when horizontal components of the coordinates are transformed and/or "vertical" when the vertical component is transformed.
- fallback_strategy
String identifying how to treat points that do not fall into any of the specified triangles. This item is available for
format_version>= 1.1. Possible values arenone,nearest_sideandnearest_centroid. The default isnoneand signifies, that points that fall outside the specified triangles are not transformed. This is also the behavior forformat_versionbefore 1.1. Iffallback_strategyis set tonearest_side, then points that do not fall into any triangle are transformed according to the triangle closest to them by euclidean distance. Iffallback_strategyis set tonearest_centroid, then points that do not fall into any triangle are transformed according to the triangle with the closest centroid (intersection of its medians).- vertices_columns
Specify the name of the columns of the rows in the
verticesarray. There must be exactly as many elements invertices_columnsas in a row ofvertices. The following names have a special meaning:source_x,source_y,target_x,target_y,source_z,target_zandoffset_z.source_xandsource_yare compulsory.source_xis for the source longitude (in degree) or easting.source_yis for the source latitude (in degree) or northing.target_xandtarget_yare compulsory whenhorizontalis specified intransformed_components. (source_zandtarget_z) oroffset_zare compulsory whenverticalis specified intransformed_components- triangles_columns
Specify the name of the columns of the rows in the
trianglesarray. There must be exactly as many elements intriangles_columnsas in a row oftriangles. The following names have a special meaning:idx_vertex1,idx_vertex2,idx_vertex3. They are compulsory.- vertices
An array whose items are themselves arrays with as many columns as described in
vertices_columns.- triangles
An array whose items are themselves arrays with as many columns as described in
triangles_columns. The value of theidx_vertexNcolumns must be indices (between 0 and len(vertices-1) of items of theverticesarray.
A JSON schema is available for this file format.