Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0, 2.2.M0
    • Fix Version/s: 2.1.1, 2.2-RC0
    • Component/s: referencing
    • Labels:
      None
    • Environment:
      UDIG 1.0.4

      Description

      From email:

      I have a problem trying to select one of the coordinate systems that we work with though. The "NZGD49 / New Zealand Map Grid (EPSG:27200)" won't work when I select it. If I double click it in the CS dialog the dialog closes but the map CS doesn't change. If I select it and then click "Apply" it doesn't complain, but when I click OK the OK button disables and the dialog remains. I then have to click Cancel to return to the map (selecting another CS doesn't enable the OK button).

      Also, when I select the "Custom CRS" tab the details remain the same as the previous CS, rather than changing like the others do.

      Comments:

      • it really must be a problem with the WKT

      WKT from http://svn.geotools.org/geotools/branches/2.1.x/plugin/epsg-wkt/src/org/geotools/referencing/crs/epsg.properties:

      27200=PROJCS["NZGD49 / New Zealand Map Grid",
      GEOGCS["NZGD49",
      DATUM["New_Zealand_Geodetic_Datum_1949",
      SPHEROID["International 1924",6378388,297,AUTHORITY["EPSG","7022"]],
      TOWGS84[59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993],
      AUTHORITY["EPSG","6272"]],
      PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],
      UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],
      AUTHORITY["EPSG","4272"]],
      PROJECTION["New_Zealand_Map_Grid"],
      PARAMETER["latitude_of_origin",-41],
      PARAMETER["central_meridian",173],
      PARAMETER["false_easting",2510000],
      PARAMETER["false_northing",6023150],
      UNIT["metre",1,AUTHORITY["EPSG","9001"]],
      AUTHORITY["EPSG","27200"]]

      1. NewZealandMapGrid.txt
        3 kB
        Rueben Schulz
      2. PJ_nzmg.c
        4 kB
        Mark Presling

        Activity

        Hide
        Martin Desruisseaux added a comment -
        This is caused by the projection method used there (the name inside the PROJECTION["..."] statement), which is "New_Zealand_Map_Grid". A projection method is usually something like "Mercator_2SP" or "Albers_Conic_Equal_Area" (for example). Geotools doesn't know the "New_Zealand_Map_Grid" method, which seems to be something particular to New Zeland.

        The "New_Zealand_Map_Grid" method name suggests that this method requires a grid, probably defined in some extenal files. Unfortunatly, I do not have any information on such grid (I had a quick look in EPSG database version 6.7, which sometime contains links toward such grids. But I didn't found any such links for this projection).

        Supporting this method in Geotools would requires some volunter work:

           * Get information about "New_Zealand_Map_Grid" from the New Zeland mapping agency.
           * If some grids are required, download the grids.
           * Write a new org.opengis.referencing.operation.MathTransform implementation for this projection.

        Note that Rueben's work on NADCON transforms may be used as a starting point, since it also uses a grid. Actually, we should probably try to make the NADCON transform more general in order to accept grids from other area than North America. New Zeland is an example. New Caledonia is an other example where this kind of grid is in use.
        Show
        Martin Desruisseaux added a comment - This is caused by the projection method used there (the name inside the PROJECTION["..."] statement), which is "New_Zealand_Map_Grid". A projection method is usually something like "Mercator_2SP" or "Albers_Conic_Equal_Area" (for example). Geotools doesn't know the "New_Zealand_Map_Grid" method, which seems to be something particular to New Zeland. The "New_Zealand_Map_Grid" method name suggests that this method requires a grid, probably defined in some extenal files. Unfortunatly, I do not have any information on such grid (I had a quick look in EPSG database version 6.7, which sometime contains links toward such grids. But I didn't found any such links for this projection). Supporting this method in Geotools would requires some volunter work:    * Get information about "New_Zealand_Map_Grid" from the New Zeland mapping agency.    * If some grids are required, download the grids.    * Write a new org.opengis.referencing.operation.MathTransform implementation for this projection. Note that Rueben's work on NADCON transforms may be used as a starting point, since it also uses a grid. Actually, we should probably try to make the NADCON transform more general in order to accept grids from other area than North America. New Zeland is an example. New Caledonia is an other example where this kind of grid is in use.
        Hide
        Martin Desruisseaux added a comment -
        Note that attemps to create a CRS with unknow projection methods results in a org.opengis.referencing.NoSuchIdentifierException to be thrown. This exception contains a getIdentifierCode() method, which returns the unknown projection name. This method should returns "New_Zealand_Map_Grid" in this particular case. This information may be of some help for providing feedback to users in a GUI.
        Show
        Martin Desruisseaux added a comment - Note that attemps to create a CRS with unknow projection methods results in a org.opengis.referencing.NoSuchIdentifierException to be thrown. This exception contains a getIdentifierCode() method, which returns the unknown projection name. This method should returns "New_Zealand_Map_Grid" in this particular case. This information may be of some help for providing feedback to users in a GUI.
        Hide
        Martin Desruisseaux added a comment -
        Link provided by Paul Pramsey: http://www.govt.nz/record?recordid=3030
        Show
        Martin Desruisseaux added a comment - Link provided by Paul Pramsey: http://www.govt.nz/record?recordid=3030
        Hide
        Jody Garnett added a comment -
        Hey Justin your ship has come in :-) This is even the projection you wanted to implement after talking with Rueben ....
        Show
        Jody Garnett added a comment - Hey Justin your ship has come in :-) This is even the projection you wanted to implement after talking with Rueben ....
        Hide
        Mark Presling added a comment -
        Hi. I use PostGIS for our spatial backend and I know that they have support for transforming to/from 27200. I did some poking around and found that this support comes from the PROJ4 library. I have attached the C source file that appears to have the algorithms in for this projection method.

        I wish I could help more, but this is way over my head... if the C file helps in any way then good, otherwise just ignore it.

        I was the one that brought up the issue with Jody originally, so I will keep monitoring this to see how you are getting on. If you need any more info about NZMG I can probably track it down through our local Government agency.

        Cheers,
        Mark
        Show
        Mark Presling added a comment - Hi. I use PostGIS for our spatial backend and I know that they have support for transforming to/from 27200. I did some poking around and found that this support comes from the PROJ4 library. I have attached the C source file that appears to have the algorithms in for this projection method. I wish I could help more, but this is way over my head... if the C file helps in any way then good, otherwise just ignore it. I was the one that brought up the issue with Jody originally, so I will keep monitoring this to see how you are getting on. If you need any more info about NZMG I can probably track it down through our local Government agency. Cheers, Mark
        Hide
        Rueben Schulz added a comment -
        I attached NewZealandMapGrid.txt, which can be used to test this projection once it is implemented.

        It can be run with org.geotools.referencing.TestScript <full name of test script>
        Show
        Rueben Schulz added a comment - I attached NewZealandMapGrid.txt, which can be used to test this projection once it is implemented. It can be run with org.geotools.referencing.TestScript <full name of test script>
        Hide
        Martin Desruisseaux added a comment -
        Since we got no negative feedback in one year, I assume that this projection work as expected and that the issue can be closed as fixed.
        Show
        Martin Desruisseaux added a comment - Since we got no negative feedback in one year, I assume that this projection work as expected and that the issue can be closed as fixed.

          People

          • Assignee:
            Justin Deoliveira
            Reporter:
            Jody Garnett
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: