Opened 19 years ago

Closed 19 years ago

#1332 closed defect (fixed)

Faulty DBF for shapefile produced by SHPTREEVIS

Reported by: richard.roger@… Owned by: warmerdam
Priority: low Milestone:
Component: Command Line Utilties Version: 4.4
Severity: minor Keywords:
Cc:

Description

Mapserver 4.4.2 distribution running on Sun Solaris 2.8 using gcc 3.4.2 for 
building.

SHPTREEVIS does not produce shapefiles that ESRI's Arcview 3.2 (for Unix) 
would open.  This appears to be a problem with the DBF file that shptreevis.c 
writes, in that the DBF and SHP are inconsistent.  I traced it down to the 
statement on line 187 in shptreevis.c just after a "#ifdef MAPSERVER".  This 
is currently

"	this_rec = hDBF->nRecords - 1;"

but  needs to be 

"	this_rec = hDBF->nRecords ;"

if the shapefiles (incl. DBF) are to be OK for Arcview 3.2 .  Given the nature 
of the comment at the "#ifdef", I am not confident that this "fix" would be 
fully correct.  I inserted a 'print this_rec' statement after this 
assignment.  When the current version is run, it just prints out "-1" each 
time.  With my modification, it prints out a sensible sequence of integers 
starting with 0, and the shapefile (and its DBF) is read by Arcview 3.2 OK.

Change History (2)

comment:1 by fwarmerdam, 19 years ago

Owner: changed from sdlime to fwarmerdam
I'll take this one if you don't mind Steve. 

comment:2 by fwarmerdam, 19 years ago

Resolution: fixed
Status: newclosed
I have verified that the existing code was producing a .dbf file with no
records when I ran it.  I applied the suggested change and now a valid file
is produced. 

Change applied only in 4.5.  I don't see this as a sufficiently important
bug to backport the fix to 4.4 given the low likelyhood of a 4.4.3 release.

Note: See TracTickets for help on using tickets.