[mapserver-users] how to access dbf files?

Lowell.Filak lfilak at medinaco.org
Tue Aug 20 13:20:04 EDT 2002


I can't speak directly for the developers. My impression is that there
once (3.3) was only one way (ok, two ways) to access dbf data (ex.
XBase or DBI/XBase).
This caused a lot of confusion because there may have been issues
installing/understanding how to use XBase or DBI/XBase to access the data.
Then in 3.5 the read-only DBFInfo access method was exposed so reads
could be done without external modules. However that didn't solve write
issues without still including XBase or DBI/XBase. So then the write
methods were exposed. That is my theory of what happened.
As far as the "correct" method to access dbf data... I would imagine it
depends on what you want to do. If your doing a lot of dbf access that
needs to use existing indexes you should use something like XBase, if you
don't need indexes but want to query dbf files as if they were RDBMS using
SQL then use something like DBI/XBase (for later porting to RDBMS?), & if
you only want to load a single module (mapscript) then you can use DBFInfo.
Possibly you could report some of the errors you're encountering to help
improve the reliability of DBFInfo or supply pointers for other users?
Lowell F.

On Tue, 20 Aug 2002, Michael Schulz wrote:

> Hello,
>
> could somebody give me a hint on what would be to "right" way to access
> attribute information from a dbf file using mapscript.
>
> I am a little bit confused since there seem to be variuos ways to do so.
> php/mapscript obviously uses its own dbf functionality, perl/mapscript
> uses sometimes the xbase module but also the DBFInfo object that can be
> accessed directly from mapscript. For python/mapscript i rewrote the
> perl/mapscript sample shpinfo.pl to a shpinfo.py using msDBF...
> functions and the DBFInfo object.  But i experienced pretty often that
> these functions were rather unstable (lot of segfaults when doing
> writes). Then i switched to the dbf functions that come with the
> pyshapelib.
>
> Is this confusion real and are there changes to this subject going on,
> or is there no "normal" mapscript way to do so and each language
> adresses this issue differently?
>
> TIA, Michael
>
> --
> -----------------------------------------------------------
> Michael Schulz                                in medias res
> Dipl.-Geologe                              Gesellschaft für
>                                 Informationstechnologie mbH
>                              Sautierstr. 38, 79104 Freiburg
>                                      0761 55695-95 (Fax 96)
> mschulz at webgis.de                             www.webgis.de
>
>




More information about the mapserver-users mailing list