[Mapserver-users] $lyr->getShape($shape,$tile,$record) problem
Eduardo Spremolla
edspremolla at Antel.com.uy
Fri Feb 14 10:29:32 PST 2003
Can some one point me to why I always get $shape->{numlines} == 0 ???
Thanks in advance
Spinet of a heavy hacked qry_point.pl examle from the wiki
PerlMapScript
my $lyr = $map->getLayerByName("ejes") or die('Unable to Open Boundary
Layer!');
$lyr->{status} = $mapscript::MS_ON;
# Query the layer using the created point.
my $zz=$lyr->queryByPoint($map,$pnt,$mapscript::MS_MULTIPLE,0);
# Create a resultcache object to see how many results.
my $rsltcache = $lyr->{resultcache};
#
# How many matches did we find.
$cantidad=$rsltcache->{numresults};
if ( $cantidad == 0 ) {exit;}
#
# Grab the first result (there should only be one).
my $rslt = $lyr->getResult(0);
# What is the shape number.
my $record = $rslt->{shapeindex};
my $tile = $rslt->{tileindex};
$shape= new shapeObj(-1);
$zz=$lyr->getShape($shape,$tile,$record);
print "Retorno $zz\n";
my $num_lines = $shape->{numlines};
print "numlines:$num_lines\n";
$nombre=$shape->getValue(7);
print "NOM:$nombre\n";
More information about the MapServer-users
mailing list