Number of Layer Features

Tamas Szekeres szekerest at GMAIL.COM
Wed Apr 11 18:21:01 EDT 2007


2007/4/11, Fabio Leme de Almeida <fabio at geoja.com.br>:
> Tamas,
>
> I'm using the following:
>
> for (int i = 0; i < map.numlayers; i++)
> {
>         layerObj Layer = map.getLayer(i);
>         numFeatures = Layer.numitems;
> }
>
> Like I have said, numFeatures always returns zero.
> As you can see, I don't call the Layer.Open(); method. At this example, is
> it necessary ?
> When execute "layerObj Layer = map.getLayer(i);" the method "Open()" is not
> internally called ?
>

No.

getLayer retrieves only the reference of the layer and does not call
any further operation on it.
layerObj.open actually calls msLayerGetItems which is responsible to
fill numitems in.


Best regards,


Tamas


>
> -----Original Message-----
> From: Tamas Szekeres [mailto:szekerest at gmail.com]
> Sent: quarta-feira, 11 de abril de 2007 14:35
> To: Fabio Leme de Almeida
> Cc: MAPSERVER-USERS at lists.umn.edu
> Subject: Re: [UMN_MAPSERVER-USERS] Number of Layer Features
>
> Have you called layerObj.open() ?
>
> Best regards,
>
> Tamas
>
> 2007/4/10, Fabio Leme de Almeida <fabio at geoja.com.br>:
> >
> >
> >
> >
> > Hello All,
> >
> >
> >
> > I'm using PostGres/Posgis.
> >
> >
> >
> > How can I get the number of features existing at one specific Layer ?
> >
> >
> >
> > I'm trying to use the attribute layerObj.numitems but it always returns 0
> > (zero items).
> >
> >
> >
> > Help-me please !!  ;o)
> >
> >
> >
> > Thank's,
> >
> >
> >
> > Fabio
> >
> >
>
>



More information about the mapserver-users mailing list