Skip to content

Commit

Permalink
Add a +proj=tinshift for triangulation-based transformations
Browse files Browse the repository at this point in the history
Implements RFC-6
  • Loading branch information
rouault committed Aug 28, 2020
1 parent ef48acb commit ba17d90
Show file tree
Hide file tree
Showing 23 changed files with 2,294 additions and 4 deletions.
7 changes: 6 additions & 1 deletion data/Makefile.am
Expand Up @@ -4,7 +4,8 @@ pkgdata_DATA = proj.ini GL27 nad.lst nad27 nad83 world other.extra \
CH \
ITRF2000 ITRF2008 ITRF2014 proj.db \
projjson.schema.json \
deformation_model.schema.json
deformation_model.schema.json \
triangulation.schema.json

SQL_ORDERED_LIST = sql/begin.sql \
sql/proj_db_table_defs.sql \
Expand Down Expand Up @@ -45,6 +46,7 @@ EXTRA_DIST = proj.ini GL27 nad.lst nad27 nad83 \
ITRF2000 ITRF2008 ITRF2014 \
projjson.schema.json \
deformation_model.schema.json \
triangulation.schema.json \
CMakeLists.txt \
tests/test_nodata.gtx \
tests/test_vgrid_bigendian_bigtiff.tif \
Expand Down Expand Up @@ -116,6 +118,9 @@ EXTRA_DIST = proj.ini GL27 nad.lst nad27 nad83 \
tests/simple_model_wrap_west.json \
tests/simple_model_wrap_west.tif \
tests/simple_model_projected.json \
tests/tinshift_crs_implicit.json \
tests/tinshift_simplified_kkj_etrs.json \
tests/tinshift_simplified_n60_n2000.json \
generate_all_sql_in.cmake sql_filelist.cmake \
$(SQL_ORDERED_LIST)

