c#-mapscript, zooming problem on Landsat-Layer

Christian Wilmes C.Wilmes at GMX.DE
Fri Jun 16 04:06:38 EDT 2006


Hi Tamas,

Know it works, the Problem realy was the metadataObj of the Layer. After a short time the Object was destroyed...the number of metadata in the Object were OK but the programm were not able to find some specific metadata information, so I get that error message.

I solved the problem by declaring the metadata-Object as a class-Member. So now it works, but what could be the reason for that problem?


Another problem I've got is on closing the application. Not every but often I get the following error:
System.AccessViolationException was unhandled
  Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
  Source="mapscript_csharp"
  StackTrace:
       at mapscriptPINVOKE.delete_mapObj(HandleRef jarg1)
       at mapObj.Dispose()
       at mapObj.Finalize()



Best Regards
Christian




-------- Original-Nachricht --------
Datum: Wed, 14 Jun 2006 23:37:49 +0200
Von: Tamas Szekeres <szekerest at GMAIL.COM>
An: MAPSERVER-USERS at LISTS.UMN.EDU
Betreff: Re: [UMN_MAPSERVER-USERS] c#-mapscript, zooming problem on Landsat-Layer

> Hi Christian,
> 
> If you are using the "layerObj(mapObj map)" constructor you might have to
> use the latest CVS version with the following fix included in csmodule.i
> 
> /***************************************************************************
> ***
>  * Preventing to take ownership of the memory when constructing objects 
>  * with parent objects (causing nullreference exception, Bug 1743)
>  
> ****************************************************************************
> */
> 
> %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
> }
> %}
> 
> The corresponding bug report is:
> 
> http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1743
> 
> However your error message is slightly confusing so i would not wonder if
> it
> was not the only problem. I am keen to try this out.
> 
> Best Regards,
> 
> Tamas Szekeres
> 
> 
> 
> -----Original Message-----
> From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
> Behalf Of Christian Wilmes
> Sent: Tuesday, June 13, 2006 12:30 PM
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: [UMN_MAPSERVER-USERS] c#-mapscript, zooming problem on
> Landsat-Layer
> 
> Hi all,
> 
> I try to use I Layer from the Landsat-WMS in my c#-Application. The first
> time I get the Layer everything works fine but after zooming or just
> refreshing the map I get the following error:
> msBuildWMSLayerURLBase(): WMS connection error. One of wms_onlineresource,
> wms_server_version, wms_name metadata is missing in layer Landsat.  Please
> either provide a valid CONNECTION URL, or provide those values in the
> layer's metadata.
> 
> Trying it with other layers everything is ok.
> 
> The part of the code where I add the Layer:
> layerObj landsat = new layerObj(myMap);
>             landsat.name = "Landsat";
>             landsat.type = MS_LAYER_TYPE.MS_LAYER_RASTER;
>             landsat.status = mapscript.MS_OFF;
>             landsat.connectiontype = MS_CONNECTION_TYPE.MS_WMS;
>             landsat.connection = "http://wms.jpl.nasa.gov/wms.cgi?";
>             hashTableObj metaLandsat = new hashTableObj();
>             metaLandsat.set("wms_name", "global_mosaic");
>             metaLandsat.set("wms_server_version", "1.1.0");
>             metaLandsat.set("wms_onlineresource",
> "http://wms.jpl.nasa.gov/wms.cgi?");
>             metaLandsat.set("wms_srs", "EPSG:4326");
>             metaLandsat.set("wms_format", "image/jpeg");
>             metaLandsat.set("wms_style", "");
>             metaLandsat.set("wms_connectiontimeout", "100");
>             landsat.metadata = metaLandsat;
>             landsat.setProjection("init=epsg:4326");
> 
> 
> 
> Hope anybody could help me with that problem.
> 
> Best Regards
> Christian
> -- 
> 
> 
> "Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
> Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.394 / Virus Database: 268.8.4/363 - Release Date: 2006.06.13.
>  
> 
> -- 
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.394 / Virus Database: 268.8.4/364 - Release Date: 2006.06.14.
>  

-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer



More information about the mapserver-users mailing list