diffs for .shp

ender at titan.lab.csuchico.edu ender at titan.lab.csuchico.edu
Fri Aug 18 09:56:39 EDT 2000



I made a little change to mapshape.c that allows you to use:

DATA whatever/shapefile.shp

in the mapfile, instead of these shapes just being ignored.  I find that I
still do this, even though I've been using mapserver for several years
now.

Anyway, here's the diff file.

-Aaron


1166c1166,1167
<   char *dbfFilename;
---
>   int i;
>   char * dbfFilename;
1195,1197c1196,1209
<
<   dbfFilename = (char *)malloc(strlen(filename)+5);
<   sprintf(dbfFilename, "%s.dbf", filename);
---
>
>   dbfFilename = (char*)malloc(strlen(filename)+5);
>   strcpy(dbfFilename, filename);
>
>   /* clean off any extention the filename might have */
>   for (i = strlen(dbfFilename) - 1;
>        i > 0 && dbfFilename[i] != '.' && dbfFilename[i] != '/'
>          && dbfFilename[i] != '\\';
>        i-- ) {}
>
>   if( dbfFilename[i] == '.' )
>     dbfFilename[i] = '\0';
>
>   strcat(dbfFilename, ".dbf");

(See attached file: mapshape.dif)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mapshape.dif
Type: application/octet-stream
Size: 641 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20000818/f387e285/mapshape.obj


More information about the mapserver-users mailing list