Hi Markus,

On 04/25/2016 11:27 PM, Markus Neteler wrote:

I have now submitted the changes along with the addition of some code
comments as per your emails in:
https://trac.osgeo.org/grass/changeset/68308

Hope I got it right! If yes, I'll backport that.

Yes, that all looks correct to me.

Now I have recompiled trunk and made a new test with SIRGAS2000 (seems
to be an interesting test case besides Krovak):

grass71 -c epsg:4674 ~/grassdata/SIRGAS2000

GRASS 7.1.svn (SIRGAS2000):~ > g.proj -w
PROJCS["SIRGAS 2000",
     GEOGCS["grs80",
         DATUM["Sistema_de_Referencia_Geocentrico_para_las_AmericaS_2000",
             SPHEROID["Geodetic_Reference_System_1980",6378137,298.257222101]],
         PRIMEM["Greenwich",0],
         UNIT["degree",0.0174532925199433]]]

... which still differs from ...

GRASS 7.1.svn (SIRGAS2000):~ > testepsg epsg:4674
Validate Succeeds.
WKT[epsg:4674] =
GEOGCS["SIRGAS 2000",
     DATUM["Sistema_de_Referencia_Geocentrico_para_las_AmericaS_2000",
         SPHEROID["GRS 1980",6378137,298.257222101,
             AUTHORITY["EPSG","7019"]],
         TOWGS84[0,0,0,0,0,0,0],
         AUTHORITY["EPSG","6674"]],
     PRIMEM["Greenwich",0,
         AUTHORITY["EPSG","8901"]],
     UNIT["degree",0.0174532925199433,
         AUTHORITY["EPSG","9122"]],
     AUTHORITY["EPSG","4674"]]
...

The main difference is that GRASS actually generates it as PROJCS
while GDAL generates it as GEOGCS. Hence a reverse test of the g.proj
output checked in testepsg fails at time.

The code handling this was changed pretty recently: https://trac.osgeo.org/grass/changeset/68131/

Simply deleting three lines from that revision fixes it for me (see below) - the PROJCS name seems to be being set unconditionally even when it's not a projected co-ordinate system. Deleting this doesn't seem to cause any regression as the PROJCS name is already set later in the GPJ_grass_to_osr() function.

I haven't committed it as it should probably be tested first with a few different types of co-ordinate system, and I don't have time for that at the minute unfortunately.

Paul


--- lib/proj/convert.c  (revision 68310)
+++ lib/proj/convert.c  (working copy)
@@ -141,9 +141,6 @@
        return NULL;
     }
     G_free(proj4mod);
-    sysname = G_find_key_value("name", proj_info);
-    if (sysname)
-       OSRSetProjCS(hSRS, sysname);

     if ((errcode = OSRExportToWkt(hSRS, &wkt)) != OGRERR_NONE) {
        G_warning(_("OGR can't get WKT-style parameter string "

_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to