Opened 20 years ago

Closed 16 years ago

#599 closed defect (fixed)

Shapefile API (mapshape.c) needs to be cleaned up.

Reported by: sdlime Owned by: tomkralidis
Priority: high Milestone: 5.2 release
Component: MapServer C Library Version: 4.1
Severity: normal Keywords:
Cc: sgillies@…, tomkralidis, dmorissette

Description

The naming of functions in that code (my shapefileObj specific functions, not
Frank's original API) is horrendous (sp?). msSHPOpenFile should be
msShapefileOpen and so on. The changes are simple but touch the 2 MapScript
API's. Anyone see any problems?

Change History (7)

comment:1 by dmorissette, 20 years ago

I'm not sure how the SWIG MapScript exports the mapshape.c functions and/or how
they are used, but the PHP MapScript doesn't use them: we only have the
shapeFileObj and its methods in PHP MapScript.

comment:2 by sdlime, 20 years ago

I did a grep in the PHP stuff and functions like msSHPOpenFile are used. That's 
the shapefileObj opener and one of the candidates for renaming. All of Franks's 
original functions are msSHP... and for some reason I stayed with that 
convention when they really should be msShapefile...

Steve

comment:3 by dmorissette, 20 years ago

The implementation of PHP MapScript uses msSHPopenFile() and family, but they
are not visible directly to the mapscript users, so it's really easy to make the
switch and that won't affect users: it's just a matter of applying the same
changes in mapscript/php3/mapscritp_i.c that you would apply to mapscript.i...
about 10 lines to change.

comment:4 by tomkralidis, 16 years ago

Cc: tomkralidis added
Milestone: 5.2 release

I've changed the following function names (not committed yet):

msSHPOpenFile -> msShapefileOpen
msSHPCreateFile -> msShapefileCreate
msSHPCloseFile -> msShapefileClose
msSHPWhichShapes -> msShapefileWhichShapes

in:

M      mapscript/swiginc/shapefile.i
M      mapscript/php3/mapscript_i.c
M      maprasterquery.c
M      mapshape.c
M      mapshape.h
M      mapcopy.c
M      shptree.c

Before I commit:

  • is there anything else that should be changed/renames for this ticket?
  • I couldn't find anything applicable to change in msautotest
  • are there any documentation changes required?

comment:5 by tomkralidis, 16 years ago

Cc: dmorissette added

comment:6 by tomkralidis, 16 years ago

Owner: changed from sdlime to tomkralidis

Done (r7240). Let me know if there are documentation changes required anywhere. I'll leave this open for a day or two in case anything comes up.

comment:7 by tomkralidis, 16 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.