Opened 14 years ago

Closed 14 years ago

#554 closed enhancement (fixed)

Align internal shapelib with official shapelib

Reported by: hopfgartner Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.0
Component: postgis Version: master
Keywords: Cc: warmerdam

Description

Internal shapelib files are significantly older then teh current official version. Internal version has deficienncies handling different code pages and misses many other enhancements and fixes.

Attachments (7)

dbfopen.c (52.4 KB ) - added by hopfgartner 14 years ago.
shpopen.c (86.3 KB ) - added by hopfgartner 14 years ago.
safileio.c (9.5 KB ) - added by hopfgartner 14 years ago.
shapefil.h (21.3 KB ) - added by hopfgartner 14 years ago.
Makefile.diff (767 bytes ) - added by hopfgartner 14 years ago.
dbfopen.2.c (69.0 KB ) - added by hopfgartner 14 years ago.
Makefile.in (3.7 KB ) - added by hopfgartner 14 years ago.

Download all attachments as: .zip

Change History (12)

by hopfgartner, 14 years ago

Attachment: dbfopen.c added

by hopfgartner, 14 years ago

Attachment: shpopen.c added

by hopfgartner, 14 years ago

Attachment: safileio.c added

by hopfgartner, 14 years ago

Attachment: shapefil.h added

by hopfgartner, 14 years ago

Attachment: Makefile.diff added

comment:1 by hopfgartner, 14 years ago

The attached files come from current shapelib CVS version.

Furthermore I copied the support for dates the functions DBFReadSetup and DBFReadDeleted from the PostGIS shapelib version.

I applied the fix for http://trac.osgeo.org/postgis/ticket/105, too.

Some warnings are generated during compilation, since shapelib uses the type SAFile.

comment:2 by pramsey, 14 years ago

Right, we aim to have code that emits no warnings at all. I had a look and consulting Frank Warmerdam on this and he pointed out that the dbfopen.c file you have included does not seem to match correctly to the safileio.c mechanisms. That is, calls to fseek(), fread(), etc, in dbfopen.c should actually be calls to psHooks→FSeek(), etc. Your shpopen.c files *does* seem to use the hooks mechanisms, so it seems like you are using an old dbfopen.c and a new shpopen.c file. Could you take another run at this?

by hopfgartner, 14 years ago

Attachment: dbfopen.2.c added

by hopfgartner, 14 years ago

Attachment: Makefile.in added

comment:3 by hopfgartner, 14 years ago

Oh, I've pushed the files from the wrong directory, sorry.

This dbfopen.2.c should do the job. Here, it compiles fine and running it on a couple of shapes gave no problem at all.

Peter

comment:4 by warmerdam, 14 years ago

Cc: warmerdam added

comment:5 by pramsey, 14 years ago

Resolution: fixed
Status: newclosed

Thanks for the clean-up. Builds clean and regression passes. Applied to 1.5 at r5957 and to trunk at r5959.

Note: See TracTickets for help on using tickets.