Expand Down
46 changes: 46 additions & 0 deletions data/tests/tinshift_crs_implicit.json
@@ -0,0 +1,46 @@
{
"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": "Adress",
"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] ]
}
50 changes: 50 additions & 0 deletions data/tests/tinshift_simplified_kkj_etrs.json
@@ -0,0 +1,50 @@
{
"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": "Adress",
"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 triangulation"
}
],
"input_crs": "EPSG:2393",
"output_crs": "EPSG:3067",
"transformed_components": [ "horizontal" ],
"vertices_columns": [ "source_x", "source_y", "target_x", "target_y" ],
"triangles_columns": [ "idx_vertex1", "idx_vertex2", "idx_vertex3" ],
"vertices": [ [3244102.707, 6693710.937, 244037.137, 6690900.686],
[3205290.722, 6715311.822, 205240.895, 6712492.577],
[3218328.492, 6649538.429, 218273.648, 6646745.973] ],
"triangles": [ [0, 1, 2] ]
}
50 changes: 50 additions & 0 deletions data/tests/tinshift_simplified_n60_n2000.json
@@ -0,0 +1,50 @@
{
"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": "Adress",
"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 tirangulation"
}
],
"input_crs": "EPSG:2393+5717",
"output_crs": "EPSG:2393+5941",
"transformed_components": [ "vertical" ],
"vertices_columns": [ "source_x", "source_y", "source_z", "target_z" ],
"triangles_columns": [ "idx_vertex1", "idx_vertex2", "idx_vertex3" ],
"vertices": [ [3188607.0, 6688748.0, 23.123, 23.4133],
[3184981.0, 6725255.0, 8.044, 8.34499],
[3220912.0, 6699508.0, 1.724, 2.0101] ],
"triangles": [ [0, 1, 2] ]
}
169 changes: 169 additions & 0 deletions data/triangulation.schema.json
@@ -0,0 +1,169 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Schema for triangulation based transformation",
"type": "object",
"properties": {
"file_type": {
"type": "string",
"enum": [
"triangulation_file"
],
"description": "File type. Always \"triangulation_file\""
},
"format_version": {
"type": "string",
"enum": [
"1.0"
]
},
"name": {
"type": "string",
"description": "A brief descriptive name of the triangulation"
},
"version": {
"type": "string",
"description": "A string identifying the version of the triangulation. The format for specifying version will be defined by the agency responsible for the triangulation"
},
"publication_date": {
"$ref": "#/definitions/datetime",
"description": "The date on which this version of the triangulation was published (or possibly the date on which it takes effect?)"
},
"license": {
"type": "string",
"description": "License under which the file is published"
},
"description": {
"type": "string",
"description": "A text description of the file"
},
"authority": {
"type": "object",
"description": "Basic information about the agency responsible for the data set",
"properties": {
"name": {
"type": "string",
"description": "The name of the agency"
},
"url": {
"type": "string",
"description": "The url of the agency website",
"format": "uri"
},
"address": {
"type": "string",
"description": "The postal address of the agency"
},
"email": {
"type": "string",
"description": "An email contact address for the agency",
"format": "email"
}
},
"required": [
"name"
],
"additionalProperties": false
},
"links": {
"type": "array",
"description": "Links to related information",
"items": {
"type": "object",
"properties": {
"href": {
"type": "string",
"description": "The URL holding the information",
"format": "uri"
},
"rel": {
"type": "string",
"description": "The relationship to the dataset. Proposed relationships are:\n- \"about\": a web page for human consumption describing the model\n- \"source\": the authoritative source data from which the triangulation is built.\n- \"metadata\": ISO 19115 XML metadata regarding the triangulation."
},
"type": {
"type": "string",
"description": "MIME type"
},
"title": {
"type": "string",
"description": "Description of the link"
}
},
"required": [
"href"
],
"additionalProperties": false
}
},
"input_crs": {
"$ref": "#/definitions/crs",
"description": "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": {
"$ref": "#/definitions/crs",
"description": "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 easting, that is longitude, latitude for geographic coordinates and easting, northing for projected coordinates."
},
"transformed_components": {
"type": "array",
"description": "Specify which component of the coordinates are transformed. Either \"horizontal\", \"vertical\" or both",
"minItems": 1,
"maxItems": 2,
"items": {
"type": "string",
"enum": [
"horizontal",
"vertical"
]
}
},
"vertices_columns": {
"type": "array",
"description": "Specify the name of the columns of the rows in the \"vertices\" array. There must be exactly as many elements in \"vertices_columns\" as in a row of \"vertices\". The following names have a special meaning: \"source_x\", \"source_y\", \"target_x\", \"target_y\", \"source_z\", \"target_z\" and \"offset_z\". \"source_x\" and \"source_y\" are compulsory. \"source_x\" is for the source longitude (in degree) or easting. \"source_y\" is for the source latitude (in degree) or northing. \"target_x\" and \"target_y\" are compulsory when \"horizontal\" is specified in \"transformed_components\". (\"source_z\" and \"target_z\") or \"offset_z\" are compulsory when \"vertical\" is specified in \"transformed_components\".",
"minItems": 3,
"items": {
"type": "string"
}
},
"triangles_columns": {
"type": "array",
"description": "Specify the name of the columns of the rows in the \"triangles\" array. There must be exactly as many elements in \"triangles_columns\" as in a row of \"triangles\". The following names have a special meaning: \"idx_vertex1\", \"idx_vertex2\", \"idx_vertex3\". They are compulsory.",
"minItems": 3,
"items": {
"type": "string"
}
},
"vertices": {
"type": "array",
"description": "an array whose items are themselves arrays with as many columns as described in \"vertices_columns\"",
"items": {
"type": "array"
}
},
"triangles": {
"type": "array",
"description": "an array whose items are themselves arrays with as many columns as described in \"triangles_columns\". The value of the \"idx_vertexN\" columns must be indices (between 0 and len(\"vertices\"-1) of items of the \"vertices\" array",
"items": {
"type": "array"
}
}
},
"required": [
"file_type",
"format_version",
"transformed_components",
"vertices_columns",
"triangles_columns",
"vertices",
"triangles"
],
"additionalProperties": false,
"definitions": {
"crs": {
"type": "string"
},
"datetime": {
"type": "string",
"format": "date-time",
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$"
}
}
}
1 change: 1 addition & 0 deletions docs/source/operations/transformations/index.rst
Expand Up @@ -19,5 +19,6 @@ systems are based on different datums.
molodensky
molobadekas
hgridshift
tinshift
vgridshift
xyzgridshift

0 comments on commit ba17d90

Please sign in to comment.