Opened 13 years ago

Closed 12 years ago

#3929 closed enhancement (fixed)

[PATCH] Support for all Ozi datums

Reported by: jcrepetto Owned by: Even Rouault
Priority: normal Milestone: 1.10.0
Component: OGR_SRS Version: 1.8.0
Severity: normal Keywords: OZI
Cc:

Description

The current GDAL version supports only 3 datums in Oziexplorer .map files, while OziExplorer supports 123 datums.

The attached patch adds support for all OziExplorer datums. It uses two new files in the GDAL data directory :

  • ozi_ellips.csv contains the ellipsoid definitions
  • ozi_datum.csv contains the datum definitions

The structure of ozi_ellips.csv is straightforward :

  ELLIPSOID_CODE,NAME,A,INVF
  0,Airy 1830,6377563.396,299.3249646
  1,Modified Airy,6377340.189,299.3249646
  ...

The structure of ozi_datum.csv deserves some explanations :

  NAME,EPSG_DATUM_CODE,ELLIPSOID_CODE,DELTAX,DELTAY,DELTAZ
  Adindan,4201,5,-162,-12,206    # Africa - Eritrea, Ethiopia and Sudan
  ...
  DOS 1968,,14,230,-199,-752              # Gizo Island
  Easter Island 1967,4719,14,211,147,111
  Egypt,,14,-130,-117,-151                # EPSG 4199
  ...
  Hermannskogel,3906,3,653,-212,449       # GDAL uses 682,-203,480
  ...
  NAD27 Alaska,,4,-5,135,172    # EPSG:1176 Coordinate Transformation
  NAD27 Bahamas,,4,-4,154,178   # EPSG:1177 Coordinate Transformation
  ...
  South Asia,,8,7,-10,-26       # Singapore (unknown EPSG code)

The second column contains the EPSG code, but the following columns also contain the ellipsoid code and the 3-parameters transformation values.
This is necessary, because for some datums used in OziExplorer :

  • either there is no equivalent EPSG code : South Asia (Singapore)
  • either GDAL doesn't know the 3 parameters : Egypt (EPSG:4199)
  • either there are several transformation parameters, and GDAL and OziExplorer are not using the same ones : DOS 1968 (Solomon Islands), where OziExplorer uses the transformation for the Gizo island (EPSG:15805), while GDAL uses the transformation for the Guadalcanal island (EPSG:15807)
  • or there are several transformations for the same datum, and it is not possible for GDAL to know from the EPSG code which transformation must be used : NAD27, Narwhan, ED50, etc...

Storing the datums in data files instead of source code has two advantages :

  • users can add custom datums and ellipsoids (they can do it in OziExplorer)
  • users can get exactly the same results with GDAL than with OziExplorer, if they wish. For example, for the Hermannskogel datum, the transformation parameters differ. If a user wants GDAL to use the OziExplorer parameters, all he has to do is to remove the EPSG code from the ozi_datum.csv file :
       Hermannskogel,,3,653,-212,449
    

and GDAL will use 653,-212,449 instead of 682,-203,480 .

Provenance of the data files

I have created both files, they have not been taken from any other software.

The ellipsoid parameters are standard, and the list of ellipsoids supported by OziExplorer is displayed in the help page of OziExplorer (in the section : "Adding User Datums").

The datums names are exactly the sames as those displayed by OziExplorer (Menu : Display, Datum Parameters). This is necessary for the string comparisons to succeed when parsing .map files. The 3-parameters transformation value are those displayed by OziExplorer (Menu : Display, Datum Parameters). They have been copied manually to the ozi_datums.csv file. Most of these parameters (and the datum names) are the same as in the datum list from the NGA, this is probably where the OziExplorer author found them.

I have put the area names in comments, they come from the EPSG database.

Attachments (1)

gdal-ozidatums.patch (16.5 KB ) - added by jcrepetto 12 years ago.
Updated patch

Download all attachments as: .zip

Change History (8)

