Need Help Displaying Info from DBFs

Ethan Alpert ealpert at DIGITALGLOBE.COM
Fri Jan 14 15:20:28 PST 2005


Probably not the answer you're looking for but one day I looked inside
the Geo::Shapelib module for perl and found a bunch of functions for
reading DBF,

Here's a little code snippet:

$dbf_handle = Geo::Shapelib::DBFOpen(UPLOAD_DIR . $q->user_name() .
"/shapefiles/" . $shpnames[$i] . ".dbf",'rb');
$dbf = Geo::Shapelib::DBFRead($dbf_handle,0);
Geo::Shapelib::DBFClose($dbf_handle);
foreach $b (keys %{$dbf->{FieldTypes}}) { 
          push @{$fldn{$shpnames[$i]}} ,$b;
}



More information about the MapServer-users mailing list