[Mapserver-commits] r7123 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Thu Nov 29 17:43:23 EST 2007


Author: warmerdam
Date: 2007-11-29 17:43:23 -0500 (Thu, 29 Nov 2007)
New Revision: 7123

Modified:
   trunk/mapserver/mapfile.c
Log:
preliminary support for EPSG: and urns in msLoadProjectionString() (for WCS 1.1)

Modified: trunk/mapserver/mapfile.c
===================================================================
--- trunk/mapserver/mapfile.c	2007-11-29 19:00:37 UTC (rev 7122)
+++ trunk/mapserver/mapfile.c	2007-11-29 22:43:23 UTC (rev 7123)
@@ -1077,6 +1077,35 @@
       p->args[0] = strdup(value);
       p->numargs = 1;
   }
+  else if (strncasecmp(value, "EPSG:", 5) == 0)
+  {
+      char init_string[100];
+
+      /* translate into PROJ.4 format. */
+      sprintf( init_string, "init=epsg:%s", value+5 );
+
+      p->args = (char**)malloc(sizeof(char*));
+      p->args[0] = strdup(init_string);
+      p->numargs = 1;
+  }
+  else if (strncasecmp(value, "urn:ogc:def:crs:EPSG:",21) == 0)
+  { /* this is very preliminary urn support ... expand later */ 
+      char init_string[100];
+      const char *code;
+
+      code = value + 21;
+      while( *code != ':' && *code != '\0' )
+          code++;
+      if( *code == ':' )
+          code++;
+
+      /* translate into PROJ.4 format. */
+      sprintf( init_string, "init=epsg:%s", code );
+
+      p->args = (char**)malloc(sizeof(char*));
+      p->args[0] = strdup(init_string);
+      p->numargs = 1;
+  }
   /*
    * Handle old style comma delimited.  eg. "proj=utm,zone=11,ellps=WGS84".
    */



More information about the mapserver-commits mailing list