Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#1265 closed defect (fixed)

Invalid extent written to SHP file

Reported by: shumilin@… Owned by: sdlime
Priority: high Milestone:
Component: MapServer C Library Version: 4.1
Severity: normal Keywords:
Cc:

Description

in mapshape.c  there is an initialization of
extent structure that in v 4.4.1 looks like this
....
if( psSHP->nRecords == 1 ) {
    psSHP->adBoundsMin[0] = psSHP->adBoundsMax[0] = shape->line[0].point[0].x;
    psSHP->adBoundsMin[1] = psSHP->adBoundsMax[1] = shape->line[0].point[0].y;
    psSHP->adBoundsMin[2] = psSHP->adBoundsMax[1] = shape->line[0].point[0].z;
    psSHP->adBoundsMin[3] = psSHP->adBoundsMax[3] = shape->line[0].point[0].m;
  }
...

Please, note a misprint - Z component initialization must be
...
psSHP->adBoundsMin[2] = psSHP->adBoundsMax[2] = shape->line[0].point[0].z;
...
Now it breaks Y component overwriting psSHP->adBoundsMax[1]
(if the re are no z provided) and produces
significantly invalid SHP files.

Change History (2)

comment:1 by sdlime, 19 years ago

Cc: mapserver-bugs@… added
Resolution: fixed
Status: newclosed
Fixed in both 4.5 and the 4.4 branches. Should appear in 4.4.2...

Steve

comment:2 by mapserver@…, 19 years ago

It seems the this fix also adresses bug 1214
Note: See TracTickets for help on using tickets.