perl shapeobj values
Sean Gillies
sgillies at FRII.COM
Fri Jun 3 10:48:36 PDT 2005
Drew,
The authoritative Java/Perl/Python mapscript reference is found through
the "MapScript Reference" link on the MapServer site. This links to
http://zcologia.com/mapserver/
This is the online version of the docs that are distributed with
MapServer under mapscript/docs. The same docs should also found on the
new beta site, but seems to be borked right now.
Sean
On Jun 3, 2005, at 11:42 AM, Simpson wrote:
> It looks like its of data type 'character' in the documentation at
> http://mapserver.gis.umn.edu/doc40/perlmapscript-reference.html and at
> http://mapserver.gis.umn.edu/doc44/swigmapscript-reference.html
>
> Is the shapeObj->{values} in Perl not the same as the one in PHP?
>
> Thanks,
> Drew.
>
>
> -----Original Message-----
> From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]On
> Behalf Of Simpson
> Sent: Friday, June 03, 2005 9:36 AM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: Re: [UMN_MAPSERVER-USERS] perl shapeobj values
>
>
> There is a shapeObj 'values' attribute in documentation at
> http://mapserver.gis.umn.edu/doc44/phpmapscript-class-
> guide.html#ShapeObj
>
> Drew.
>
> -----Original Message-----
> From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]On
> Behalf Of Eric Bridger
> Sent: Friday, June 03, 2005 6:10 AM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: Re: [UMN_MAPSERVER-USERS] perl shapeobj values
>
>
> No ''values' attribute of a shapeObj is exposed in the SWIG Mapscript
> API.
> Just numvalues and the getValue method.
>
> See: http://zcologia.com/mapserver/mapscript#shapeobj
>
> At 04:11 AM 06/03/2005 -0500, Simpson wrote:
>> Thanks, this very nice example will get the job done.
>>
>> Out of curiosity, how would one use the 'values' attribute of
>> shapeObj.
>> I saw lots of PHP examples like $shape->values["Population"].
>> Dumper($shape->{values}) was giving me something cryptic like
>> "\bless( do
>> {...},'_p2p_..')".
>> The server for this project has Mapserver 4.01 and the layers are
>> from SDE.
>>
>> Thanks again,
>> Drew.
>>
>> -----Original Message-----
>> From: Eric Bridger [mailto:eric at gomoos.org]
>> Sent: Thursday, June 02, 2005 9:25 PM
>> To: Simpson; MAPSERVER-USERS at lists.umn.edu
>> Subject: Re: [UMN_MAPSERVER-USERS] perl shapeobj values
>>
>>
>>
>> At 07:51 PM 06/02/2005 -0500, Simpson wrote:
>>> Hello,
>>>
>>> Could someone please tell me how to use the values attribute of
>>> shapeObj
> in
>>> Perl.
>>> I saw lots of examples in PHP, but no Perls.
>>>
>>> Thanks,
>>> Drew.
>>
>> Here's some perl code.
>>
>> if ( !$layerObj->queryByPoint( $map, $click, $mapscript::MS_MULTIPLE,
>> 0 ) )
>> {
>> my $rslts = $layerObj->getResults();
>> if ($rslts)
>> {
>> for (my $i = 0; $i < $rslts->{numresults}; $i++)
>> {
>> my $rslt = $layerObj->getResult($i);
>> my $qid = undef;
>> $qid = $rslt->{shapeindex};
>> my $tid = $rslt->{tileindex};
>> $layerObj->open();
>> my $qshape = $layerObj->getFeature($qid, $tid);
>> if($qshape)
>> {
>> for(my $i = 0; $i < $qshape->{numvalues}; $i++)
>> {
>> my $val = $qshape->getValue($i);
>> my $col = $layerObj->getItem($i);
>> # do something with them.
>> }
>>
>> }
>> $layerObj->close();
>> }# end for results
>> }
>> } # end if queryByPoint
>>
>>
>> See also: http://zcologia.com/mapserver/querying-howto
>
More information about the MapServer-users
mailing list