Mapscript c# problems and apache2 scratches

Tamas Szekeres szekerest at GMAIL.COM
Tue Jun 27 18:08:15 EDT 2006


Xavier,

After digging into your code i have found the following problems:

In pMapSetSelection:  "layerObj pLayer = new layerObj(pMapQuery);"
will implicitly add the newly created layer to the map (to the end of
the layers list) with index=1 (you have already a layer with index =
0)
You will have the following layers then:
0 - zonage_reglementaire
1 - selection

After that you are calling "pMapQuery.insertLayer(pLayer, 0);" which
will shift the layers upwards:
0 - zonage_reglementaire
1 - zonage_reglementaire
2 - selection

Free the layer with index = 0  !!!!
0 - freed
1 - zonage_reglementaire
2 - selection

Copy the given layer to index = 0
0 - zonage_reglementaire
1 - zonage_reglementaire
2 - selection

After freeing zonage_reglementaire the resultache of the layer will be
cleared so the subsequent call of pLayerParcelle.getResults() will
return null and a nullreference exception will be raised.

I think the previously described operation is unexpected and you might
want to add the selection layer only once. Therefore you must not call
inserLayer when creating the layer using the constructor with a map
object.

If you will use the current CVS version MS_POSITIONS_ENUM.MS_CC should
be used instead of MS_LABEL_POSITIONS.MS_CC.

I have tested your code on windows.

Best Regards,

Tamas


2006/6/27, Xavier Mauclaire <xavier.mauclaire at geoter.fr>:
> Hi tamas
> You will find joined a sample application that produce an error. I don't
> know if this error is the same as the one that occurs with the web site.
> This sample application uses theads to simulate asp.net requests. Each
> thread loads 3 time  a mapfile and do a searchbypoint. After this a dynamic
> layer is created with the pMapSetSelection(pMapQuery, pShape); function
> If this function is launched the program scratches otherwise all works well.
> Finally ne image is generated.
> mY problem is that i don't know if thr generated error is the same as the
> mapObj_Draw error i get on my server
>
> On the linux server i changed the csmodule.i and append your update code
> request at the end of the file
>
> %typemap(csconstruct, excode=SWIGEXCODE) layerObj(mapObj map) %{:
> this($imcall, true) {
>   if (map != null) this.swigCMemOwn = false;$excode } %}
> %typemap(csconstruct, excode=SWIGEXCODE) classObj(layerObj layer) %{:
> this($imcall, true) {
>   if (layer != null) this.swigCMemOwn = false;$excode } %}
> %typemap(csconstruct, excode=SWIGEXCODE) styleObj(classObj
> parent_class) %{: this($imcall, true) {
>   if (parent_class != null) this.swigCMemOwn = false;$excode } %}
>
> Hope this will help
>
> regards
>
>
> -----------------------------------------
> Xavier Mauclaire
> Service informatique
> GEOTER SAS
> 3, rue Jean Monnet
> 34830 Clapiers France
> Tél.: +33 (0)4.67.59.18.11
> Fax: +33 (0)4.67.59.18.24
> Email: xavier.mauclaire at geoter.fr
> Web site: http://www.geoter.fr
> -------------------------------------------------------
>
>
>
> -----Message d'origine-----
> De : Tamas Szekeres [mailto:szekerest at gmail.com]
> Envoyé : lundi 26 juin 2006 17:55
> À : Xavier Mauclaire
> Cc : MAPSERVER-USERS at lists.umn.edu
> Objet : Re: Mapscript c# problems and apache2 scratches
>
> Xavier,
>
> Could you extract the problem as a sample application, like you have done
> with the previous issue?
> How did you make the test? How many requests should be made? Is the problem
> deterministic of occurs randomly at different functions.
>
> Tamas
>
>
> 2006/6/26, Xavier Mauclaire <xavier.mauclaire at geoter.fr>:
> >
> >
> > HI
> >
> > New problem with the mapscript c# library.
> > I'm doing a web site using, among others, querybyshape function. If
> > there are several requests using this function i scratches the server
> >
> >
>
>
>



More information about the mapserver-users mailing list