Skip to content

Commit

Permalink
Support for CRS URI format http://www.openis.net/gml/srs/epsg.xml#xxx
Browse files Browse the repository at this point in the history
…as specified in WFS
  • Loading branch information
ejn authored and mkofahl committed Apr 11, 2013
1 parent b2fd2ee commit a7841c3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions mapfile.c
Expand Up @@ -1602,6 +1602,19 @@ int msLoadProjectionString(projectionObj *p, const char *value)
p->args = (char**)msSmallMalloc(sizeof(char*) * 2);
p->args[0] = msStrdup(init_string);
p->numargs = 1;
/* Mandatory support for this URI format specified in WFS1.1 (also in 1.0?) */
} else if (EQUALN("http://www.opengis.net/gml/srs/epsg.xml#", value, 40)) {
/* We assume always lon/lat ordering, as that is what GeoServer does... */
const char *code;

code = value + 40;

p->args = (char **) msSmallMalloc(sizeof(char *));
/* translate into PROJ.4 format as we go */
p->args[0] = (char *) msSmallMalloc(11 + strlen(code));
snprintf(p->args[0], 11 + strlen(code), "init=epsg:%s", code);
p->numargs = 1;

} else if (strncasecmp(value, "CRS:",4) == 0 ) {
char init_string[100];
init_string[0] = '\0';
Expand Down

0 comments on commit a7841c3

Please sign in to comment.