summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-03-11 14:40:11 +0100
committerGitHub <noreply@github.com>2020-03-11 14:40:11 +0100
commit4f5b4ea62df05cd9c49869aabbbac71d5534bb59 (patch)
tree954c13934a88c2119ec81ad11d9599a24764da3d
parent8393be9f6a31e493610b27d26370d7ccb067d4ec (diff)
parent59a03bf4cebbf752d22dc08b385fc9ff7ed24f3b (diff)
downloadPROJ-data-4f5b4ea62df05cd9c49869aabbbac71d5534bb59.tar.gz
PROJ-data-4f5b4ea62df05cd9c49869aabbbac71d5534bb59.zip
Merge pull request #16 from rouault/add_nc_dittt
Add nc_dittt/ grids for New Caledonia (fixes #14)
-rw-r--r--CMakeLists.txt1
-rw-r--r--agency.json6
-rw-r--r--copyright_and_licenses.csv4
-rw-r--r--files.geojson4
-rw-r--r--index.html5
-rwxr-xr-xnc_dittt/convert_gr3dnc01b.py (renamed from grid_tools/convert_gr3dnc01b.py)27
-rwxr-xr-xnc_dittt/convert_gr3dnc02b.py138
-rwxr-xr-xnc_dittt/convert_gr3dnc03a.py (renamed from grid_tools/convert_gr3dnc03a.py)27
-rw-r--r--nc_dittt/nc_dittt_README.txt33
-rw-r--r--nc_dittt/nc_dittt_gr3dnc01b.tifbin0 -> 62390 bytes
-rw-r--r--nc_dittt/nc_dittt_gr3dnc02b.tifbin0 -> 7975 bytes
-rw-r--r--nc_dittt/nc_dittt_gr3dnc03a.tifbin0 -> 3274 bytes
-rwxr-xr-xregenerate_index_html.py2
-rw-r--r--travis/expected_main.lst4
14 files changed, 240 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 05e2c67..7387055 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,6 +33,7 @@ set(CPACK_SOURCE_INSTALLED_DIRECTORIES
"${CMAKE_CURRENT_SOURCE_DIR}/eur_nkg/" "."
"${CMAKE_CURRENT_SOURCE_DIR}/fr_ign/" "."
"${CMAKE_CURRENT_SOURCE_DIR}/is_lmi/" "."
+ "${CMAKE_CURRENT_SOURCE_DIR}/nc_dittt/" "."
"${CMAKE_CURRENT_SOURCE_DIR}/nl_nsgi/" "."
"${CMAKE_CURRENT_SOURCE_DIR}/nz_linz/" "."
"${CMAKE_CURRENT_SOURCE_DIR}/pt_dgt/" "."
diff --git a/agency.json b/agency.json
index 80bf6df..a9cae5e 100644
--- a/agency.json
+++ b/agency.json
@@ -96,6 +96,12 @@
"url": "https://atlas.lmi.is/LmiData/index.php?id=626468364600"
},
{
+ "id": "nc_dittt",
+ "country": "New Caledonia",
+ "agency":"Gouvernement de Nouvelle Calédonie - DITTT",
+ "url": "https://dittt.gouv.nc/circe-pour-la-nouvelle-caledonie"
+ },
+ {
"id": "nl_nsgi",
"country": "Netherlands",
"agency":"Nederlandse Samenwerking Geodetische Infrastructuur (NSGI)",
diff --git a/copyright_and_licenses.csv b/copyright_and_licenses.csv
index 38cba73..6c5106d 100644
--- a/copyright_and_licenses.csv
+++ b/copyright_and_licenses.csv
@@ -137,6 +137,10 @@ is_lmi_ISN93_ISN2016.tif,"Copyright 2017-2019, National Land Survey of Iceland",
is_lmi_ISN_vel_beta.tif,"Copyright 2017-2019, National Land Survey of Iceland",CC-BY-4.0
is_lmi_README.txt,Disclaimed,Public domain
NKG,Nordic Geodetic Commission,CC-BY-4.0
+nc_dittt_gr3dnc01b.tif,Gouvernement de Nouvelle Calédonie - DITTT,Open License France - https://www.etalab.gouv.fr/wp-content/uploads/2014/05/Open_Licence.pdf
+nc_dittt_gr3dnc02b.tif,Gouvernement de Nouvelle Calédonie - DITTT,Open License France - https://www.etalab.gouv.fr/wp-content/uploads/2014/05/Open_Licence.pdf
+nc_dittt_gr3dnc03a.tif,Gouvernement de Nouvelle Calédonie - DITTT,Open License France - https://www.etalab.gouv.fr/wp-content/uploads/2014/05/Open_Licence.pdf
+nc_dittt_README.txt,Disclaimed,Public domain
nl_nsgi_naptrans2018.tif,Nederlandse Samenwerking Geodetische Infrastructuur (NSGI),CC-BY-4.0
nl_nsgi_nlgeo2018.tif,Nederlandse Samenwerking Geodetische Infrastructuur (NSGI),CC-BY-4.0
nl_nsgi_rdcorr2018.tif,Nederlandse Samenwerking Geodetische Infrastructuur (NSGI),CC-BY-4.0
diff --git a/files.geojson b/files.geojson
index f1eaf7c..c60be22 100644
--- a/files.geojson
+++ b/files.geojson
@@ -140,6 +140,10 @@
{ "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/is_lmi_Icegeoid_ISN2004.tif", "name": "is_lmi_Icegeoid_ISN2004.tif", "area_of_use": "Iceland", "type": "VERTICAL_OFFSET_GEOGRAPHIC_TO_VERTICAL", "source_crs_code": "EPSG:5323", "source_crs_name": "ISN2004", "target_crs_code": "EPSG:8089", "target_crs_name": "ISH2004 height", "source": "National Land Survey of Iceland", "source_country": "Iceland", "source_id": "is_lmi", "source_url": "https:\/\/atlas.lmi.is\/LmiData\/index.php?id=626468364600", "description": "ISN2004 (EPSG:5323) to ISH2004 height (EPSG:8089)", "file_size": 453897 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -26.0, 62.5 ], [ -12.0, 62.5 ], [ -12.0, 67.5 ], [ -26.0, 67.5 ], [ -26.0, 62.5 ] ] ] } },
{ "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/is_lmi_Icegeoid_ISN2016.tif", "name": "is_lmi_Icegeoid_ISN2016.tif", "area_of_use": "Iceland", "type": "VERTICAL_OFFSET_GEOGRAPHIC_TO_VERTICAL", "source_crs_code": "EPSG:8085", "source_crs_name": "ISN2016", "target_crs_code": "EPSG:8089", "target_crs_name": "ISH2004 height", "source": "National Land Survey of Iceland", "source_country": "Iceland", "source_id": "is_lmi", "source_url": "https:\/\/atlas.lmi.is\/LmiData\/index.php?id=626468364600", "description": "ISN2016 (EPSG:8085) to ISH2004 height (EPSG:8089)", "file_size": 485351 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -26.0, 62.5 ], [ -12.0, 62.5 ], [ -12.0, 67.5 ], [ -26.0, 67.5 ], [ -26.0, 62.5 ] ] ] } },
{ "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/is_lmi_Icegeoid_ISN93.tif", "name": "is_lmi_Icegeoid_ISN93.tif", "area_of_use": "Iceland", "type": "VERTICAL_OFFSET_GEOGRAPHIC_TO_VERTICAL", "source_crs_code": "EPSG:4945", "source_crs_name": "ISN93", "target_crs_code": "EPSG:8089", "target_crs_name": "ISH2004 height", "source": "National Land Survey of Iceland", "source_country": "Iceland", "source_id": "is_lmi", "source_url": "https:\/\/atlas.lmi.is\/LmiData\/index.php?id=626468364600", "description": "ISN93 (EPSG:4945) to ISH2004 height (EPSG:8089)", "file_size": 484461 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -26.0, 62.5 ], [ -12.0, 62.5 ], [ -12.0, 67.5 ], [ -26.0, 67.5 ], [ -26.0, 62.5 ] ] ] } },
+{ "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/nc_dittt_README.txt", "name": "nc_dittt_README.txt", "source": "Gouvernement de Nouvelle Calédonie - DITTT", "source_country": "New Caledonia", "source_id": "nc_dittt", "source_url": "https:\/\/dittt.gouv.nc\/circe-pour-la-nouvelle-caledonie", "file_size": 2307 }, "geometry": null },
+{ "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/nc_dittt_gr3dnc01b.tif", "name": "nc_dittt_gr3dnc01b.tif", "area_of_use": "New Caledonia", "type": "GEOCENTRIC_TRANSLATION", "source_crs_name": "IGN72 Grande Terre", "target_crs_code": "EPSG:4906", "target_crs_name": "RGNC91-93", "source": "Gouvernement de Nouvelle Calédonie - DITTT", "source_country": "New Caledonia", "source_id": "nc_dittt", "source_url": "https:\/\/dittt.gouv.nc\/circe-pour-la-nouvelle-caledonie", "description": "Geocentric translation from IGN72 GRANDE TERRE (EPSG:4662) to RGNC91-93 (EPSG:4906)", "file_size": 62390 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 163.75, -22.5 ], [ 167.175, -22.5 ], [ 167.175, -19.975 ], [ 163.75, -19.975 ], [ 163.75, -22.5 ] ] ] } },
+{ "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/nc_dittt_gr3dnc02b.tif", "name": "nc_dittt_gr3dnc02b.tif", "area_of_use": "New Caledonia", "type": "GEOCENTRIC_TRANSLATION", "source_crs_name": "IGN72 Grande Terre", "target_crs_code": "EPSG:4906", "target_crs_name": "RGNC91-93", "source": "Gouvernement de Nouvelle Calédonie - DITTT", "source_country": "New Caledonia", "source_id": "nc_dittt", "source_url": "https:\/\/dittt.gouv.nc\/circe-pour-la-nouvelle-caledonie", "description": "Geocentric translation from IGN72 GRANDE TERRE (EPSG:4662) to RGNC91-93 (EPSG:4906)", "file_size": 7975 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 166.29, -22.34 ], [ 166.71, -22.34 ], [ 166.71, -22.1 ], [ 166.29, -22.1 ], [ 166.29, -22.34 ] ] ] } },
+{ "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/nc_dittt_gr3dnc03a.tif", "name": "nc_dittt_gr3dnc03a.tif", "area_of_use": "New Caledonia", "type": "GEOCENTRIC_TRANSLATION", "source_crs_name": "NEA74 Noumea", "target_crs_code": "EPSG:4906", "target_crs_name": "RGNC91-93", "source": "Gouvernement de Nouvelle Calédonie - DITTT", "source_country": "New Caledonia", "source_id": "nc_dittt", "source_url": "https:\/\/dittt.gouv.nc\/circe-pour-la-nouvelle-caledonie", "description": "Geocentric translation from NEA74 Noumea (EPSG:4644) to RGNC91-93 (EPSG:4906)", "file_size": 3274 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 166.36, -22.36 ], [ 166.54, -22.36 ], [ 166.54, -22.14 ], [ 166.36, -22.14 ], [ 166.36, -22.36 ] ] ] } },
{ "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/nl_nsgi_README.txt", "name": "nl_nsgi_README.txt", "source": "Nederlandse Samenwerking Geodetische Infrastructuur (NSGI)", "source_country": "Netherlands", "source_id": "nl_nsgi", "source_url": "https:\/\/www.nsgi.nl\/", "file_size": 952 }, "geometry": null },
{ "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/nl_nsgi_naptrans2018.tif", "name": "nl_nsgi_naptrans2018.tif", "area_of_use": "Netherlands", "type": "VERTICAL_OFFSET_GEOGRAPHIC_TO_VERTICAL", "source_crs_code": "EPSG:4937", "source_crs_name": "ETRS89", "target_crs_code": "EPSG:5709", "target_crs_name": "NAP height", "source": "Nederlandse Samenwerking Geodetische Infrastructuur (NSGI)", "source_country": "Netherlands", "source_id": "nl_nsgi", "source_url": "https:\/\/www.nsgi.nl\/", "description": "ETRS89 (EPSG:4937) to NAP height (EPSG:5709)", "file_size": 249014 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 2.0, 50.0 ], [ 8.0, 50.0 ], [ 8.0, 56.0 ], [ 2.0, 56.0 ], [ 2.0, 50.0 ] ] ] } },
{ "type": "Feature", "properties": { "url": "https:\/\/cdn.proj.org\/nl_nsgi_nlgeo2018.tif", "name": "nl_nsgi_nlgeo2018.tif", "area_of_use": "Netherlands", "type": "VERTICAL_OFFSET_GEOGRAPHIC_TO_VERTICAL", "source_crs_code": "EPSG:4937", "source_crs_name": "ETRS89", "target_crs_code": "EPSG:5709", "target_crs_name": "NAP height", "source": "Nederlandse Samenwerking Geodetische Infrastructuur (NSGI)", "source_country": "Netherlands", "source_id": "nl_nsgi", "source_url": "https:\/\/www.nsgi.nl\/", "description": "ETRS89 (EPSG:4937) to NAP height (EPSG:5709)", "file_size": 248989 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 2.0, 50.0 ], [ 8.0, 50.0 ], [ 8.0, 56.0 ], [ 2.0, 56.0 ], [ 2.0, 50.0 ] ] ] } },
diff --git a/index.html b/index.html
index 8a3ef6a..fa902b4 100644
--- a/index.html
+++ b/index.html
@@ -585,6 +585,11 @@ map.on('singleclick', function(evt) {
<li><a href="is_lmi_Icegeoid_ISN2004.tif">is_lmi_Icegeoid_ISN2004.tif</a> - Iceland - ISN2004 (EPSG:5323) to ISH2004 height (EPSG:8089). Last modified: 2020-01-24</li>
<li><a href="is_lmi_Icegeoid_ISN2016.tif">is_lmi_Icegeoid_ISN2016.tif</a> - Iceland - ISN2016 (EPSG:8085) to ISH2004 height (EPSG:8089). Last modified: 2020-01-24</li>
<li><a href="is_lmi_Icegeoid_ISN93.tif">is_lmi_Icegeoid_ISN93.tif</a> - Iceland - ISN93 (EPSG:4945) to ISH2004 height (EPSG:8089). Last modified: 2020-01-24</li>
+</ul><hr><h3><a href="https://dittt.gouv.nc/circe-pour-la-nouvelle-caledonie">Gouvernement de Nouvelle Calédonie - DITTT</a></h3><ul>
+<li><a href="nc_dittt_README.txt">nc_dittt_README.txt</a>. Last modified: 2020-03-10</li>
+<li><a href="nc_dittt_gr3dnc01b.tif">nc_dittt_gr3dnc01b.tif</a> - New Caledonia - Geocentric translation from IGN72 GRANDE TERRE (EPSG:4662) to RGNC91-93 (EPSG:4906). Last modified: 2020-03-10</li>
+<li><a href="nc_dittt_gr3dnc02b.tif">nc_dittt_gr3dnc02b.tif</a> - New Caledonia - Geocentric translation from IGN72 GRANDE TERRE (EPSG:4662) to RGNC91-93 (EPSG:4906). Last modified: 2020-03-10</li>
+<li><a href="nc_dittt_gr3dnc03a.tif">nc_dittt_gr3dnc03a.tif</a> - New Caledonia - Geocentric translation from NEA74 Noumea (EPSG:4644) to RGNC91-93 (EPSG:4906). Last modified: 2020-03-10</li>
</ul><hr><h3><a href="https://www.nsgi.nl/">Nederlandse Samenwerking Geodetische Infrastructuur (NSGI)</a></h3><ul>
<li><a href="nl_nsgi_README.txt">nl_nsgi_README.txt</a>. Last modified: 2020-01-24</li>
<li><a href="nl_nsgi_naptrans2018.tif">nl_nsgi_naptrans2018.tif</a> - Netherlands - ETRS89 (EPSG:4937) to NAP height (EPSG:5709). Last modified: 2020-01-24</li>
diff --git a/grid_tools/convert_gr3dnc01b.py b/nc_dittt/convert_gr3dnc01b.py
index b3ed17e..c169de0 100755
--- a/grid_tools/convert_gr3dnc01b.py
+++ b/nc_dittt/convert_gr3dnc01b.py
@@ -68,16 +68,33 @@ with open('gr3dnc01b.mnt', 'rt') as f:
ds = gdal.GetDriverByName('GTiff').Create(
'/vsimem/gr3dnc01b.tif', cols, rows, 3, gdal.GDT_Float32)
ds.SetMetadataItem(
- 'TIFFTAG_COPYRIGHT', 'Derived from work by Service Topographique, DITTT, GNC. License unclear')
+ 'TIFFTAG_COPYRIGHT', 'Derived from work by Service Topographique, DITTT, Government of New Caledonia. Open License https://www.etalab.gouv.fr/wp-content/uploads/2014/05/Open_Licence.pdf')
ds.SetMetadataItem('TIFFTAG_IMAGEDESCRIPTION',
- 'Geocentric translation from IGN72 GRANDE TERRE (EPSG:4662) to RGNC91-93 (EPSG:4749). Converted from gr3dnc01b.mnt')
+ 'Geocentric translation from IGN72 GRANDE TERRE (EPSG:4662) to RGNC91-93 (EPSG:4906). Converted from gr3dnc01b.mnt')
datetime = datetime.date.today().strftime("%Y:%m:%d %H:%M:%S")
ds.SetMetadataItem('TIFFTAG_DATETIME', datetime)
ds.SetMetadataItem('AREA_OR_POINT', 'Point')
ds.SetMetadataItem('TYPE', 'GEOCENTRIC_TRANSLATION')
- ds.SetMetadataItem('area_of_use', 'France')
- ds.SetMetadataItem('source_crs_code', '4662')
- ds.SetMetadataItem('target_crs_epsg_code', '4749')
+ ds.SetMetadataItem('area_of_use', 'New Caledonia')
+ ds.SetMetadataItem('source_crs_wkt', """GEODCRS["IGN72 Grande Terre",
+ DATUM["IGN72 Grande Terre",
+ ELLIPSOID["International 1924",6378388,297,
+ LENGTHUNIT["metre",1]],
+ ID["EPSG",6634]],
+ PRIMEM["Greenwich",0,
+ ANGLEUNIT["degree",0.0174532925199433],
+ ID["EPSG",8901]],
+ CS[Cartesian,3],
+ AXIS["(X)",geocentricX,
+ ORDER[1],
+ LENGTHUNIT["metre",1]],
+ AXIS["(Y)",geocentricY,
+ ORDER[2],
+ LENGTHUNIT["metre",1]],
+ AXIS["(Z)",geocentricZ,
+ ORDER[3],
+ LENGTHUNIT["metre",1]]]""")
+ ds.SetMetadataItem('target_crs_epsg_code', '4906')
ds.SetGeoTransform(
[minx - resx/2, resx, 0, maxy + resy/2, 0, -resy])
ds.GetRasterBand(1).SetUnitType('metre')
diff --git a/nc_dittt/convert_gr3dnc02b.py b/nc_dittt/convert_gr3dnc02b.py
new file mode 100755
index 0000000..bb4ed13
--- /dev/null
+++ b/nc_dittt/convert_gr3dnc02b.py
@@ -0,0 +1,138 @@
+#!/usr/bin/env python
+###############################################################################
+# $Id$
+#
+# Project: PROJ
+# Purpose: Convert New Caledonia geocentric gr3dnc02b.mnt grid
+# Author: Even Rouault <even.rouault at spatialys.com>
+#
+###############################################################################
+# Copyright (c) 2019, Even Rouault <even.rouault at spatialys.com>
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+###############################################################################
+
+from osgeo import gdal
+from osgeo import osr
+import datetime
+import struct
+
+with open('gr3dnc02b.mnt', 'rt') as f:
+ count_val_rows = 0
+ line_no = 0
+ for l in f.readlines():
+ if l[-1] == '\n':
+ l = l[0:-1]
+ if l[-1] == '\r':
+ l = l[0:-1]
+ if not l:
+ continue
+ if line_no == 0:
+ tokens = []
+ for t in l.split(' '):
+ if t:
+ tokens.append(t)
+ assert len(tokens) >= 13
+ minx = float(tokens[0])
+ maxx = float(tokens[1])
+ miny = float(tokens[2])
+ maxy = float(tokens[3])
+ resx = float(tokens[4])
+ resy = float(tokens[5])
+ assert minx < maxx
+ assert miny < maxy
+ assert resx > 0
+ assert resy > 0
+ cols = 1 + (maxx - minx) / resx
+ assert cols - int(cols + 0.5) < 1e-10
+ cols = int(cols + 0.5)
+ rows = 1 + (maxy - miny) / resy
+ assert rows - int(rows + 0.5) < 1e-10
+ rows = int(rows + 0.5)
+ ds = gdal.GetDriverByName('GTiff').Create(
+ '/vsimem/gr3dnc02b.tif', cols, rows, 3, gdal.GDT_Float32)
+ ds.SetMetadataItem(
+ 'TIFFTAG_COPYRIGHT', 'Derived from work by Service Topographique, DITTT, Government of New Caledonia. Open License https://www.etalab.gouv.fr/wp-content/uploads/2014/05/Open_Licence.pdf')
+ ds.SetMetadataItem('TIFFTAG_IMAGEDESCRIPTION',
+ 'Geocentric translation from IGN72 GRANDE TERRE (EPSG:4662) to RGNC91-93 (EPSG:4906). Converted from gr3dnc01b.mnt')
+ datetime = datetime.date.today().strftime("%Y:%m:%d %H:%M:%S")
+ ds.SetMetadataItem('TIFFTAG_DATETIME', datetime)
+ ds.SetMetadataItem('AREA_OR_POINT', 'Point')
+ ds.SetMetadataItem('TYPE', 'GEOCENTRIC_TRANSLATION')
+ ds.SetMetadataItem('area_of_use', 'New Caledonia')
+ ds.SetMetadataItem('source_crs_wkt', """GEODCRS["IGN72 Grande Terre",
+ DATUM["IGN72 Grande Terre",
+ ELLIPSOID["International 1924",6378388,297,
+ LENGTHUNIT["metre",1]],
+ ID["EPSG",6634]],
+ PRIMEM["Greenwich",0,
+ ANGLEUNIT["degree",0.0174532925199433],
+ ID["EPSG",8901]],
+ CS[Cartesian,3],
+ AXIS["(X)",geocentricX,
+ ORDER[1],
+ LENGTHUNIT["metre",1]],
+ AXIS["(Y)",geocentricY,
+ ORDER[2],
+ LENGTHUNIT["metre",1]],
+ AXIS["(Z)",geocentricZ,
+ ORDER[3],
+ LENGTHUNIT["metre",1]]]""")
+ ds.SetMetadataItem('target_crs_epsg_code', '4906')
+ ds.SetGeoTransform(
+ [minx - resx/2, resx, 0, maxy + resy/2, 0, -resy])
+ ds.GetRasterBand(1).SetUnitType('metre')
+ ds.GetRasterBand(1).SetDescription('x_translation')
+ ds.GetRasterBand(2).SetUnitType('metre')
+ ds.GetRasterBand(2).SetDescription('y_translation')
+ ds.GetRasterBand(3).SetUnitType('metre')
+ ds.GetRasterBand(3).SetDescription('z_translation')
+ sr = osr.SpatialReference()
+ sr.ImportFromEPSG(4749)
+ ds.SetProjection(sr.ExportToWkt())
+ else:
+ tokens = []
+ for t in l.split('\t'):
+ if t:
+ tokens.append(t)
+ assert len(tokens) == 6
+ lon = float(tokens[0])
+ lat = float(tokens[1])
+ dx = float(tokens[2])
+ dy = float(tokens[3])
+ dz = float(tokens[4])
+ iy = (line_no - 1) % rows
+ ix = (line_no - 1) // rows
+ assert abs(lon - (minx + ix * resx)
+ ) < 1e-10, (line_no, lon, minx + ix * resx)
+ assert abs(lat - (miny + iy * resy)
+ ) < 1e-10, (line_no, lat, miny + iy * resy)
+ ds.GetRasterBand(1).WriteRaster(
+ ix, rows - iy - 1, 1, 1, struct.pack('f', dx))
+ ds.GetRasterBand(2).WriteRaster(
+ ix, rows - iy - 1, 1, 1, struct.pack('f', dy))
+ ds.GetRasterBand(3).WriteRaster(
+ ix, rows - iy - 1, 1, 1, struct.pack('f', dz))
+ count_val_rows += 1
+
+ line_no += 1
+
+ assert count_val_rows == rows * cols
+ gdal.GetDriverByName('GTiff').CreateCopy('gr3dnc02b.tif', ds, options=[
+ 'COMPRESS=DEFLATE', 'PREDICTOR=3', 'INTERLEAVE=BAND'])
diff --git a/grid_tools/convert_gr3dnc03a.py b/nc_dittt/convert_gr3dnc03a.py
index 85c35a3..c8db270 100755
--- a/grid_tools/convert_gr3dnc03a.py
+++ b/nc_dittt/convert_gr3dnc03a.py
@@ -68,16 +68,33 @@ with open('gr3dnc03a.mnt', 'rt') as f:
ds = gdal.GetDriverByName('GTiff').Create(
'/vsimem/gr3dnc03a.tif', cols, rows, 3, gdal.GDT_Float32)
ds.SetMetadataItem(
- 'TIFFTAG_COPYRIGHT', 'Derived from work by Service Topographique, DITTT, GNC. License unclear')
+ 'TIFFTAG_COPYRIGHT', 'Derived from work by Service Topographique, DITTT, Government of New Caledonia. Open License https://www.etalab.gouv.fr/wp-content/uploads/2014/05/Open_Licence.pdf')
ds.SetMetadataItem('TIFFTAG_IMAGEDESCRIPTION',
- 'Geocentric translation from NEA74 Noumea (EPSG:4644) to RGNC91-93 (EPSG:4749). Converted from gr3dnc03a.mnt')
+ 'Geocentric translation from NEA74 Noumea (EPSG:4644) to RGNC91-93 (EPSG:4906). Converted from gr3dnc03a.mnt')
datetime = datetime.date.today().strftime("%Y:%m:%d %H:%M:%S")
ds.SetMetadataItem('TIFFTAG_DATETIME', datetime)
ds.SetMetadataItem('AREA_OR_POINT', 'Point')
ds.SetMetadataItem('TYPE', 'GEOCENTRIC_TRANSLATION')
- ds.SetMetadataItem('area_of_use', 'France')
- ds.SetMetadataItem('source_crs_code', '4644')
- ds.SetMetadataItem('target_crs_epsg_code', '4749')
+ ds.SetMetadataItem('area_of_use', 'New Caledonia')
+ ds.SetMetadataItem('source_crs_wkt', """GEODCRS["NEA74 Noumea",
+ DATUM["NEA74 Noumea",
+ ELLIPSOID["International 1924",6378388,297,
+ LENGTHUNIT["metre",1]],
+ ID["EPSG",6644]],
+ PRIMEM["Greenwich",0,
+ ANGLEUNIT["degree",0.0174532925199433],
+ ID["EPSG",8901]],
+ CS[Cartesian,3],
+ AXIS["(X)",geocentricX,
+ ORDER[1],
+ LENGTHUNIT["metre",1]],
+ AXIS["(Y)",geocentricY,
+ ORDER[2],
+ LENGTHUNIT["metre",1]],
+ AXIS["(Z)",geocentricZ,
+ ORDER[3],
+ LENGTHUNIT["metre",1]]]""")
+ ds.SetMetadataItem('target_crs_epsg_code', '4906')
ds.SetGeoTransform(
[minx - resx/2, resx, 0, maxy + resy/2, 0, -resy])
ds.GetRasterBand(1).SetUnitType('metre')
diff --git a/nc_dittt/nc_dittt_README.txt b/nc_dittt/nc_dittt_README.txt
new file mode 100644
index 0000000..e3a0809
--- /dev/null
+++ b/nc_dittt/nc_dittt_README.txt
@@ -0,0 +1,33 @@
+# nc_dittt_README.txt
+
+The files in this section result from the conversion of datasets originating
+from [Gouvernement de la Nouvelle-Calédonie – DITTT](https://dittt.gouv.nc/circe-pour-la-nouvelle-caledonie)
+
+## Included grids
+
+### New Caledonia: IGN72 GRANDE TERRE (EPSG:4662) to RGNC91-93 (EPSG:4906) (using Geocentric correction)
+
+*Source*: Gouvernement de la Nouvelle-Calédonie – DITTT](https://dittt.gouv.nc/circe-pour-la-nouvelle-caledonie)
+*Format*: GeoTIFF converted from .mnt file with convert_gr3dnc01b.py
+*License*: [License Ouverte (in French)](https://www.etalab.gouv.fr/wp-content/uploads/2017/04/ETALAB-Licence-Ouverte-v2.0.pdf) / [Open License (English translation)](https://www.etalab.gouv.fr/wp-content/uploads/2014/05/Open_Licence.pdf)
+*Used by*: [EPSG:9329 Transformation](https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:coordinateOperation:EPSG::9329)
+
+* nc_dittt_gr3dnc01b.tif
+
+### New Caledonia - Noumea: IGN72 GRANDE TERRE (EPSG:4662) to RGNC91-93 (EPSG:4906) (using Geocentric correction)
+
+*Source*: Gouvernement de la Nouvelle-Calédonie – DITTT](https://dittt.gouv.nc/circe-pour-la-nouvelle-caledonie)
+*Format*: GeoTIFF converted from .mnt file with convert_gr3dnc02b.py
+*License*: [License Ouverte (in French)](https://www.etalab.gouv.fr/wp-content/uploads/2017/04/ETALAB-Licence-Ouverte-v2.0.pdf) / [Open License (English translation)](https://www.etalab.gouv.fr/wp-content/uploads/2014/05/Open_Licence.pdf)
+*Used by*: [EPSG:9330 Transformation](https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:coordinateOperation:EPSG::9330)
+
+* nc_dittt_gr3dnc02b.tif
+
+### New Caledonia - Noumea: NEA74 Noumea (EPSG:4644) to RGNC91-93 (EPSG:4906) (using Geocentric correction)
+
+*Source*: Gouvernement de la Nouvelle-Calédonie – DITTT](https://dittt.gouv.nc/circe-pour-la-nouvelle-caledonie)
+*Format*: GeoTIFF converted from .mnt file with convert_gr3dnc03a.py
+*License*: [License Ouverte (in French)](https://www.etalab.gouv.fr/wp-content/uploads/2017/04/ETALAB-Licence-Ouverte-v2.0.pdf) / [Open License (English translation)](https://www.etalab.gouv.fr/wp-content/uploads/2014/05/Open_Licence.pdf)
+*Used by*: [EPSG:9328 Transformation](https://www.epsg-registry.org/export.htm?gml=urn:ogc:def:coordinateOperation:EPSG::9328)
+
+* nc_dittt_gr3dnc03a.tif
diff --git a/nc_dittt/nc_dittt_gr3dnc01b.tif b/nc_dittt/nc_dittt_gr3dnc01b.tif
new file mode 100644
index 0000000..ca8c779
--- /dev/null
+++ b/nc_dittt/nc_dittt_gr3dnc01b.tif
Binary files differ
diff --git a/nc_dittt/nc_dittt_gr3dnc02b.tif b/nc_dittt/nc_dittt_gr3dnc02b.tif
new file mode 100644
index 0000000..96c2c89
--- /dev/null
+++ b/nc_dittt/nc_dittt_gr3dnc02b.tif
Binary files differ
diff --git a/nc_dittt/nc_dittt_gr3dnc03a.tif b/nc_dittt/nc_dittt_gr3dnc03a.tif
new file mode 100644
index 0000000..786da45
--- /dev/null
+++ b/nc_dittt/nc_dittt_gr3dnc03a.tif
Binary files differ
diff --git a/regenerate_index_html.py b/regenerate_index_html.py
index 06fbb28..e75bdb0 100755
--- a/regenerate_index_html.py
+++ b/regenerate_index_html.py
@@ -60,7 +60,7 @@ for dirname in sorted(dirnames):
readme_filename = None
for f in glob.glob(dirname + '/*'):
f = os.path.basename(f)
- if f.endswith('.sh'):
+ if f.endswith('.sh') or f.endswith('.py'):
continue
if f.endswith('README.txt'):
diff --git a/travis/expected_main.lst b/travis/expected_main.lst
index 801849b..5a39017 100644
--- a/travis/expected_main.lst
+++ b/travis/expected_main.lst
@@ -136,6 +136,10 @@ is_lmi_ISN2004_ISN2016.tif
is_lmi_ISN93_ISN2016.tif
is_lmi_ISN_vel_beta.tif
is_lmi_README.txt
+nc_dittt_gr3dnc01b.tif
+nc_dittt_gr3dnc02b.tif
+nc_dittt_gr3dnc03a.tif
+nc_dittt_README.txt
NKG
nl_nsgi_naptrans2018.tif
nl_nsgi_nlgeo2018.tif