[mapserver-users] Re: Type initializer exception with C# MapScript - Step 2

Tamas Szekeres szekerest at gmail.com
Fri Oct 2 16:34:40 EDT 2009


Daniel,

Please find my comments inline below...

2009/10/2 Daniel Walton <dgwalton at gmail.com>:
> More pre-apologies for the 101 type questions I'm asking here. Thanks for
> the replies. You were all right, I just had to check all the dll
> dependencies and copy those into my bin folder (32 dlls in all). Now I am
> one inch further down the road. I can create the mapfile (text shown below),
> but how to I get from mapfile to hosted WMS? I will break down the question
> into the parts I can see so far (please add or subtract if I'm off):
>

If you're about to serve WMS from the mapfile, you probably don't need
to deal with MapScript at all. The WMS capabilities are exposed
primarily with the CGI mapscript (ie. mapserv.exe). In this regard
this issue would be more about how to set up your webserver to
interact with mapserv.exe. You said you're using ms4w which contains a
pre-configured apache to serve the mapserver maps. You'll probably
require to use apache-install.bat for setting up the server and modify
the httpd.conf according to your expectations (ports, virtual
directories etc). See the ms4w related documentation for the details.

After setting this up you'll be able to get the map by using a
standard WMS request on the configured port, like:
http://localhost/cgi-bin/mapserv.exe?map=[MAPFILE]&SERVICE=WMS&VERSION=1.1.0&REQUEST=GetMap&SRS=EPSG:4326&BBOX=-67.5725,42.3683,-58.9275,48.13&FORMAT=image/png&WIDTH=300&HEIGHT=200&STYLES=&LAYERS=road


> Do I need to create the mapfile in a specific folder for MapServer to 'see'
> it?

I guess you could use absolute paths (like D:/ms4w/apps/blah/blah.map)
or relative paths to the executing directory as well.

> Are there any other configuration files that need to be created or edited
> for MapServer to expose my map via WMS?

Please refer to the WMS server documentation fro the details:
http://mapserver.org/ogc/wms_server.html

> Can the files in (2) be created/edited via MapScript?
> What would be the base URL of the WMS once it's running?
>

I you would programmatically edit the map config before serving the
WMS, you'll probably require to implement the WMS specification with
your WEB (ASP.NET) application, since the WxS IO redirection haven't
been implemented with the C# bindings, yet.


> Thanks again for your patience in holding my hand for these baby steps!
>

no problem

Best regards,

Tamas


More information about the mapserver-users mailing list