comment:1 by warmerdam, 12 years ago

I have sent the following email to info@… to seek permission to use the files.

Dear Ozi Explorer,

I am a developer on the GDAL/OGR open source geospatial data access library project (http://www.gdal.org). This library has had some support for reading OziExplorer files for some time, but with limited support for coordinate systems. We have received a contributed improvement that resolves this, but to do so it adds two new files with lists of OziExplorer datums and ellipsoids.

This information was manually collected from the OziExplorer help and interfaces as I understand it. The contribution is available at:

http://trac.osgeo.org/gdal/attachment/ticket/3929/gdal-ozidatums.patch

The discussion of the improvements is at:

http://trac.osgeo.org/gdal/ticket/3929

Our project tries to avoid any possible concerns about copyright infringement and I feel this falls into a gray area. So I am seeking permission from someone in an official capacity to incorporate these datum and ellipsoid lists into the GDAL project under the normal GDAL open source license terms:

""" 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. """

Doing so would help ensure broader support for the OziExplorer format. An email grant of permission would be sufficient.

comment:2 by warmerdam, 12 years ago

OK, we are good to go. Please add a note in a comment in each file that we have permission from Des Newman on behalf of OziExplorer to use the lists.

Hi Frank,

You have my permission to use the OziExplorer datum and ellipsoid lists in GDAL.

regards
Des Newman

by jcrepetto, 12 years ago

Attachment: gdal-ozidatums.patch added

Updated patch

comment:3 by Even Rouault, 12 years ago

Component: GDAL_RasterOGR_SRS
Milestone: 1.8.12.0.0
Owner: changed from warmerdam to Even Rouault

comment:4 by Even Rouault, 12 years ago

Jean-Claude,

I've started integrating your patch and I've noticed something that must be confirmed. For example, if I test with "Tokyo" as a datum name. In ozi_datum.csv, on the Tokyo line, you have EPSG code = 4301. Then in your patch we try to resolve EPSG:4301, which is known by GDAL. So we fully expand the EPSG:4301 as the GEOGCS. With current EPSG database used by GDAL, this is :

GEOGCS["Tokyo",DATUM["Tokyo",SPHEROID["Bessel 1841",6377397.155,299.1528128,AUTHORITY["EPSG","7004"]],TOWGS84[-146.414,507.337,680.507,0,0,0,0],AUTHORITY["EPSG","6301"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4301"]]

However, you can note that the TOWGS84 shift of EPSG:4301 (-146.414,507.337,680.507) doesn't match the one in ozi_datum.csv proposed for Tokyo (-128,481,664).

It doesn't seem completely shoking to do so, but I just wanted to be sure you were aware of that.

comment:5 by jcrepetto, 12 years ago

Even,

I explained this feature in the ticket description :

users can get exactly the same results with GDAL than with OziExplorer, if they wish. For example, for the Hermannskogel datum, the transformation parameters differ. If a user wants GDAL to use the OziExplorer parameters, all he has to do is to remove the EPSG code from the ozi_datum.csv file :

Hermannskogel,,3,653,-212,449

and GDAL will use 653,-212,449 instead of 682,-203,480 .

So if you remove the EPSG code on the Tokyo line, you should see the OziExplorer transformation parameters.

I gave priority to the EPSG parameters because they are more up-to-date than the OziExplorer parameters.

May be I should add a note in the ozi_datums.csv file, what do you think ?

comment:6 by Even Rouault, 12 years ago

Jean-Claude, sorry for not having re-read more carefully your patch description. This is all clear now. I'll indeed add a note in the header of ozi_datums.csv so that it is clear for a new comer too.

comment:7 by Even Rouault, 12 years ago

Resolution: fixed
Status: newclosed

r23921 /trunk/ (7 files in 6 dirs): Ozi datum support: add 2 new data files (ozi_datum.csv, ozi_ellips.csv) to support all Ozi datums (patch contributed by Jean-Claude Repetto, #3929)

Note: See TracTickets for help on using tickets.