[Mapserver-users] Mapscript doesn't write map file in expected order!

Xiaoyuan Geng gengx at agr.gc.ca
Fri Feb 27 06:16:40 PST 2004


Normally people using a wrapper which assigns MS_Mapfile with related
mapfile, then make the MS_Mapfile available for the web server. We can
also using such format as :
hostURL/cgi-bin/mapserv?map=/mapfilepath/mapfile to load a WMS layer. So
mapfile is needed to setup a WMS in either case.

I am producing WMS enabled layers dynamically. Below is an example link
of my WMS layers. 
http://wms1.agr.gc.ca/cgi-bin/mapserv?map=/usr/www/httpd/htdocs/gdas/temp/my1077890254.map

If you do not want to use WMS view here is the URL for your browser:

http://wms1.agr.gc.ca/cgi-bin/mapserv?map=/usr/local/ms4w/apps/gdas/htdocs/temp/my1077890254.map&service=wms&version=1.1.0&request=getmap&layers=ecoregions
In theory you can add this layer to any of WMS viewers or clients. 
This mapfile has been manually edited after the unexpected mapscript
massage. I hope that there is no manual editing needed. Surely I can
write my own PHP function to do this and make it work. 

Thanks!

Shawn



 

to set up a WMS service set up a WMS service using mapserver

>>> "Kralidis,Tom [Burlington]" <Tom.Kralidis at ec.gc.ca> 02/26/04
01:37PM >>>


> -----Original Message-----
> From: Xiaoyuan Geng [mailto:gengx at agr.gc.ca] 
> Sent: Thursday, February 26, 2004 1:12 PM
> To: warmerdam at pobox.com 
> Cc: mapserver-users at lists.gis.umn.edu 
> Subject: Re: [Mapserver-users] Mapscript doesn't write map 
> file in expected order!
> 
> 
> The map file updated from the PHP mapscript is expected to be 
> readable with WMS clients or viewers such as Intergraph's 
> WMSVIEWER. The segment of the METADATA produced from the 
> script is not well ordered and the map file is not valid for 
> the WMS viewers. After I rearrange the order and get ride of 
> the tabs manually, everything works fine. That is why this 
> issue matters in my case. Also the PHP mapscripts add more 
> unwanted segments such as "scalebar" and "querymap". However 
> I might overlooked some other bugs from side.
>

What is the URL of your WMS?  Note that mapfiles have _nothing_ to do
with
WMS.  The mapfile is the runtime configuration of mapserv CGI.

..Tom
 
> Thanks!
> 
> Shawn
> 
> >>> Frank Warmerdam <warmerdam at pobox.com> 02/26/04 11:19AM >>>
> Xiaoyuan Geng wrote:
> > Hello
> > 
> > I am using PHP Mapscript to add more METADATA contents to a map
> file.
> > It seems that Mapscript resorts the contents of METADATA members
> before
> > I same the map file. Also mapscript adds tab instead of one space 
> > between the name and the content. Any way to fix this problem?
Below
> is
> > the example:
> > 
> > Expected order:
> >                 $myMap->setMetaData("wms_title", "GDAS Geolinking 
> > Map");
> > 	$myMap->setMetaData("wfs_title", "GDAS Geolinking Map");
> > 	$myMap->setMetaData( "wms_onlineresource",$strWMS_WFS );
> > 	$myMap->setMetaData( "wfs_onlineresource",$strWMS_WFS
> > );	
> > 	$myMap->setMetaData( "wms_srs",SERVER_PROJECTIONS );
> > 	$myMap->setMetaData( "wfs_srs",SERVER_PROJECTIONS );
> > 	$myMap->setMetaData( "wms_feature_info_mime_type","text/html"
> > );
> > 
> > Mapscript output:
> > 
> >         "wms_srs"	"EPSG:4269 EPSG:42304 EPSG:42101 EPSG:4326
> > EPSG:26907"
> >         "wms_onlineresource"	
> "myserver/cgi-bin/mapserv?map=map file
> > name"
> >         "wms_title"	"GDAS Geolinking Map"
> >         "wms_feature_info_mime_type"	"text/html"
> >         "wfs_srs"	"EPSG:4269 EPSG:42304 EPSG:42101 EPSG:4326
> > EPSG:26907"
> >         "wfs_title"	"AAFC GDAS Geolinking Map"
> >         "wfs_onlineresource"	
> "myserver/cgi-bin/mapserv?map=map file
> > name"
> 
> Shawn,
> 
> Why should this matter?  My understanding is that there is no 
> significants to the metadata item order. Also, whats wrong 
> with emitting a tab as the spacer?  It still reads and parses 
> as a map file properly, right?
> 
> Best regards,
> -- 
> ---------------------------------------+----------------------
> ----------
> ---------------------------------------+------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com 
> light and sound - activate the windows | http://pobox.com/~warmerdam

> and watch the world go round - Rush    | Geospatial Programmer for
> Rent
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu 
> http://lists.gis.umn.edu/mailman/listinfo/maps> erver-users
> 



More information about the MapServer-users mailing list