[Mapserver-users] Can't locate object method "TIEHASH"

Lowell Filak lfilak at medinaco.org
Fri May 28 15:43:46 EDT 2004


The following message was sent by Eric Bridger <eric at gomoos.org> on 28
May 2004 13:47:16 -0400.

> On Fri, 2004-05-28 at 12:30, Lowell Filak wrote:
> > The following message was sent by Sean Gillies <sgillies at frii.com> on
> > Fri, 28 May 2004 08:00:31 -0600.
> > 
> > > On May 28, 2004, at 6:38 AM, Eric Bridger wrote:
> > > 
> > > > On Fri, 2004-05-28 at 05:54, Agneta Schick wrote:
> > > >> Hello mapserver-users,
> > > >>
> > > >> I've searched the mail archive and found 2 messages on this topic,
> > > >> both were, however, unanswered.
> > > >>
> > > >> So I'll try again...
> > > >>
> > > >> Platform:
> > > >> 	MapServer 4.0.1
> > > >> 	solaris 9
> > > >> 	Perl 5.8.3
> > > >>
> > > >> I want to test an application querying shape files.
> > > >> My perl mapscript code
> > > >> ...
> > > >>   $layer->queryByPoint($tmp_map,$pnt,$mapscript::MS_SINGLE,1000);
> > > >>   my $res = $layer->getResult(0);
> > > >>   $layer->open();
> > > >>   my $shape=new mapscript::shapeObj($layer->{type});
> > > >>   my $shape_index = $layer->getShape($shape,-1,$res->{shapeindex});
> > > >>   my $table =
> > > >> mapscript::msDBFOpen("/space/b3sn13/webdb/htdocs/ermos/data/ 
> > > >> usgs.dbf","r+");
> > > >> ....
> > > >> is terminated with
> > > >> Can't locate object method "TIEHASH" via package "_DBFHandle".
> > > >>
> > > >> Is this a mapscript problem or is something missing in the  
> > > >> installation?
> > > >>
> > > >> (I tried the same perl script on solaris 8, mapserver 3.6.5,
perl 5.6
> > > >> and got the same error).
> > > >
> > > > This sounds familiar to me but I can't remember the details.
> > > >
> > > > The solution is to not use mapscript's DBF functions. I've never
gotten
> > > > them to work.  Use some other dbase module. I use XBase.pm
> > > > http://search.cpan.org/~janpaz/DBD-XBase-0.241/lib/XBase.pm to
do all
> > > > dbf access of shapefiles.
> > > >
> > > > Eric
> > > >
> > > 
> > > Will one of you enter this as a new MapScript-SWIG bug?  If it turns  
> > > out that
> > > none of us are using the msDBF* functions through mapscript, then I  
> > > should see
> > > about removing them from the module.
> > > 
> > > I too prefer to use XBase much of the time.
> > > 
> > > For querying, use shapeObj::getValue() to get at the attributes of  
> > > features.
> > > The following code
> > > 
> > >      for ($i=0; $i<$layer->{numitems}; $i++) {
> > >          $att_name = $layer->getItem($i);
> > >          $att_value = $shape->getValue($i);
> > >          ...
> > > 
> > > gets attribute names and items.  It's a bit awkward that you can't
get  
> > > both from
> > > the same object.  If you feel strongly about that, file a new
feature  
> > > enhancement
> > > in Bugzilla.
> > > 
> > > cheers,
> > > Sean
> > 
> > Can it be removed? I was under the impression that TCL/MapScript
needed it.
> > 
> > Lowell
> 
> Well, as far as I can tell, msDBFOpen() is already removed. No trace of
> it in mapscript.i. It's not even in any of the docs. So I'm not filing a
> bug. Agneta, you can use Sean's suggestion or XBase.pm.
> 
> Strange. I know I saw those DBF utility methods somewhere, sometime
> ...!?
> 

Eric

Your not loosing your mind :-)
It was documented through 3.6 but after MUM I dumped it from the doc
because it was starting to cause problems at that point.
I think it (or at least the start of the DBFxxxx objects) are still in
the 3.5 doc.

Lowell



More information about the mapserver-users mailing list