[mapserver-users] how to access dbf files?

Puneet Kishor pkishor at GeoAnalytics.com
Tue Aug 20 12:01:21 EDT 2002


The "right" way is to not use dbf at all... instead import everything other
than the base necessary into a database.

but, of course, that is not what you asked. Hence, the right way is anyway
that works for you... as you said, use the dbase functions provided with the
scripting language of your choice... all of them have those functions. I
have never experienced any problem with the dbf access methods in Perl or
PHP other than the inherent problem that dbf access is sequential, hence,
slow. Still, on a fast machine with little load, the speed is quite good.

if the load is heavy then it is time to go the real database way. One
caveat... to label with an attribute, the attribute has to be in the dbf
file (is that right?). Other than that, selects are a real timesaver with
something like MySQL.

pk/


> -----Original Message-----
> From: Michael Schulz [mailto:mschulz at webgis.de]
> Sent: Tuesday, August 20, 2002 10:00 AM
> To: MapServer Userlist
> Subject: [mapserver-users] how to access dbf files?
> 
> 
> 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